Android-cuttlefish cvd tool
server_common.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <stdint.h>
20
21#include <memory>
22#include <string>
23#include <vector>
24
26
27namespace cuttlefish {
28namespace confui {
29enum class MainLoopState : uint32_t {
30 kInit = 1,
31 kInSession = 2,
32 kWaitStop = 3, // wait ack after sending confirm/cancel
33 kAwaitCleanup = 5,
34 kTerminated = 8,
35 kInvalid = 9
36};
37
38using TeeUiFrame = std::vector<uint32_t>;
39
40// FSM input to Session FSM
41enum class FsmInput : uint32_t {
42 kUserEvent = 1,
47};
48
49std::string ToString(FsmInput input);
50std::string ToString(const MainLoopState& state);
51
52FsmInput ToFsmInput(const ConfUiMessage& msg);
53
54std::unique_ptr<ConfUiMessage> CreateFromUserSelection(
55 const std::string& session_id, UserResponse::type user_selection);
56} // end of namespace confui
57} // end of namespace cuttlefish
std::unique_ptr< ConfUiMessage > CreateFromUserSelection(const std::string &session_id, UserResponse::type user_selection)
FsmInput
Definition: server_common.h:41
std::vector< uint32_t > TeeUiFrame
Definition: server_common.h:38
FsmInput ToFsmInput(const ConfUiMessage &msg)
Definition: server_common.cc:20
std::string ToString(const ConfUiMessage &msg)
Definition: protocol.cpp:93
MainLoopState
Definition: server_common.h:29
Definition: alloc_driver.h:20
std::string type
Definition: protocol_types.h:65