Kweku Adams | e6b00c2 | 2017-10-23 16:46:45 -0700 | [diff] [blame] | 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 | |
| 17 | syntax = "proto2"; |
| 18 | |
| 19 | package android.app; |
| 20 | |
| 21 | option java_multiple_files = true; |
| 22 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 23 | // ActivityManager.java PROCESS_STATEs |
| 24 | enum ProcessState { |
| 25 | // Order matters for process states, so values have been spaced to provide |
| 26 | // room for future additions. |
Kweku Adams | e6b00c2 | 2017-10-23 16:46:45 -0700 | [diff] [blame] | 27 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 28 | // Not a real process state. |
| 29 | PROCESS_STATE_UNKNOWN = -100; |
| 30 | // Process is a persistent system process. |
| 31 | PROCESS_STATE_PERSISTENT = 0; |
| 32 | // Process is a persistent system process and is doing UI. |
| 33 | PROCESS_STATE_PERSISTENT_UI = 100; |
| 34 | // Process is hosting the current top activities. Note that this covers |
| 35 | // all activities that are visible to the user. |
| 36 | PROCESS_STATE_TOP = 200; |
| 37 | // Process is hosting a foreground service due to a system binding. |
| 38 | PROCESS_STATE_BOUND_FOREGROUND_SERVICE = 300; |
| 39 | // Process is hosting a foreground service. |
| 40 | PROCESS_STATE_FOREGROUND_SERVICE = 400; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 41 | // Process is important to the user, and something they are aware of. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 42 | PROCESS_STATE_IMPORTANT_FOREGROUND = 500; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 43 | // Process is important to the user, but not something they are aware of. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 44 | PROCESS_STATE_IMPORTANT_BACKGROUND = 600; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 45 | // Process is in the background transient so we will try to keep running. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 46 | PROCESS_STATE_TRANSIENT_BACKGROUND = 700; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 47 | // Process is in the background running a backup/restore operation. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 48 | PROCESS_STATE_BACKUP = 800; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 49 | // Process is in the background running a service. Unlike oom_adj, this |
| 50 | // level is used for both the normal running in background state and the |
| 51 | // executing operations state. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 52 | PROCESS_STATE_SERVICE = 900; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 53 | // Process is in the background running a receiver. Note that from the |
| 54 | // perspective of oom_adj, receivers run at a higher foreground level, but |
| 55 | // for our prioritization here that is not necessary and putting them |
| 56 | // below services means many fewer changes in some process states as they |
| 57 | // receive broadcasts. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 58 | PROCESS_STATE_RECEIVER = 1000; |
| 59 | // Same as PROCESS_STATE_TOP but while device is sleeping. |
| 60 | PROCESS_STATE_TOP_SLEEPING = 1100; |
| 61 | // Process is in the background, but it can't restore its state so we want |
| 62 | // to try to avoid killing it. |
| 63 | PROCESS_STATE_HEAVY_WEIGHT = 1200; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 64 | // Process is in the background but hosts the home activity. |
| 65 | PROCESS_STATE_HOME = 1300; |
| 66 | // Process is in the background but hosts the last shown activity. |
| 67 | PROCESS_STATE_LAST_ACTIVITY = 1400; |
| 68 | // Process is being cached for later use and contains activities. |
| 69 | PROCESS_STATE_CACHED_ACTIVITY = 1500; |
| 70 | // Process is being cached for later use and is a client of another cached |
| 71 | // process that contains activities. |
| 72 | PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 1600; |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 73 | // Process is being cached for later use and has an activity that corresponds |
| 74 | // to an existing recent task. |
| 75 | PROCESS_STATE_CACHED_RECENT = 1700; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 76 | // Process is being cached for later use and is empty. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 77 | PROCESS_STATE_CACHED_EMPTY = 1800; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 78 | // Process does not exist. |
Kweku Adams | bee6d5f | 2018-01-04 10:03:39 -0800 | [diff] [blame] | 79 | PROCESS_STATE_NONEXISTENT = 1900; |
Kweku Adams | e6b00c2 | 2017-10-23 16:46:45 -0700 | [diff] [blame] | 80 | } |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 81 | |