ActivityManagerDebugConfig.java revision 0fc365c1455ebd4064474d27774f41cfcd8e1cb5
1d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale/* 2d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * Copyright (C) 2014 The Android Open Source Project 3d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * 4d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * Licensed under the Apache License, Version 2.0 (the "License"); 5d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * you may not use this file except in compliance with the License. 6d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * You may obtain a copy of the License at 7d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * 8d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * http://www.apache.org/licenses/LICENSE-2.0 9d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * 10d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * Unless required by applicable law or agreed to in writing, software 11d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * distributed under the License is distributed on an "AS IS" BASIS, 12d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * See the License for the specific language governing permissions and 14d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * limitations under the License 15d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale */ 16d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 17d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwalepackage com.android.server.am; 18d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 19d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale/** 20d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * Common class for the various debug {@link android.util.Log} output configuration in the activity 21d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale * manager package. 22d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale */ 23d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwaleclass ActivityManagerDebugConfig { 24d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 25d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // All output logs in the activity manager package use the {@link #TAG_AM} string for tagging 26d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // their log output. This makes it easy to identify the origin of the log message when sifting 27d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // through a large amount of log output from multiple sources. However, it also makes trying 28d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // to figure-out the origin of a log message while debugging the activity manager a little 29d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // painful. By setting this constant to true, log messages from the activity manager package 30d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // will be tagged with their class names instead fot the generic tag. 31d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean TAG_WITH_CLASS_NAME = false; 32d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 333ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale // While debugging it is sometimes useful to have the category name of the log appended to the 34d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // base log tag to make sifting through logs with the same base tag easier. By setting this 353ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale // constant to true, the category name of the log point will be appended to the log tag. 363ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final boolean APPEND_CATEGORY_NAME = false; 37d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 38d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // Default log tag for the activity manager package. 39d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final String TAG_AM = "ActivityManager"; 40d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 41d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // Enable all debug log categories. 42d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_ALL = false; 43d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 440fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale // Enable all debug log categories for activities. 450fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_ALL_ACTIVITIES = DEBUG_ALL || false; 460fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale 47d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale // Available log categories in the activity manager package. 480fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_ADD_REMOVE = DEBUG_ALL_ACTIVITIES || false; 490fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false; 50d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BACKUP = DEBUG_ALL || false; 51d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BROADCAST = DEBUG_ALL || false; 52d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false; 53d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false; 54d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_CLEANUP = DEBUG_ALL || false; 55d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_CONFIGURATION = DEBUG_ALL || false; 560fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_CONTAINERS = DEBUG_ALL_ACTIVITIES || false; 57d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_FOCUS = false; 580fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_IDLE = DEBUG_ALL_ACTIVITIES || false; 59d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_IMMERSIVE = DEBUG_ALL || false; 60d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_LOCKSCREEN = DEBUG_ALL || false; 61e0570201f59342ef02412ece2f179ef42441a032Craig Mautner static final boolean DEBUG_LOCKTASK = DEBUG_ALL || false; 62d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_LRU = DEBUG_ALL || false; 63d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_MU = DEBUG_ALL || false; 64d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_OOM_ADJ = DEBUG_ALL || false; 65d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PAUSE = DEBUG_ALL || false; 66d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_POWER = DEBUG_ALL || false; 67d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false; 68d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PROCESS_OBSERVERS = DEBUG_ALL || false; 69d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PROCESSES = DEBUG_ALL || false; 70d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PROVIDER = DEBUG_ALL || false; 71d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PSS = DEBUG_ALL || false; 72d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_RECENTS = DEBUG_ALL || false; 730fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_RELEASE = DEBUG_ALL_ACTIVITIES || false; 74d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_RESULTS = DEBUG_ALL || false; 750fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_SAVED_STATE = DEBUG_ALL_ACTIVITIES || false; 760fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_SCREENSHOTS = DEBUG_ALL_ACTIVITIES || false; 77d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_SERVICE = DEBUG_ALL || false; 78d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_SERVICE_EXECUTING = DEBUG_ALL || false; 79d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_STACK = DEBUG_ALL || false; 800fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_STATES = DEBUG_ALL_ACTIVITIES || false; 81d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_SWITCH = DEBUG_ALL || false; 82d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_TASKS = DEBUG_ALL || false; 83d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_THUMBNAILS = DEBUG_ALL || false; 84d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_TRANSITION = DEBUG_ALL || false; 85d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn static final boolean DEBUG_UID_OBSERVERS = DEBUG_ALL || false; 86d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_URI_PERMISSION = DEBUG_ALL || false; 87d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_USER_LEAVING = DEBUG_ALL || false; 88ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false; 890fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_VISIBLE_BEHIND = DEBUG_ALL_ACTIVITIES || false; 9085757fceb727f76e42956aec67b1152231ab4ee9Amith Yamasani static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false; 91d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 920fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : ""; 930fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : ""; 943ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : ""; 953ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : ""; 963ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : ""; 973ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_CONFIGURATION = (APPEND_CATEGORY_NAME) ? "_Configuration" : ""; 980fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_CONTAINERS = (APPEND_CATEGORY_NAME) ? "_Containers" : ""; 993ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_FOCUS = (APPEND_CATEGORY_NAME) ? "_Focus" : ""; 1000fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_IDLE = (APPEND_CATEGORY_NAME) ? "_Idle" : ""; 1013ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_IMMERSIVE = (APPEND_CATEGORY_NAME) ? "_Immersive" : ""; 1020fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_LOCKSCREEN = (APPEND_CATEGORY_NAME) ? "_LockScreen" : ""; 1030fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LockTask" : ""; 1043ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : ""; 105d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final String POSTFIX_MU = "_MU"; 1063ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : ""; 107ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PAUSE = (APPEND_CATEGORY_NAME) ? "_Pause" : ""; 108ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_POWER = (APPEND_CATEGORY_NAME) ? "_Power" : ""; 109ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PROCESS_OBSERVERS = (APPEND_CATEGORY_NAME) 110ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale ? "_ProcessObservers" : ""; 111ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : ""; 112ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : ""; 113ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : ""; 114ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_RECENTS = (APPEND_CATEGORY_NAME) ? "_Recents" : ""; 1150fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_RELEASE = (APPEND_CATEGORY_NAME) ? "_Release" : ""; 1160fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : ""; 1170fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_SAVED_STATE = (APPEND_CATEGORY_NAME) ? "_SavedState" : ""; 1180fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_SCREENSHOTS = (APPEND_CATEGORY_NAME) ? "_Screenshots" : ""; 1193ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : ""; 120d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final String POSTFIX_SERVICE_EXECUTING = 1213ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : ""; 122ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_STACK = (APPEND_CATEGORY_NAME) ? "_Stack" : ""; 1230fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_STATES = (APPEND_CATEGORY_NAME) ? "_States" : ""; 124ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_SWITCH = (APPEND_CATEGORY_NAME) ? "_Switch" : ""; 125ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_TASKS = (APPEND_CATEGORY_NAME) ? "_Tasks" : ""; 126ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_THUMBNAILS = (APPEND_CATEGORY_NAME) ? "_Thumbnails" : ""; 127ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_TRANSITION = (APPEND_CATEGORY_NAME) ? "_Transition" : ""; 128d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn static final String POSTFIX_UID_OBSERVERS = (APPEND_CATEGORY_NAME) 129d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn ? "_UidObservers" : ""; 130ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_URI_PERMISSION = (APPEND_CATEGORY_NAME) ? "_UriPermission" : ""; 131ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_USER_LEAVING = (APPEND_CATEGORY_NAME) ? "_UserLeaving" : ""; 132ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_VISIBILITY = (APPEND_CATEGORY_NAME) ? "_Visibility" : ""; 1330fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_VISIBLE_BEHIND = (APPEND_CATEGORY_NAME) ? "_VisibleBehind" : ""; 134d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 135d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale} 136