ActivityManagerDebugConfig.java revision 2b79af1e8a45776ba57cd38a50afe4a6c2f719aa
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;
652b79af1e8a45776ba57cd38a50afe4a6c2f719aaChong Zhang    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;
80c1f256b40e9dd28124af089d42f620eb7f9d9a44Robert Carr    static final boolean DEBUG_STATES = DEBUG_ALL_ACTIVITIES || true;
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;
882b79af1e8a45776ba57cd38a50afe4a6c2f719aaChong Zhang    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;
919c165d76010d9f79f5cd71978742a335b6b8d1b4Svet Ganov    static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false;
92d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale
930fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : "";
940fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : "";
953ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : "";
963ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : "";
973ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : "";
983ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_CONFIGURATION = (APPEND_CATEGORY_NAME) ? "_Configuration" : "";
990fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_CONTAINERS = (APPEND_CATEGORY_NAME) ? "_Containers" : "";
1003ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_FOCUS = (APPEND_CATEGORY_NAME) ? "_Focus" : "";
1010fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_IDLE = (APPEND_CATEGORY_NAME) ? "_Idle" : "";
1023ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_IMMERSIVE = (APPEND_CATEGORY_NAME) ? "_Immersive" : "";
1030fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_LOCKSCREEN = (APPEND_CATEGORY_NAME) ? "_LockScreen" : "";
1040fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LockTask" : "";
1053ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : "";
106d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final String POSTFIX_MU = "_MU";
1073ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : "";
108ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PAUSE = (APPEND_CATEGORY_NAME) ? "_Pause" : "";
109ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_POWER = (APPEND_CATEGORY_NAME) ? "_Power" : "";
110ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PROCESS_OBSERVERS = (APPEND_CATEGORY_NAME)
111ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale            ? "_ProcessObservers" : "";
112ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : "";
113ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : "";
114ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : "";
115ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_RECENTS = (APPEND_CATEGORY_NAME) ? "_Recents" : "";
1160fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_RELEASE = (APPEND_CATEGORY_NAME) ? "_Release" : "";
1170fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : "";
1180fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_SAVED_STATE = (APPEND_CATEGORY_NAME) ? "_SavedState" : "";
1190fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_SCREENSHOTS = (APPEND_CATEGORY_NAME) ? "_Screenshots" : "";
1203ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : "";
121d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final String POSTFIX_SERVICE_EXECUTING =
1223ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale            (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : "";
123ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_STACK = (APPEND_CATEGORY_NAME) ? "_Stack" : "";
1240fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_STATES = (APPEND_CATEGORY_NAME) ? "_States" : "";
125ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_SWITCH = (APPEND_CATEGORY_NAME) ? "_Switch" : "";
126ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_TASKS = (APPEND_CATEGORY_NAME) ? "_Tasks" : "";
127ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_THUMBNAILS = (APPEND_CATEGORY_NAME) ? "_Thumbnails" : "";
128ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_TRANSITION = (APPEND_CATEGORY_NAME) ? "_Transition" : "";
129d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn    static final String POSTFIX_UID_OBSERVERS = (APPEND_CATEGORY_NAME)
130d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn            ? "_UidObservers" : "";
131ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_URI_PERMISSION = (APPEND_CATEGORY_NAME) ? "_UriPermission" : "";
132ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_USER_LEAVING = (APPEND_CATEGORY_NAME) ? "_UserLeaving" : "";
133ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_VISIBILITY = (APPEND_CATEGORY_NAME) ? "_Visibility" : "";
1340fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_VISIBLE_BEHIND = (APPEND_CATEGORY_NAME) ? "_VisibleBehind" : "";
135d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale
136d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale}
137