blob: e42666c6a63773bea8c31a042f1c1845699badf3 [file] [log] [blame]
Wale Ogunwaled57969f2014-11-15 19:37:29 -08001/*
2 * Copyright (C) 2014 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
17package com.android.server.am;
18
19/**
20 * Common class for the various debug {@link android.util.Log} output configuration in the activity
21 * manager package.
22 */
23class ActivityManagerDebugConfig {
24
25 // All output logs in the activity manager package use the {@link #TAG_AM} string for tagging
26 // their log output. This makes it easy to identify the origin of the log message when sifting
27 // through a large amount of log output from multiple sources. However, it also makes trying
28 // to figure-out the origin of a log message while debugging the activity manager a little
29 // painful. By setting this constant to true, log messages from the activity manager package
30 // will be tagged with their class names instead fot the generic tag.
31 static final boolean TAG_WITH_CLASS_NAME = false;
32
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070033 // While debugging it is sometimes useful to have the category name of the log appended to the
Wale Ogunwaled57969f2014-11-15 19:37:29 -080034 // base log tag to make sifting through logs with the same base tag easier. By setting this
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070035 // constant to true, the category name of the log point will be appended to the log tag.
36 static final boolean APPEND_CATEGORY_NAME = false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080037
38 // Default log tag for the activity manager package.
39 static final String TAG_AM = "ActivityManager";
40
41 // Enable all debug log categories.
42 static final boolean DEBUG_ALL = false;
43
44 // Available log categories in the activity manager package.
Makoto Onuki99029542018-08-27 17:23:09 -070045 static final boolean DEBUG_ANR = true; // STOPSHIP disable it (b/113252928)
Dianne Hackborn85e35642017-01-12 15:10:57 -080046 static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080047 static final boolean DEBUG_BACKUP = DEBUG_ALL || false;
48 static final boolean DEBUG_BROADCAST = DEBUG_ALL || false;
49 static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false;
50 static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false;
Christopher Tate2f558d22019-01-17 16:58:31 -080051 static final boolean DEBUG_BROADCAST_DEFERRAL = DEBUG_BROADCAST || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080052 static final boolean DEBUG_LRU = DEBUG_ALL || false;
53 static final boolean DEBUG_MU = DEBUG_ALL || false;
Sudheer Shankae7361852017-03-07 11:51:46 -080054 static final boolean DEBUG_NETWORK = DEBUG_ALL || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080055 static final boolean DEBUG_OOM_ADJ = DEBUG_ALL || false;
Dianne Hackbornf4dd3712017-05-11 17:25:23 -070056 static final boolean DEBUG_OOM_ADJ_REASON = DEBUG_ALL || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080057 static final boolean DEBUG_POWER = DEBUG_ALL || false;
58 static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
59 static final boolean DEBUG_PROCESS_OBSERVERS = DEBUG_ALL || false;
60 static final boolean DEBUG_PROCESSES = DEBUG_ALL || false;
61 static final boolean DEBUG_PROVIDER = DEBUG_ALL || false;
62 static final boolean DEBUG_PSS = DEBUG_ALL || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080063 static final boolean DEBUG_SERVICE = DEBUG_ALL || false;
Dianne Hackborncb015632017-06-14 17:30:15 -070064 static final boolean DEBUG_FOREGROUND_SERVICE = DEBUG_ALL || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080065 static final boolean DEBUG_SERVICE_EXECUTING = DEBUG_ALL || false;
Dianne Hackbornd23e0d62015-05-15 16:36:12 -070066 static final boolean DEBUG_UID_OBSERVERS = DEBUG_ALL || false;
Amith Yamasani85757fc2015-04-03 13:31:18 -070067 static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false;
Svet Ganov9c165d72015-12-01 19:52:26 -080068 static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false;
Felipe Lemea1b79bf2016-05-24 13:06:54 -070069 static final boolean DEBUG_WHITELISTS = DEBUG_ALL || false;
Wale Ogunwaled57969f2014-11-15 19:37:29 -080070
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070071 static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : "";
72 static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : "";
73 static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : "";
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070074 static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : "";
Wale Ogunwaled57969f2014-11-15 19:37:29 -080075 static final String POSTFIX_MU = "_MU";
Sudheer Shankae7361852017-03-07 11:51:46 -080076 static final String POSTFIX_NETWORK = "_Network";
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070077 static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : "";
Wale Ogunwaleee006da2015-03-30 14:49:25 -070078 static final String POSTFIX_POWER = (APPEND_CATEGORY_NAME) ? "_Power" : "";
79 static final String POSTFIX_PROCESS_OBSERVERS = (APPEND_CATEGORY_NAME)
80 ? "_ProcessObservers" : "";
81 static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : "";
82 static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : "";
83 static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : "";
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070084 static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : "";
Wale Ogunwaled57969f2014-11-15 19:37:29 -080085 static final String POSTFIX_SERVICE_EXECUTING =
Wale Ogunwale3ab9a272015-03-16 09:55:45 -070086 (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : "";
Dianne Hackbornd23e0d62015-05-15 16:36:12 -070087 static final String POSTFIX_UID_OBSERVERS = (APPEND_CATEGORY_NAME)
88 ? "_UidObservers" : "";
Wale Ogunwaled57969f2014-11-15 19:37:29 -080089}