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: 18 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 // Frozen process. 75 PROCESS_STATE_FROZEN = 17; 76 // Represents all cached states. 77 PROCESS_STATE_CACHED = 18; 78 // Process bound by a top service 79 PROCESS_STATE_BOUND_TOP = 19; 80 // Process bound by foreground service 81 PROCESS_STATE_BOUND_FGS = 20; 82} 83 84enum ServiceOperationState { 85 SERVICE_OPERATION_STATE_UNKNOWN = 0; 86 SERVICE_OPERATION_STATE_RUNNING = 1; 87 SERVICE_OPERATION_STATE_STARTED = 2; 88 SERVICE_OPERATION_STATE_FOREGROUND = 3; 89 SERVICE_OPERATION_STATE_BOUND = 4; 90 SERVICE_OPERATION_STATE_EXECUTING = 5; 91} 92 93// this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java 94// and not frameworks/base/core/java/android/app/ActivityManager.java 95enum AggregatedProcessState { 96 AGGREGATED_PROCESS_STATE_UNKNOWN = 0; 97 // Persistent system process; PERSISTENT or PERSISTENT_UI in ActivityManager 98 AGGREGATED_PROCESS_STATE_PERSISTENT = 1; 99 // Top activity; actually any visible activity; TOP or TOP_SLEEPING in ActivityManager 100 AGGREGATED_PROCESS_STATE_TOP = 2; 101 // Bound top foreground process; BOUND_TOP or BOUND_FOREGROUND_SERVICE in ActivityManager 102 AGGREGATED_PROCESS_STATE_BOUND_TOP_OR_FGS = 3; 103 // Important foreground process; FOREGROUND_SERVICE in ActivityManager 104 AGGREGATED_PROCESS_STATE_FGS = 4; 105 // Important foreground process ; IMPORTANT_FOREGROUND in ActivityManager 106 AGGREGATED_PROCESS_STATE_IMPORTANT_FOREGROUND = 5; 107 // Various background processes; IMPORTANT_BACKGROUND, TRANSIENT_BACKGROUND, BACKUP, SERVICE, 108 // HEAVY_WEIGHT in ActivityManager 109 AGGREGATED_PROCESS_STATE_BACKGROUND = 6; 110 // Process running a receiver; RECEIVER in ActivityManager 111 AGGREGATED_PROCESS_STATE_RECEIVER = 7; 112 // Various cached processes; HOME, LAST_ACTIVITY, CACHED_ACTIVITY, CACHED_RECENT, 113 // CACHED_ACTIVITY_CLIENT, CACHED_EMPTY in ActivityManager 114 AGGREGATED_PROCESS_STATE_CACHED = 8; 115} 116