• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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.wm;
18 
19 /**
20  * Common class for the various debug {@link android.util.Log} output configuration relating to
21  * activities.
22  */
23 public class ActivityTaskManagerDebugConfig {
24     // All output logs relating to acitvities use the {@link #TAG_ATM} string for tagging their log
25     // output. This makes it easy to identify the origin of the log message when sifting
26     // through a large amount of log output from multiple sources. However, it also makes trying
27     // to figure-out the origin of a log message while debugging the activity manager a little
28     // painful. By setting this constant to true, log messages from the activity manager package
29     // will be tagged with their class names instead fot the generic tag.
30     static final boolean TAG_WITH_CLASS_NAME = false;
31 
32     // While debugging it is sometimes useful to have the category name of the log appended to the
33     // base log tag to make sifting through logs with the same base tag easier. By setting this
34     // constant to true, the category name of the log point will be appended to the log tag.
35     private static final boolean APPEND_CATEGORY_NAME = false;
36 
37     // Default log tag for the activities.
38     static final String TAG_ATM = "ActivityTaskManager";
39 
40     // Enable all debug log categories.
41     static final boolean DEBUG_ALL = false;
42 
43     // Enable all debug log categories for activities.
44     private static final boolean DEBUG_ALL_ACTIVITIES = DEBUG_ALL || false;
45 
46     static final boolean DEBUG_RECENTS = DEBUG_ALL || false;
47     static final boolean DEBUG_RECENTS_TRIM_TASKS = DEBUG_RECENTS || false;
48     static final boolean DEBUG_ROOT_TASK = DEBUG_ALL || false;
49     public static final boolean DEBUG_SWITCH = DEBUG_ALL || false;
50     static final boolean DEBUG_TRANSITION = DEBUG_ALL || false;
51     static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false;
52     static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false;
53     static final boolean DEBUG_IDLE = DEBUG_ALL_ACTIVITIES || false;
54     static final boolean DEBUG_RELEASE = DEBUG_ALL_ACTIVITIES || false;
55     static final boolean DEBUG_USER_LEAVING = DEBUG_ALL || false;
56     static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false;
57     static final boolean DEBUG_RESULTS = DEBUG_ALL || false;
58     static final boolean DEBUG_ACTIVITY_STARTS = DEBUG_ALL || false;
59     public static final boolean DEBUG_CLEANUP = DEBUG_ALL || false;
60     public static final boolean DEBUG_METRICS = DEBUG_ALL || false;
61 
62     static final String POSTFIX_APP = APPEND_CATEGORY_NAME ? "_App" : "";
63     static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : "";
64     static final String POSTFIX_IDLE = APPEND_CATEGORY_NAME ? "_Idle" : "";
65     static final String POSTFIX_RELEASE = APPEND_CATEGORY_NAME ? "_Release" : "";
66     static final String POSTFIX_USER_LEAVING = APPEND_CATEGORY_NAME ? "_UserLeaving" : "";
67     static final String POSTFIX_ADD_REMOVE = APPEND_CATEGORY_NAME ? "_AddRemove" : "";
68     public static final String POSTFIX_CONFIGURATION = APPEND_CATEGORY_NAME ? "_Configuration" : "";
69     static final String POSTFIX_CONTAINERS = APPEND_CATEGORY_NAME ? "_Containers" : "";
70     static final String POSTFIX_FOCUS = APPEND_CATEGORY_NAME ? "_Focus" : "";
71     static final String POSTFIX_IMMERSIVE = APPEND_CATEGORY_NAME ? "_Immersive" : "";
72     public static final String POSTFIX_LOCKTASK = APPEND_CATEGORY_NAME ? "_LockTask" : "";
73     static final String POSTFIX_PAUSE = APPEND_CATEGORY_NAME ? "_Pause" : "";
74     static final String POSTFIX_RECENTS = APPEND_CATEGORY_NAME ? "_Recents" : "";
75     static final String POSTFIX_SAVED_STATE = APPEND_CATEGORY_NAME ? "_SavedState" : "";
76     static final String POSTFIX_ROOT_TASK = APPEND_CATEGORY_NAME ? "_RootTask" : "";
77     static final String POSTFIX_STATES = APPEND_CATEGORY_NAME ? "_States" : "";
78     public static final String POSTFIX_SWITCH = APPEND_CATEGORY_NAME ? "_Switch" : "";
79     static final String POSTFIX_TASKS = APPEND_CATEGORY_NAME ? "_Tasks" : "";
80     static final String POSTFIX_TRANSITION = APPEND_CATEGORY_NAME ? "_Transition" : "";
81     static final String POSTFIX_VISIBILITY = APPEND_CATEGORY_NAME ? "_Visibility" : "";
82     static final String POSTFIX_RESULTS = APPEND_CATEGORY_NAME ? "_Results" : "";
83 }
84