• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2021 Huawei Device Co., Ltd.
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6//     http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14syntax = "proto3";
15
16option java_package = "ohos.devtools.datasources.transport.grpc.service";
17option optimize_for = LITE_RUNTIME;
18
19message AbilityStateInfo {
20    enum AbilityState {
21        UNSPECIFIED = 0;
22        START = 1;
23        INACTIVE = 2;
24        ACTIVE = 3;
25        BACKGROUND = 4;
26        FOREGROUND = 5;
27        STOP = 6;
28    }
29    int32 life_cycle_id = 1;
30    string ability_name = 2;
31    AbilityState state = 3;
32}
33
34message KeyEvent {
35    int32 key_type = 1;
36    bool is_down = 2;
37}
38
39message TouchEvent {
40    int32 touch_type = 1;
41}
42
43message MouseEvent {
44    int32 action_type = 1;
45    int32 action_button = 2;
46}
47
48message RotationEvent {
49    float value = 1;
50}
51
52message AgentAbilityEvent {
53    // timestamp obtained by CLOCK_REALTIME
54    uint64 tv_sec = 1;
55    uint64 tv_nsec = 2;
56
57    oneof event {
58        AbilityStateInfo ability_state = 3;
59        KeyEvent key_event = 4;
60        TouchEvent touch_event = 5;
61        MouseEvent mouse_event = 6;
62        RotationEvent rotation_event = 7;
63    }
64}
65
66message BatchAgentAbilityEvent {
67    repeated AgentAbilityEvent events = 1;
68}