• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2018 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";
18package android.service.procstats;
19
20option java_multiple_files = true;
21option java_outer_classname = "ProcessStatsEnums";
22
23enum ScreenState {
24    SCREEN_STATE_UNKNOWN = 0;
25    SCREEN_STATE_OFF = 1;
26    SCREEN_STATE_ON = 2;
27}
28
29enum MemoryState {
30    MEMORY_STATE_UNKNOWN = 0;
31    MEMORY_STATE_NORMAL = 1;     // normal.
32    MEMORY_STATE_MODERATE = 2;   // moderate memory pressure.
33    MEMORY_STATE_LOW = 3;        // low memory.
34    MEMORY_STATE_CRITICAL = 4;   // critical memory.
35}
36
37// this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
38// and not frameworks/base/core/java/android/app/ActivityManager.java
39// Next id: 17
40enum ProcessState {
41    PROCESS_STATE_UNKNOWN = 0;
42    // Persistent system process.
43    PROCESS_STATE_PERSISTENT = 1;
44    // Top activity; actually any visible activity.
45    PROCESS_STATE_TOP = 2;
46    // Process bound by top or a foreground service
47    PROCESS_STATE_BOUND_TOP_OR_FGS = 15;
48    // Processing running a foreground service.
49    PROCESS_STATE_FGS = 16;
50    // Important foreground process (ime, wallpaper, etc).
51    PROCESS_STATE_IMPORTANT_FOREGROUND = 3;
52    // Important background process.
53    PROCESS_STATE_IMPORTANT_BACKGROUND = 4;
54    // Performing backup operation.
55    PROCESS_STATE_BACKUP = 5;
56    // Background process running a service.
57    PROCESS_STATE_SERVICE = 6;
58    // Process not running, but would be if there was enough RAM.
59    PROCESS_STATE_SERVICE_RESTARTING = 7;
60    // Process running a receiver.
61    PROCESS_STATE_RECEIVER = 8;
62    // Heavy-weight process (currently not used).
63    PROCESS_STATE_HEAVY_WEIGHT = 9;
64    // Process hosting home/launcher app when not on top.
65    PROCESS_STATE_HOME = 10;
66    // Process hosting the last app the user was in.
67    PROCESS_STATE_LAST_ACTIVITY = 11;
68    // Cached process hosting a previous activity.
69    PROCESS_STATE_CACHED_ACTIVITY = 12;
70    // Cached process hosting a client activity.
71    PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 13;
72    // Cached process that is empty.
73    PROCESS_STATE_CACHED_EMPTY = 14;
74}
75
76enum ServiceOperationState {
77    SERVICE_OPERATION_STATE_UNKNOWN = 0;
78    SERVICE_OPERATION_STATE_RUNNING = 1;
79    SERVICE_OPERATION_STATE_STARTED = 2;
80    SERVICE_OPERATION_STATE_FOREGROUND = 3;
81    SERVICE_OPERATION_STATE_BOUND = 4;
82    SERVICE_OPERATION_STATE_EXECUTING = 5;
83}
84
85// this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
86// and not frameworks/base/core/java/android/app/ActivityManager.java
87enum AggregatedProcessState {
88    AGGREGATED_PROCESS_STATE_UNKNOWN = 0;
89    // Persistent system process; PERSISTENT or PERSISTENT_UI in ActivityManager
90    AGGREGATED_PROCESS_STATE_PERSISTENT = 1;
91    // Top activity; actually any visible activity; TOP or TOP_SLEEPING in ActivityManager
92    AGGREGATED_PROCESS_STATE_TOP = 2;
93    // Bound top foreground process; BOUND_TOP or BOUND_FOREGROUND_SERVICE in ActivityManager
94    AGGREGATED_PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
95    // Important foreground process; FOREGROUND_SERVICE in ActivityManager
96    AGGREGATED_PROCESS_STATE_FGS = 4;
97    // Important foreground process ; IMPORTANT_FOREGROUND in ActivityManager
98    AGGREGATED_PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
99    // Various background processes; IMPORTANT_BACKGROUND, TRANSIENT_BACKGROUND, BACKUP, SERVICE,
100    // HEAVY_WEIGHT in ActivityManager
101    AGGREGATED_PROCESS_STATE_BACKGROUND = 6;
102    // Process running a receiver; RECEIVER in ActivityManager
103    AGGREGATED_PROCESS_STATE_RECEIVER = 7;
104    // Various cached processes; HOME, LAST_ACTIVITY, CACHED_ACTIVITY, CACHED_RECENT,
105    // CACHED_ACTIVITY_CLIENT, CACHED_EMPTY in ActivityManager
106    AGGREGATED_PROCESS_STATE_CACHED = 8;
107}
108