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; 499369efdf6a43d8fa0f82dcae651c76b85a5ea0adDianne Hackborn static final boolean DEBUG_ANR = false; 500fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false; 5185e35643ba245c2d2b96662989aa505f04204cd7Dianne Hackborn static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false; 52d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BACKUP = DEBUG_ALL || false; 53d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BROADCAST = DEBUG_ALL || false; 54d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false; 55d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false; 56d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_CLEANUP = DEBUG_ALL || false; 57d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_CONFIGURATION = DEBUG_ALL || false; 580fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_CONTAINERS = DEBUG_ALL_ACTIVITIES || false; 59d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_FOCUS = false; 600fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_IDLE = DEBUG_ALL_ACTIVITIES || false; 61d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_IMMERSIVE = DEBUG_ALL || false; 62d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_LOCKSCREEN = DEBUG_ALL || false; 63e0570201f59342ef02412ece2f179ef42441a032Craig Mautner static final boolean DEBUG_LOCKTASK = DEBUG_ALL || false; 64d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_LRU = DEBUG_ALL || false; 65d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_MU = DEBUG_ALL || false; 66e736185ee90e0f19a7092542cadab4cf561a5703Sudheer Shanka static final boolean DEBUG_NETWORK = DEBUG_ALL || false; 67d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_OOM_ADJ = DEBUG_ALL || false; 68f4dd3711d1164ce6a442306615cac99119022215Dianne Hackborn static final boolean DEBUG_OOM_ADJ_REASON = DEBUG_ALL || false; 692b79af1e8a45776ba57cd38a50afe4a6c2f719aaChong Zhang static final boolean DEBUG_PAUSE = DEBUG_ALL || false; 70d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_POWER = DEBUG_ALL || false; 71d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false; 72d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PROCESS_OBSERVERS = DEBUG_ALL || false; 73d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PROCESSES = DEBUG_ALL || false; 74d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PROVIDER = DEBUG_ALL || false; 75d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_PSS = DEBUG_ALL || false; 76d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_RECENTS = DEBUG_ALL || false; 770fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_RELEASE = DEBUG_ALL_ACTIVITIES || false; 78d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_RESULTS = DEBUG_ALL || false; 790fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_SAVED_STATE = DEBUG_ALL_ACTIVITIES || false; 800fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final boolean DEBUG_SCREENSHOTS = DEBUG_ALL_ACTIVITIES || false; 81d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_SERVICE = DEBUG_ALL || false; 82cb01563d7efa5689abb98fe4e5d8cc86bfc2b6fcDianne Hackborn static final boolean DEBUG_FOREGROUND_SERVICE = DEBUG_ALL || false; 83d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_SERVICE_EXECUTING = DEBUG_ALL || false; 84d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_STACK = DEBUG_ALL || false; 85e05db74fd275ea25d10074825a43cc5c7683ae01Chong Zhang static final boolean DEBUG_STATES = DEBUG_ALL_ACTIVITIES || false; 86d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_SWITCH = DEBUG_ALL || false; 87d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_TASKS = DEBUG_ALL || false; 88d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_THUMBNAILS = DEBUG_ALL || false; 89d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_TRANSITION = DEBUG_ALL || false; 90d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn static final boolean DEBUG_UID_OBSERVERS = DEBUG_ALL || false; 91d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_URI_PERMISSION = DEBUG_ALL || false; 92d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final boolean DEBUG_USER_LEAVING = DEBUG_ALL || false; 932b79af1e8a45776ba57cd38a50afe4a6c2f719aaChong Zhang static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false; 9485757fceb727f76e42956aec67b1152231ab4ee9Amith Yamasani static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false; 959c165d76010d9f79f5cd71978742a335b6b8d1b4Svet Ganov static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false; 96a1b79bfd7a15006a93da933695359765e0fee495Felipe Leme static final boolean DEBUG_WHITELISTS = DEBUG_ALL || false; 97e9b5381ddf949ba614a55f87190e5e8937abc7c8Jorim Jaggi static final boolean DEBUG_METRICS = DEBUG_ALL || false; 98d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 990fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : ""; 1000fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : ""; 1013ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : ""; 1023ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : ""; 1033ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : ""; 1043ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_CONFIGURATION = (APPEND_CATEGORY_NAME) ? "_Configuration" : ""; 1050fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_CONTAINERS = (APPEND_CATEGORY_NAME) ? "_Containers" : ""; 1063ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_FOCUS = (APPEND_CATEGORY_NAME) ? "_Focus" : ""; 1070fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_IDLE = (APPEND_CATEGORY_NAME) ? "_Idle" : ""; 1083ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_IMMERSIVE = (APPEND_CATEGORY_NAME) ? "_Immersive" : ""; 1090fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_LOCKSCREEN = (APPEND_CATEGORY_NAME) ? "_LockScreen" : ""; 1100fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LockTask" : ""; 1113ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : ""; 112d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final String POSTFIX_MU = "_MU"; 113e736185ee90e0f19a7092542cadab4cf561a5703Sudheer Shanka static final String POSTFIX_NETWORK = "_Network"; 1143ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : ""; 115ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PAUSE = (APPEND_CATEGORY_NAME) ? "_Pause" : ""; 116ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_POWER = (APPEND_CATEGORY_NAME) ? "_Power" : ""; 117ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PROCESS_OBSERVERS = (APPEND_CATEGORY_NAME) 118ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale ? "_ProcessObservers" : ""; 119ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : ""; 120ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : ""; 121ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : ""; 122ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_RECENTS = (APPEND_CATEGORY_NAME) ? "_Recents" : ""; 1230fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_RELEASE = (APPEND_CATEGORY_NAME) ? "_Release" : ""; 1240fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : ""; 1250fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_SAVED_STATE = (APPEND_CATEGORY_NAME) ? "_SavedState" : ""; 1260fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_SCREENSHOTS = (APPEND_CATEGORY_NAME) ? "_Screenshots" : ""; 1273ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : ""; 128d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale static final String POSTFIX_SERVICE_EXECUTING = 1293ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : ""; 130ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_STACK = (APPEND_CATEGORY_NAME) ? "_Stack" : ""; 1310fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_STATES = (APPEND_CATEGORY_NAME) ? "_States" : ""; 132ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_SWITCH = (APPEND_CATEGORY_NAME) ? "_Switch" : ""; 133ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_TASKS = (APPEND_CATEGORY_NAME) ? "_Tasks" : ""; 134ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_THUMBNAILS = (APPEND_CATEGORY_NAME) ? "_Thumbnails" : ""; 135ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_TRANSITION = (APPEND_CATEGORY_NAME) ? "_Transition" : ""; 136d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn static final String POSTFIX_UID_OBSERVERS = (APPEND_CATEGORY_NAME) 137d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn ? "_UidObservers" : ""; 138ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_URI_PERMISSION = (APPEND_CATEGORY_NAME) ? "_UriPermission" : ""; 139ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_USER_LEAVING = (APPEND_CATEGORY_NAME) ? "_UserLeaving" : ""; 140ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale static final String POSTFIX_VISIBILITY = (APPEND_CATEGORY_NAME) ? "_Visibility" : ""; 1410fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale static final String POSTFIX_VISIBLE_BEHIND = (APPEND_CATEGORY_NAME) ? "_VisibleBehind" : ""; 142d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale 143d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale} 144