• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2017 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
17syntax = "proto2";
18
19package android.app;
20
21option java_outer_classname = "AppProtoEnums";
22option java_multiple_files = true;
23
24// ActivityManagerInternal.java's APP_TRANSITION reasons.
25enum AppTransitionReasonEnum {
26    APP_TRANSITION_REASON_UNKNOWN = 0;
27    // The transition was started because we drew the splash screen.
28    APP_TRANSITION_SPLASH_SCREEN = 1;
29    // The transition was started because all app windows were drawn.
30    APP_TRANSITION_WINDOWS_DRAWN = 2;
31    // The transition was started because of a timeout.
32    APP_TRANSITION_TIMEOUT = 3;
33    // The transition was started because we drew a task snapshot.
34    APP_TRANSITION_SNAPSHOT = 4;
35    // The transition was started because it was a recents animation and we only needed to wait on
36    // the wallpaper.
37    APP_TRANSITION_RECENTS_ANIM = 5;
38}
39
40// ActivityManager.java PROCESS_STATEs
41// Next tag: 1021
42enum ProcessStateEnum {
43    // Unlike the ActivityManager PROCESS_STATE values, the ordering and numerical values
44    // here are completely fixed and arbitrary. Order is irrelevant.
45    // No attempt need be made to keep them in sync.
46    // The values here must not be modified. Any new process states can be appended to the end.
47
48    // Process state that is unknown to this proto file (i.e. is not mapped
49    // by ActivityManager.processStateAmToProto()). Can only happen if there's a bug in the mapping.
50    PROCESS_STATE_UNKNOWN_TO_PROTO = 998;
51    // Not a real process state.
52    PROCESS_STATE_UNKNOWN = 999;
53    // Process is a persistent system process.
54    PROCESS_STATE_PERSISTENT = 1000;
55    // Process is a persistent system process and is doing UI.
56    PROCESS_STATE_PERSISTENT_UI = 1001;
57    // Process is hosting the current top activities. Note that this covers
58    // all activities that are visible to the user.
59    PROCESS_STATE_TOP = 1002;
60    // Process is bound to a TOP app.
61    PROCESS_STATE_BOUND_TOP = 1020;
62    // Process is hosting a foreground service.
63    PROCESS_STATE_FOREGROUND_SERVICE = 1003;
64    // Process is hosting a service bound by the system or another foreground app.
65    PROCESS_STATE_BOUND_FOREGROUND_SERVICE = 1004;
66    // Process is important to the user, and something they are aware of.
67    PROCESS_STATE_IMPORTANT_FOREGROUND = 1005;
68    // Process is important to the user, but not something they are aware of.
69    PROCESS_STATE_IMPORTANT_BACKGROUND = 1006;
70    // Process is in the background transient so we will try to keep running.
71    PROCESS_STATE_TRANSIENT_BACKGROUND = 1007;
72    // Process is in the background running a backup/restore operation.
73    PROCESS_STATE_BACKUP = 1008;
74    // Process is in the background running a service. Unlike oom_adj, this
75    // level is used for both the normal running in background state and the
76    // executing operations state.
77    PROCESS_STATE_SERVICE = 1009;
78    // Process is in the background running a receiver. Note that from the
79    // perspective of oom_adj, receivers run at a higher foreground level, but
80    // for our prioritization here that is not necessary and putting them
81    // below services means many fewer changes in some process states as they
82    // receive broadcasts.
83    PROCESS_STATE_RECEIVER = 1010;
84    // Same as PROCESS_STATE_TOP but while device is sleeping.
85    PROCESS_STATE_TOP_SLEEPING = 1011;
86    // Process is in the background, but it can't restore its state so we want
87    // to try to avoid killing it.
88    PROCESS_STATE_HEAVY_WEIGHT = 1012;
89    // Process is in the background but hosts the home activity.
90    PROCESS_STATE_HOME = 1013;
91    // Process is in the background but hosts the last shown activity.
92    PROCESS_STATE_LAST_ACTIVITY = 1014;
93    // Process is being cached for later use and contains activities.
94    PROCESS_STATE_CACHED_ACTIVITY = 1015;
95    // Process is being cached for later use and is a client of another cached
96    // process that contains activities.
97    PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 1016;
98    // Process is being cached for later use and has an activity that corresponds
99    // to an existing recent task.
100    PROCESS_STATE_CACHED_RECENT = 1017;
101    // Process is being cached for later use and is empty.
102    PROCESS_STATE_CACHED_EMPTY = 1018;
103    // Process does not exist.
104    PROCESS_STATE_NONEXISTENT = 1019;
105}
106
107// AppOpsManager.java - operation ids for logging
108enum AppOpEnum {
109    APP_OP_NONE = -1;
110    APP_OP_COARSE_LOCATION = 0;
111    APP_OP_FINE_LOCATION = 1;
112    APP_OP_GPS = 2;
113    APP_OP_VIBRATE = 3;
114    APP_OP_READ_CONTACTS = 4;
115    APP_OP_WRITE_CONTACTS = 5;
116    APP_OP_READ_CALL_LOG = 6;
117    APP_OP_WRITE_CALL_LOG = 7;
118    APP_OP_READ_CALENDAR = 8;
119    APP_OP_WRITE_CALENDAR = 9;
120    APP_OP_WIFI_SCAN = 10;
121    APP_OP_POST_NOTIFICATION = 11;
122    APP_OP_NEIGHBORING_CELLS = 12;
123    APP_OP_CALL_PHONE = 13;
124    APP_OP_READ_SMS = 14;
125    APP_OP_WRITE_SMS = 15;
126    APP_OP_RECEIVE_SMS = 16;
127    APP_OP_RECEIVE_EMERGENCY_SMS = 17;
128    APP_OP_RECEIVE_MMS = 18;
129    APP_OP_RECEIVE_WAP_PUSH = 19;
130    APP_OP_SEND_SMS = 20;
131    APP_OP_READ_ICC_SMS = 21;
132    APP_OP_WRITE_ICC_SMS = 22;
133    APP_OP_WRITE_SETTINGS = 23;
134    APP_OP_SYSTEM_ALERT_WINDOW = 24;
135    APP_OP_ACCESS_NOTIFICATIONS = 25;
136    APP_OP_CAMERA = 26;
137    APP_OP_RECORD_AUDIO = 27;
138    APP_OP_PLAY_AUDIO = 28;
139    APP_OP_READ_CLIPBOARD = 29;
140    APP_OP_WRITE_CLIPBOARD = 30;
141    APP_OP_TAKE_MEDIA_BUTTONS = 31;
142    APP_OP_TAKE_AUDIO_FOCUS = 32;
143    APP_OP_AUDIO_MASTER_VOLUME = 33;
144    APP_OP_AUDIO_VOICE_VOLUME = 34;
145    APP_OP_AUDIO_RING_VOLUME = 35;
146    APP_OP_AUDIO_MEDIA_VOLUME = 36;
147    APP_OP_AUDIO_ALARM_VOLUME = 37;
148    APP_OP_AUDIO_NOTIFICATION_VOLUME = 38;
149    APP_OP_AUDIO_BLUETOOTH_VOLUME = 39;
150    APP_OP_WAKE_LOCK = 40;
151    APP_OP_MONITOR_LOCATION = 41;
152    APP_OP_MONITOR_HIGH_POWER_LOCATION = 42;
153    APP_OP_GET_USAGE_STATS = 43;
154    APP_OP_MUTE_MICROPHONE = 44;
155    APP_OP_TOAST_WINDOW = 45;
156    APP_OP_PROJECT_MEDIA = 46;
157    APP_OP_ACTIVATE_VPN = 47;
158    APP_OP_WRITE_WALLPAPER = 48;
159    APP_OP_ASSIST_STRUCTURE = 49;
160    APP_OP_ASSIST_SCREENSHOT = 50;
161    APP_OP_READ_PHONE_STATE = 51;
162    APP_OP_ADD_VOICEMAIL = 52;
163    APP_OP_USE_SIP = 53;
164    APP_OP_PROCESS_OUTGOING_CALLS = 54;
165    APP_OP_USE_FINGERPRINT = 55;
166    APP_OP_BODY_SENSORS = 56;
167    APP_OP_READ_CELL_BROADCASTS = 57;
168    APP_OP_MOCK_LOCATION = 58;
169    APP_OP_READ_EXTERNAL_STORAGE = 59;
170    APP_OP_WRITE_EXTERNAL_STORAGE = 60;
171    APP_OP_TURN_SCREEN_ON = 61;
172    APP_OP_GET_ACCOUNTS = 62;
173    APP_OP_RUN_IN_BACKGROUND = 63;
174    APP_OP_AUDIO_ACCESSIBILITY_VOLUME = 64;
175    APP_OP_READ_PHONE_NUMBERS = 65;
176    APP_OP_REQUEST_INSTALL_PACKAGES = 66;
177    APP_OP_PICTURE_IN_PICTURE = 67;
178    APP_OP_INSTANT_APP_START_FOREGROUND = 68;
179    APP_OP_ANSWER_PHONE_CALLS = 69;
180    APP_OP_RUN_ANY_IN_BACKGROUND = 70;
181    APP_OP_CHANGE_WIFI_STATE = 71;
182    APP_OP_REQUEST_DELETE_PACKAGES = 72;
183    APP_OP_BIND_ACCESSIBILITY_SERVICE = 73;
184    APP_OP_ACCEPT_HANDOVER = 74;
185    APP_OP_MANAGE_IPSEC_TUNNELS = 75;
186    APP_OP_START_FOREGROUND = 76;
187    APP_OP_BLUETOOTH_SCAN = 77;
188    APP_OP_USE_BIOMETRIC = 78;
189    APP_OP_ACTIVITY_RECOGNITION = 79;
190    APP_OP_SMS_FINANCIAL_TRANSACTIONS = 80;
191    APP_OP_READ_MEDIA_AUDIO = 81;
192    APP_OP_WRITE_MEDIA_AUDIO = 82;
193    APP_OP_READ_MEDIA_VIDEO = 83;
194    APP_OP_WRITE_MEDIA_VIDEO = 84;
195    APP_OP_READ_MEDIA_IMAGES = 85;
196    APP_OP_WRITE_MEDIA_IMAGES = 86;
197    APP_OP_LEGACY_STORAGE = 87;
198    APP_OP_ACCESS_ACCESSIBILITY = 88;
199    APP_OP_READ_DEVICE_IDENTIFIERS = 89;
200    APP_OP_ACCESS_MEDIA_LOCATION = 90;
201    APP_OP_QUERY_ALL_PACKAGES = 91;
202    APP_OP_MANAGE_EXTERNAL_STORAGE = 92;
203    APP_OP_INTERACT_ACROSS_PROFILES = 93;
204    APP_OP_ACTIVATE_PLATFORM_VPN = 94;
205    APP_OP_LOADER_USAGE_STATS = 95;
206    APP_OP_DEPRECATED_1 = 96 [deprecated = true];
207    APP_OP_AUTO_REVOKE_PERMISSIONS_IF_UNUSED = 97;
208    APP_OP_AUTO_REVOKE_MANAGED_BY_INSTALLER = 98;
209    APP_OP_NO_ISOLATED_STORAGE = 99;
210    APP_OP_PHONE_CALL_MICROPHONE = 100;
211    APP_OP_PHONE_CALL_CAMERA = 101;
212    APP_OP_RECORD_AUDIO_HOTWORD = 102;
213    APP_OP_MANAGE_ONGOING_CALLS = 103;
214    APP_OP_MANAGE_CREDENTIALS = 104;
215    APP_OP_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER = 105;
216    APP_OP_RECORD_AUDIO_OUTPUT = 106;
217    APP_OP_SCHEDULE_EXACT_ALARM = 107;
218    APP_OP_FINE_LOCATION_SOURCE = 108;
219    APP_OP_COARSE_LOCATION_SOURCE = 109;
220    APP_OP_MANAGE_MEDIA = 110;
221    APP_OP_BLUETOOTH_CONNECT = 111;
222    APP_OP_UWB_RANGING = 112;
223    APP_OP_ACTIVITY_RECOGNITION_SOURCE = 113;
224    APP_OP_BLUETOOTH_ADVERTISE = 114;
225    APP_OP_RECORD_INCOMING_PHONE_AUDIO = 115;
226    APP_OP_NEARBY_WIFI_DEVICES = 116;
227    APP_OP_ESTABLISH_VPN_SERVICE = 117;
228    APP_OP_ESTABLISH_VPN_MANAGER = 118;
229    APP_OP_ACCESS_RESTRICTED_SETTINGS = 119;
230    APP_OP_RECEIVE_AMBIENT_TRIGGER_AUDIO = 120;
231}
232
233/**
234 * The reason code that why app process is killed.
235 */
236enum AppExitReasonCode {
237    /**
238     * Application process died due to unknown reason.
239     */
240    REASON_UNKNOWN = 0;
241
242    /**
243     * Application process exit normally by itself, for example,
244     * via {@link android.os.Process#exit}; {@link #status} will specify the exit code.
245     *
246     * <p>Applications should normally not do this, as the system has a better knowledge
247     * in terms of process management.</p>
248     */
249    REASON_EXIT_SELF = 1;
250
251    /**
252     * Application process died due to the result of an OS signal; for example,
253     * {@link android.os.Process#SIGNAL_KILL}; {@link #status} will specify the signum.
254     */
255    REASON_SIGNALED = 2;
256
257    /**
258     * Application process was killed by the system low memory killer, meaning the system was
259     * under memory pressure at the time of kill.
260     */
261    REASON_LOW_MEMORY = 3;
262
263    /**
264     * Application process died because of an unhandled exception in Java code.
265     */
266    REASON_CRASH = 4;
267
268    /**
269     * Application process died because it's crashed due to a native code crash.
270     */
271    REASON_CRASH_NATIVE = 5;
272
273    /**
274     * Application process was killed due to being unresponsive (ANR).
275     */
276    REASON_ANR = 6;
277
278    /**
279     * Application process was killed because it took too long to attach to the system
280     * during the start.
281     */
282    REASON_INITIALIZATION_FAILURE = 7;
283
284    /**
285     * Application process was killed because of initialization failure,
286     * for example, it took too long to attach to the system during the start,
287     * or there was an error during initialization.
288     */
289    REASON_PERMISSION_CHANGE = 8;
290
291    /**
292     * Application process was killed by the activity manager due to excessive resource usage.
293     */
294    REASON_EXCESSIVE_RESOURCE_USAGE = 9;
295
296    /**
297     * Application process was killed because of the user request, for example,
298     * user clicked the "Force stop" button of the application in the Settings,
299     * or swiped away the application from Recents.
300     */
301    REASON_USER_REQUESTED = 10;
302
303    /**
304     * Application process was killed, because the user they are running as on devices
305     * with mutlple users, was stopped.
306     */
307    REASON_USER_STOPPED = 11;
308
309    /**
310     * Application process was killed because its dependency was going away, for example,
311     * a stable content provider connection's client will be killed if the provider is killed.
312     */
313    REASON_DEPENDENCY_DIED = 12;
314
315    /**
316     * Application process was killed by the system for various other reasons,
317     * for example, the application package got disabled by the user;
318     * {@link #description} will specify the cause given by the system.
319     */
320    REASON_OTHER = 13;
321
322    /**
323     * Application process was killed by App Freezer, for example, because it receives
324     * sync binder transactions while being frozen.
325     */
326    REASON_FREEZER = 14;
327}
328
329/**
330 * The supplemental reason code that why app process is killed
331 */
332enum AppExitSubReasonCode {
333    /**
334     * Application process kills subReason is unknown.
335     */
336    SUBREASON_UNKNOWN = 0;
337
338    /**
339     * Application process was killed because user quit it on the "wait for debugger" dialog.
340     */
341    SUBREASON_WAIT_FOR_DEBUGGER = 1;
342
343    /**
344     * Application process was killed by the activity manager because there were too many cached
345     * processes.
346     */
347    SUBREASON_TOO_MANY_CACHED = 2;
348
349    /**
350     * Application process was killed by the activity manager because there were too many empty
351     * processes.
352     */
353    SUBREASON_TOO_MANY_EMPTY = 3;
354
355    /**
356     * Application process was killed by the activity manager because there were too many cached
357     * processes and this process had been in empty state for a long time.
358     */
359    SUBREASON_TRIM_EMPTY = 4;
360
361    /**
362     * Application process was killed by the activity manager because system was on
363     * memory pressure and this process took large amount of cached memory.
364     */
365    SUBREASON_LARGE_CACHED = 5;
366
367    /**
368     * Application process was killed by the activity manager because the system was on
369     * low memory pressure for a significant amount of time since last idle.
370     */
371    SUBREASON_MEMORY_PRESSURE = 6;
372
373    /**
374     * Application process was killed by the activity manager due to excessive CPU usage.
375     */
376    SUBREASON_EXCESSIVE_CPU = 7;
377
378    /**
379     * System update has done (so the system update process should be killed).
380     */
381    SUBREASON_SYSTEM_UPDATE_DONE = 8;
382
383    /**
384     * Kill all foreground services, for now it only occurs when enabling the quiet
385     * mode for the managed profile.
386     */
387    SUBREASON_KILL_ALL_FG = 9;
388
389    /**
390     * All background processes except certain ones were killed, for now it only occurs
391     * when the density of the default display is changed.
392     */
393    SUBREASON_KILL_ALL_BG_EXCEPT = 10;
394
395    /**
396     * The process associated with the UID was explicitly killed, for example,
397     * it could be because of permission changes.
398     */
399    SUBREASON_KILL_UID = 11;
400
401    /**
402     * The process was explicitly killed with its PID, typically because of
403     * the low memory for surfaces.
404     */
405    SUBREASON_KILL_PID = 12;
406
407    /**
408     * The start of the process was invalid.
409     */
410    SUBREASON_INVALID_START = 13;
411
412    /**
413     * The process was killed because it's in an invalid state, typically
414     * it's triggered from SHELL.
415     */
416    SUBREASON_INVALID_STATE = 14;
417
418    /**
419     * The process was killed when it's imperceptible to user, because it was
420     * in a bad state.
421     */
422    SUBREASON_IMPERCEPTIBLE = 15;
423
424    /**
425     * The process was killed because it's being moved out from LRU list.
426     */
427    SUBREASON_REMOVE_LRU = 16;
428
429    /**
430     * The process was killed because it's isolated and was in a cached state.
431     */
432    SUBREASON_ISOLATED_NOT_NEEDED = 17;
433
434    /**
435     * The process was killed because it's in forced-app-standby state, and it's cached and
436     * its uid state is idle; this would be set only when the reason is {@link #REASON_OTHER}.
437     */
438    SUBREASON_CACHED_IDLE_FORCED_APP_STANDBY = 18;
439
440    /**
441     * The process was killed because it fails to freeze/unfreeze binder
442     * or query binder frozen info while being frozen.
443     */
444    SUBREASON_FREEZER_BINDER_IOCTL = 19;
445
446    /**
447     * The process was killed because it receives sync binder transactions
448     * while being frozen.
449     */
450    SUBREASON_FREEZER_BINDER_TRANSACTION = 20;
451
452    /**
453     * The process was killed because of force-stop, it could be due to that
454     * the user clicked the "Force stop" button of the application in the Settings;
455     * this would be set only when the reason is {@link #REASON_USER_REQUESTED}.
456     */
457    SUBREASON_FORCE_STOP = 21;
458
459    /**
460     * The process was killed because the user removed the application away from Recents;
461     * this would be set only when the reason is {@link #REASON_USER_REQUESTED}.
462     */
463    SUBREASON_REMOVE_TASK = 22;
464
465    /**
466     * The process was killed because the user stopped the application from the task manager;
467     * this would be set only when the reason is {@link #REASON_USER_REQUESTED}.
468     */
469    SUBREASON_STOP_APP = 23;
470
471    /**
472     * The process was killed because the user stopped the application from developer options,
473     * or via the adb shell commmand interface; this would be set only when the reason is
474     * {@link #REASON_USER_REQUESTED}.
475     */
476    SUBREASON_KILL_BACKGROUND = 24;
477
478    /**
479     * The process was killed because of package update; this would be set only when the reason is
480     * {@link #REASON_USER_REQUESTED}.
481     */
482    SUBREASON_PACKAGE_UPDATE = 25;
483
484    /**
485     * The process was killed because of undelivered broadcasts; this would be set only when the
486     * reason is {@link #REASON_OTHER}.
487     */
488    SUBREASON_UNDELIVERED_BROADCAST = 26;
489}
490
491/**
492 * The relative importance level that the system places on a process.
493 * Keep sync with the definitions in
494 * {@link android.app.ActivityManager.RunningAppProcessInfo}
495 */
496enum Importance {
497    option allow_alias = true;
498
499    IMPORTANCE_FOREGROUND = 100;
500    IMPORTANCE_FOREGROUND_SERVICE = 125;
501    IMPORTANCE_TOP_SLEEPING_PRE_28 = 150;
502    IMPORTANCE_VISIBLE = 200;
503    IMPORTANCE_PERCEPTIBLE_PRE_26 = 130;
504    IMPORTANCE_PERCEPTIBLE = 230;
505    IMPORTANCE_CANT_SAVE_STATE_PRE_26 = 170;
506    IMPORTANCE_SERVICE = 300;
507    IMPORTANCE_TOP_SLEEPING = 325;
508    IMPORTANCE_CANT_SAVE_STATE = 350;
509    IMPORTANCE_CACHED = 400;
510    IMPORTANCE_BACKGROUND = 400;
511    IMPORTANCE_EMPTY = 500;
512    IMPORTANCE_GONE = 1000;
513}
514