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;
51d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_BACKUP = DEBUG_ALL || false;
52d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_BROADCAST = DEBUG_ALL || false;
53d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false;
54d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false;
55d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_CLEANUP = DEBUG_ALL || false;
56d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_CONFIGURATION = DEBUG_ALL || false;
570fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final boolean DEBUG_CONTAINERS = DEBUG_ALL_ACTIVITIES || false;
58d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_FOCUS = false;
590fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final boolean DEBUG_IDLE = DEBUG_ALL_ACTIVITIES || false;
60d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_IMMERSIVE = DEBUG_ALL || false;
61d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_LOCKSCREEN = DEBUG_ALL || false;
62e0570201f59342ef02412ece2f179ef42441a032Craig Mautner    static final boolean DEBUG_LOCKTASK = DEBUG_ALL || false;
63d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_LRU = DEBUG_ALL || false;
64d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_MU = DEBUG_ALL || false;
65d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_OOM_ADJ = DEBUG_ALL || false;
662b79af1e8a45776ba57cd38a50afe4a6c2f719aaChong Zhang    static final boolean DEBUG_PAUSE = DEBUG_ALL || false;
67d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_POWER = DEBUG_ALL || false;
68d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
69d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_PROCESS_OBSERVERS = DEBUG_ALL || false;
70d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_PROCESSES = DEBUG_ALL || false;
71d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_PROVIDER = DEBUG_ALL || false;
72d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_PSS = DEBUG_ALL || false;
73d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_RECENTS = DEBUG_ALL || false;
740fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final boolean DEBUG_RELEASE = DEBUG_ALL_ACTIVITIES || false;
75d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_RESULTS = DEBUG_ALL || false;
760fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final boolean DEBUG_SAVED_STATE = DEBUG_ALL_ACTIVITIES || false;
770fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final boolean DEBUG_SCREENSHOTS = DEBUG_ALL_ACTIVITIES || false;
78d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_SERVICE = DEBUG_ALL || false;
79d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_SERVICE_EXECUTING = DEBUG_ALL || false;
80d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_STACK = DEBUG_ALL || false;
81e05db74fd275ea25d10074825a43cc5c7683ae01Chong Zhang    static final boolean DEBUG_STATES = DEBUG_ALL_ACTIVITIES || false;
82d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_SWITCH = DEBUG_ALL || false;
83d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_TASKS = DEBUG_ALL || false;
84d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_THUMBNAILS = DEBUG_ALL || false;
85d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_TRANSITION = DEBUG_ALL || false;
86d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn    static final boolean DEBUG_UID_OBSERVERS = DEBUG_ALL || false;
87d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_URI_PERMISSION = DEBUG_ALL || false;
88d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final boolean DEBUG_USER_LEAVING = DEBUG_ALL || false;
892b79af1e8a45776ba57cd38a50afe4a6c2f719aaChong Zhang    static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false;
900fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final boolean DEBUG_VISIBLE_BEHIND = DEBUG_ALL_ACTIVITIES || false;
9185757fceb727f76e42956aec67b1152231ab4ee9Amith Yamasani    static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false;
929c165d76010d9f79f5cd71978742a335b6b8d1b4Svet Ganov    static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false;
93a1b79bfd7a15006a93da933695359765e0fee495Felipe Leme    static final boolean DEBUG_WHITELISTS = DEBUG_ALL || false;
94d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale
950fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : "";
960fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : "";
973ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : "";
983ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : "";
993ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : "";
1003ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_CONFIGURATION = (APPEND_CATEGORY_NAME) ? "_Configuration" : "";
1010fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_CONTAINERS = (APPEND_CATEGORY_NAME) ? "_Containers" : "";
1023ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_FOCUS = (APPEND_CATEGORY_NAME) ? "_Focus" : "";
1030fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_IDLE = (APPEND_CATEGORY_NAME) ? "_Idle" : "";
1043ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_IMMERSIVE = (APPEND_CATEGORY_NAME) ? "_Immersive" : "";
1050fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_LOCKSCREEN = (APPEND_CATEGORY_NAME) ? "_LockScreen" : "";
1060fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LockTask" : "";
1073ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : "";
108d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final String POSTFIX_MU = "_MU";
1093ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : "";
110ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PAUSE = (APPEND_CATEGORY_NAME) ? "_Pause" : "";
111ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_POWER = (APPEND_CATEGORY_NAME) ? "_Power" : "";
112ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PROCESS_OBSERVERS = (APPEND_CATEGORY_NAME)
113ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale            ? "_ProcessObservers" : "";
114ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : "";
115ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : "";
116ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : "";
117ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_RECENTS = (APPEND_CATEGORY_NAME) ? "_Recents" : "";
1180fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_RELEASE = (APPEND_CATEGORY_NAME) ? "_Release" : "";
1190fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : "";
1200fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_SAVED_STATE = (APPEND_CATEGORY_NAME) ? "_SavedState" : "";
1210fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_SCREENSHOTS = (APPEND_CATEGORY_NAME) ? "_Screenshots" : "";
1223ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale    static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : "";
123d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale    static final String POSTFIX_SERVICE_EXECUTING =
1243ab9a27e3d612efef6a046d4df7880803df1eef9Wale Ogunwale            (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : "";
125ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_STACK = (APPEND_CATEGORY_NAME) ? "_Stack" : "";
1260fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_STATES = (APPEND_CATEGORY_NAME) ? "_States" : "";
127ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_SWITCH = (APPEND_CATEGORY_NAME) ? "_Switch" : "";
128ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_TASKS = (APPEND_CATEGORY_NAME) ? "_Tasks" : "";
129ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_THUMBNAILS = (APPEND_CATEGORY_NAME) ? "_Thumbnails" : "";
130ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_TRANSITION = (APPEND_CATEGORY_NAME) ? "_Transition" : "";
131d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn    static final String POSTFIX_UID_OBSERVERS = (APPEND_CATEGORY_NAME)
132d23e0d6901935588f9472bd7073fea0009581e9bDianne Hackborn            ? "_UidObservers" : "";
133ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_URI_PERMISSION = (APPEND_CATEGORY_NAME) ? "_UriPermission" : "";
134ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_USER_LEAVING = (APPEND_CATEGORY_NAME) ? "_UserLeaving" : "";
135ee006da858459e91666ae53432659e934c8a8dbdWale Ogunwale    static final String POSTFIX_VISIBILITY = (APPEND_CATEGORY_NAME) ? "_Visibility" : "";
1360fc365c1455ebd4064474d27774f41cfcd8e1cb5Wale Ogunwale    static final String POSTFIX_VISIBLE_BEHIND = (APPEND_CATEGORY_NAME) ? "_VisibleBehind" : "";
137d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale
138d57969f6ec38c7633ca65bcd5bdd766cd972cfe4Wale Ogunwale}
139