Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | package com.android.server.am; |
| 18 | |
| 19 | /** |
| 20 | * Common class for the various debug {@link android.util.Log} output configuration in the activity |
| 21 | * manager package. |
| 22 | */ |
| 23 | class ActivityManagerDebugConfig { |
| 24 | |
| 25 | // All output logs in the activity manager package use the {@link #TAG_AM} string for tagging |
| 26 | // their log output. This makes it easy to identify the origin of the log message when sifting |
| 27 | // through a large amount of log output from multiple sources. However, it also makes trying |
| 28 | // to figure-out the origin of a log message while debugging the activity manager a little |
| 29 | // painful. By setting this constant to true, log messages from the activity manager package |
| 30 | // will be tagged with their class names instead fot the generic tag. |
| 31 | static final boolean TAG_WITH_CLASS_NAME = false; |
| 32 | |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 33 | // While debugging it is sometimes useful to have the category name of the log appended to the |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 34 | // base log tag to make sifting through logs with the same base tag easier. By setting this |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 35 | // constant to true, the category name of the log point will be appended to the log tag. |
| 36 | static final boolean APPEND_CATEGORY_NAME = false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 37 | |
| 38 | // Default log tag for the activity manager package. |
| 39 | static final String TAG_AM = "ActivityManager"; |
| 40 | |
| 41 | // Enable all debug log categories. |
| 42 | static final boolean DEBUG_ALL = false; |
| 43 | |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 44 | // Enable all debug log categories for activities. |
| 45 | static final boolean DEBUG_ALL_ACTIVITIES = DEBUG_ALL || false; |
| 46 | |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 47 | // Available log categories in the activity manager package. |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 48 | static final boolean DEBUG_ADD_REMOVE = DEBUG_ALL_ACTIVITIES || false; |
Dianne Hackborn | 9369efd | 2016-03-02 15:49:58 -0800 | [diff] [blame] | 49 | static final boolean DEBUG_ANR = false; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 50 | static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false; |
Dianne Hackborn | 85e3564 | 2017-01-12 15:10:57 -0800 | [diff] [blame] | 51 | static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 52 | static final boolean DEBUG_BACKUP = DEBUG_ALL || false; |
| 53 | static final boolean DEBUG_BROADCAST = DEBUG_ALL || false; |
| 54 | static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false; |
| 55 | static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false; |
| 56 | static final boolean DEBUG_CLEANUP = DEBUG_ALL || false; |
| 57 | static final boolean DEBUG_CONFIGURATION = DEBUG_ALL || false; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 58 | static final boolean DEBUG_CONTAINERS = DEBUG_ALL_ACTIVITIES || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 59 | static final boolean DEBUG_FOCUS = false; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 60 | static final boolean DEBUG_IDLE = DEBUG_ALL_ACTIVITIES || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 61 | static final boolean DEBUG_IMMERSIVE = DEBUG_ALL || false; |
Craig Mautner | e057020 | 2015-05-13 13:06:11 -0700 | [diff] [blame] | 62 | static final boolean DEBUG_LOCKTASK = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 63 | static final boolean DEBUG_LRU = DEBUG_ALL || false; |
| 64 | static final boolean DEBUG_MU = DEBUG_ALL || false; |
Sudheer Shanka | e736185 | 2017-03-07 11:51:46 -0800 | [diff] [blame] | 65 | static final boolean DEBUG_NETWORK = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 66 | static final boolean DEBUG_OOM_ADJ = DEBUG_ALL || false; |
Dianne Hackborn | f4dd371 | 2017-05-11 17:25:23 -0700 | [diff] [blame] | 67 | static final boolean DEBUG_OOM_ADJ_REASON = DEBUG_ALL || false; |
Andrii Kulian | b1888aa | 2018-02-16 14:40:42 -0800 | [diff] [blame] | 68 | static final boolean DEBUG_PAUSE = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 69 | static final boolean DEBUG_POWER = DEBUG_ALL || false; |
| 70 | static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false; |
| 71 | static final boolean DEBUG_PROCESS_OBSERVERS = DEBUG_ALL || false; |
| 72 | static final boolean DEBUG_PROCESSES = DEBUG_ALL || false; |
| 73 | static final boolean DEBUG_PROVIDER = DEBUG_ALL || false; |
| 74 | static final boolean DEBUG_PSS = DEBUG_ALL || false; |
| 75 | static final boolean DEBUG_RECENTS = DEBUG_ALL || false; |
Winson Chung | d6aa3db | 2017-10-05 17:18:43 -0700 | [diff] [blame] | 76 | static final boolean DEBUG_RECENTS_TRIM_TASKS = DEBUG_RECENTS || false; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 77 | static final boolean DEBUG_RELEASE = DEBUG_ALL_ACTIVITIES || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 78 | static final boolean DEBUG_RESULTS = DEBUG_ALL || false; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 79 | static final boolean DEBUG_SAVED_STATE = DEBUG_ALL_ACTIVITIES || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 80 | static final boolean DEBUG_SERVICE = DEBUG_ALL || false; |
Dianne Hackborn | cb01563 | 2017-06-14 17:30:15 -0700 | [diff] [blame] | 81 | static final boolean DEBUG_FOREGROUND_SERVICE = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 82 | static final boolean DEBUG_SERVICE_EXECUTING = DEBUG_ALL || false; |
| 83 | static final boolean DEBUG_STACK = DEBUG_ALL || false; |
Bryce Lee | 1d0d514 | 2018-04-12 10:35:07 -0700 | [diff] [blame] | 84 | static final boolean DEBUG_STATES = DEBUG_ALL_ACTIVITIES || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 85 | static final boolean DEBUG_SWITCH = DEBUG_ALL || false; |
| 86 | static final boolean DEBUG_TASKS = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 87 | static final boolean DEBUG_TRANSITION = DEBUG_ALL || false; |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 88 | static final boolean DEBUG_UID_OBSERVERS = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 89 | static final boolean DEBUG_URI_PERMISSION = DEBUG_ALL || false; |
| 90 | static final boolean DEBUG_USER_LEAVING = DEBUG_ALL || false; |
Chong Zhang | 2b79af1 | 2016-02-10 18:47:06 -0800 | [diff] [blame] | 91 | static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false; |
Amith Yamasani | 85757fc | 2015-04-03 13:31:18 -0700 | [diff] [blame] | 92 | static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false; |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 93 | static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false; |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 94 | static final boolean DEBUG_WHITELISTS = DEBUG_ALL || false; |
Jorim Jaggi | 172e99f | 2017-10-20 14:33:18 +0200 | [diff] [blame] | 95 | static final boolean DEBUG_METRICS = DEBUG_ALL || false; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 96 | |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 97 | static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : ""; |
| 98 | static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : ""; |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 99 | static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : ""; |
| 100 | static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : ""; |
| 101 | static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : ""; |
| 102 | static final String POSTFIX_CONFIGURATION = (APPEND_CATEGORY_NAME) ? "_Configuration" : ""; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 103 | static final String POSTFIX_CONTAINERS = (APPEND_CATEGORY_NAME) ? "_Containers" : ""; |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 104 | static final String POSTFIX_FOCUS = (APPEND_CATEGORY_NAME) ? "_Focus" : ""; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 105 | static final String POSTFIX_IDLE = (APPEND_CATEGORY_NAME) ? "_Idle" : ""; |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 106 | static final String POSTFIX_IMMERSIVE = (APPEND_CATEGORY_NAME) ? "_Immersive" : ""; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 107 | static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LockTask" : ""; |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 108 | static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : ""; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 109 | static final String POSTFIX_MU = "_MU"; |
Sudheer Shanka | e736185 | 2017-03-07 11:51:46 -0800 | [diff] [blame] | 110 | static final String POSTFIX_NETWORK = "_Network"; |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 111 | static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : ""; |
Wale Ogunwale | ee006da | 2015-03-30 14:49:25 -0700 | [diff] [blame] | 112 | static final String POSTFIX_PAUSE = (APPEND_CATEGORY_NAME) ? "_Pause" : ""; |
| 113 | static final String POSTFIX_POWER = (APPEND_CATEGORY_NAME) ? "_Power" : ""; |
| 114 | static final String POSTFIX_PROCESS_OBSERVERS = (APPEND_CATEGORY_NAME) |
| 115 | ? "_ProcessObservers" : ""; |
| 116 | static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : ""; |
| 117 | static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : ""; |
| 118 | static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : ""; |
Wale Ogunwale | ee006da | 2015-03-30 14:49:25 -0700 | [diff] [blame] | 119 | static final String POSTFIX_RECENTS = (APPEND_CATEGORY_NAME) ? "_Recents" : ""; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 120 | static final String POSTFIX_RELEASE = (APPEND_CATEGORY_NAME) ? "_Release" : ""; |
| 121 | static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : ""; |
| 122 | static final String POSTFIX_SAVED_STATE = (APPEND_CATEGORY_NAME) ? "_SavedState" : ""; |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 123 | static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : ""; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 124 | static final String POSTFIX_SERVICE_EXECUTING = |
Wale Ogunwale | 3ab9a27 | 2015-03-16 09:55:45 -0700 | [diff] [blame] | 125 | (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : ""; |
Wale Ogunwale | ee006da | 2015-03-30 14:49:25 -0700 | [diff] [blame] | 126 | static final String POSTFIX_STACK = (APPEND_CATEGORY_NAME) ? "_Stack" : ""; |
Wale Ogunwale | 0fc365c | 2015-05-25 19:35:42 -0700 | [diff] [blame] | 127 | static final String POSTFIX_STATES = (APPEND_CATEGORY_NAME) ? "_States" : ""; |
Wale Ogunwale | ee006da | 2015-03-30 14:49:25 -0700 | [diff] [blame] | 128 | static final String POSTFIX_SWITCH = (APPEND_CATEGORY_NAME) ? "_Switch" : ""; |
| 129 | static final String POSTFIX_TASKS = (APPEND_CATEGORY_NAME) ? "_Tasks" : ""; |
Wale Ogunwale | ee006da | 2015-03-30 14:49:25 -0700 | [diff] [blame] | 130 | static final String POSTFIX_TRANSITION = (APPEND_CATEGORY_NAME) ? "_Transition" : ""; |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 131 | static final String POSTFIX_UID_OBSERVERS = (APPEND_CATEGORY_NAME) |
| 132 | ? "_UidObservers" : ""; |
Wale Ogunwale | ee006da | 2015-03-30 14:49:25 -0700 | [diff] [blame] | 133 | static final String POSTFIX_URI_PERMISSION = (APPEND_CATEGORY_NAME) ? "_UriPermission" : ""; |
| 134 | static final String POSTFIX_USER_LEAVING = (APPEND_CATEGORY_NAME) ? "_UserLeaving" : ""; |
| 135 | static final String POSTFIX_VISIBILITY = (APPEND_CATEGORY_NAME) ? "_Visibility" : ""; |
Wale Ogunwale | d57969f | 2014-11-15 19:37:29 -0800 | [diff] [blame] | 136 | |
| 137 | } |