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
39enum ProcessState {
40    PROCESS_STATE_UNKNOWN = 0;
41    // Persistent system process.
42    PROCESS_STATE_PERSISTENT = 1;
43    // Top activity; actually any visible activity.
44    PROCESS_STATE_TOP = 2;
45    // Important foreground process (ime, wallpaper, etc).
46    PROCESS_STATE_IMPORTANT_FOREGROUND = 3;
47    // Important background process.
48    PROCESS_STATE_IMPORTANT_BACKGROUND = 4;
49    // Performing backup operation.
50    PROCESS_STATE_BACKUP = 5;
51    // Background process running a service.
52    PROCESS_STATE_SERVICE = 6;
53    // Process not running, but would be if there was enough RAM.
54    PROCESS_STATE_SERVICE_RESTARTING = 7;
55    // Process running a receiver.
56    PROCESS_STATE_RECEIVER = 8;
57    // Heavy-weight process (currently not used).
58    PROCESS_STATE_HEAVY_WEIGHT = 9;
59    // Process hosting home/launcher app when not on top.
60    PROCESS_STATE_HOME = 10;
61    // Process hosting the last app the user was in.
62    PROCESS_STATE_LAST_ACTIVITY = 11;
63    // Cached process hosting a previous activity.
64    PROCESS_STATE_CACHED_ACTIVITY = 12;
65    // Cached process hosting a client activity.
66    PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 13;
67    // Cached process that is empty.
68    PROCESS_STATE_CACHED_EMPTY = 14;
69}
70
71enum ServiceOperationState {
72    SERVICE_OPERATION_STATE_UNKNOWN = 0;
73    SERVICE_OPERATION_STATE_RUNNING = 1;
74    SERVICE_OPERATION_STATE_STARTED = 2;
75    SERVICE_OPERATION_STATE_FOREGROUND = 3;
76    SERVICE_OPERATION_STATE_BOUND = 4;
77    SERVICE_OPERATION_STATE_EXECUTING = 5;
78}
79