• 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 RunningLockBegin {
20    enum Type {
21        UNSPECIFIED = 0;
22        BACKGROUND = 1;
23        PROXIMITY_SCREEN_CONTROL = 2;
24    }
25
26    int32 lock_id = 1; // 锁ID
27    Type type = 2; // 唤醒锁的类型
28    string name = 3; // 唤醒锁名称
29}
30
31message RunningLockEnd {
32    int32 lock_id = 1; // 锁ID
33}
34
35message PendingIntent {
36    string creator_package = 1; // 创建此PendingIntent的应用程序的程序包名称
37    int32 creator_uid = 2; // 应用程序UID
38}
39
40enum TimerType {
41    UNSPECIFIED = 0;
42    TIMER_TYPE_REALTIME = 1;
43    TIMER_TYPE_WAKEUP = 2;
44    TIMER_TYPE_EXACT = 4;
45    TIMER_TYPE_IDLE = 8;
46}
47
48message OneShotStart {
49    PendingIntent intent = 1;
50    int64 oneshot_id = 2;
51    TimerType type = 3;
52    int64 triggertime_ns = 4;
53}
54
55message RepeatStart {
56    PendingIntent intent = 1;
57    int64 repeat_id = 2;
58    TimerType type = 3;
59    int64 triggertime_ns = 4;
60    int64 interval_ns = 5;
61}
62
63message TimerStop {
64    int64 stop_id = 1;
65}
66
67message LocationRequest {
68    enum Priority {
69        UNSPECIFIED = 0;
70        PRIORITY_UNSET = 512;
71        PRIORITY_ACCURACY = 513;
72        PRIORITY_LOW_POWER = 514;
73        PRIORITY_FAST_FIRST_FIX = 515;
74    }
75    string provider = 1; // 提供位置的程序名称。通过LocationManager设置,则可以是“gps”、“network”、“passive”或空。通过FusedLocationProviderClient设置,则是“fused”。
76    int64 interval_ms = 2; // 位置请求所需的间隔时间(ms),间隔时间越短越耗电
77    int64 fastest_interval_ms = 3; // 位置请求的最快间隔时间(ms)
78    Priority priority = 4; // 位置请求精确度,精确度越高越耗电
79}
80
81message LocationUpdateRequested {
82    PendingIntent intent = 1; // 要为每个位置更新发送的挂起内容的元数据
83    int32 location_id = 2; // 位置ID
84    LocationRequest request = 3; // 位置更新请求
85}
86
87message LocationReport {
88    int32 location_id = 1; // 位置ID
89    float accuracy_of_metre = 2; // 该位置的估计水平精度,径向,单位为米。
90}
91
92message LocationUpdateRemoved {
93    int32 location_id = 1; // 位置ID
94}
95
96message WorkInfo {
97    enum BatteryLevel {
98        BATTERY_LEVEL_LOW = 0;
99        BATTERY_LEVEL_OKAY = 1;
100        BATTERY_LEVEL_LOW_OR_OKAY = 2;
101    }
102    enum ChargeType {
103        CHARGING_PLUGGED_ANY = 0;
104        CHARGING_PLUGGED_AC = 1;
105        CHARGING_PLUGGED_USB = 2;
106        CHARGING_PLUGGED_WIRELESS = 3;
107    }
108    enum NetworkType {
109        NETWORK_TYPE_ANY = 0;
110        NETWORK_TYPE_MOBILE = 1;
111        NETWORK_TYPE_WIFI = 2;
112        NETWORK_TYPE_BLUETOOTH = 3;
113        NETWORK_TYPE_WIFI_P2P = 4;
114        NETWORK_TYPE_ETHERNET = 5;
115    }
116    enum StorageType {
117        STORAGE_LEVEL_LOW = 0;
118        STORAGE_LEVEL_OKAY = 1;
119        STORAGE_LEVEL_LOW_OR_OKAY = 2;
120    }
121
122    string ability_name = 1; // 运行作业的页面名称
123    string bundle_name = 2; // 运行作业的程序名称
124    int32 repeat_counter = 3; // 重复作业次数
125    int64 repeat_cycle_time = 4; // 定期作业重复的间隔时间
126    BatteryLevel battery_level = 5; // 作业设备的电池等级
127    int32 battery_status = 6; // 作业设备的电池状态
128    ChargeType charge_type = 7; // 作业设备的充电类型
129    int32 wait_time = 8; // 非定期作业的延迟时间
130    NetworkType network_type = 9; // 作业运行的网络类型
131    StorageType storage_type = 10; // 作业设备的存储类型
132    bool is_request_battery = 11; // 作业是否需要设备的电池电量不低于临界阈值
133    bool is_request_charging = 12; // 作业是否需要充电
134    bool is_request_deep_idle = 13; // 作业是否需要设备处于空闲维护窗口中
135    bool is_request_delay = 14; // 作业是否需要延迟
136    bool is_request_network = 15; // 作业是否需要网络
137    bool is_request_persisted = 16; // 是否应跨设备重新引导持久化此作业
138    bool is_request_repeat = 17; // 是否在给定时间内重复作业
139    bool is_request_storage = 18; // 作业是否需要设备的存储空间不低
140    bool is_work_info_valid = 19; // 作业是否有效
141}
142
143message WorkStart {
144    int64 work_id = 1;
145    WorkInfo work_info = 2;
146    bool start_now = 3;
147    bool is_start = 4;
148}
149
150message WorkCancel {
151    int64 work_id = 1;
152    bool is_cancel = 2;
153}
154
155message WorkStop {
156    int64 work_id = 1;
157    bool is_stop = 2;
158}
159
160message BackgroundWork {
161    int64 work_id = 1;
162    int32 actual_delay_time = 2;
163    int32 request_id = 3;
164    string reason = 4;
165}
166
167message OnStartWork {
168    int64 work_id = 1;
169    WorkInfo work_info = 2;
170}
171
172message OnStopWork {
173    int64 work_id = 1;
174}
175
176message AgentEnergyEvent {
177    // timestamp obtained by CLOCK_REALTIME
178    uint64 tv_sec = 1;
179    uint64 tv_nsec = 2;
180    string callstack = 3; // 生成此事件的调用堆栈
181    oneof data {
182        RunningLockBegin runlock_begin = 4; // 获取唤醒锁(强制设备保持唤醒)
183        RunningLockEnd runlock_end = 5; // 释放唤醒锁
184        OneShotStart oneshot_start = 6; // 闹钟
185        RepeatStart repeat_start = 7; // 需要重复的闹钟
186        TimerStop timer_stop = 8;
187        LocationUpdateRequested location_update_requested = 9; // 位置更新请求
188        LocationReport location_report = 10;
189        LocationUpdateRemoved location_update_removed = 11; // 位置更新请求已删除
190        WorkStart work_start = 12;
191        WorkCancel work_cancel = 13;
192        WorkStop work_stop = 14;
193        BackgroundWork back_work = 15;
194        OnStartWork on_start = 16; // 启动承载work的服务
195        OnStopWork on_stop = 17; // 停止承载work的服务
196    }
197}
198
199message BatchAgentEnergyEvent {
200    repeated AgentEnergyEvent events = 1;
201}
202