Add Compile.IS_DEBUG to systemui
This is meant to replace Build.IS_DEBUGGABLE and allow compile-time optimizations Fixes: 214238812 Test: manual builds Change-Id: Id4b3c48a0c88f1e4cff7752907cf72d19295571d
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.util;
|
||||
|
||||
/** Constants that vary by compilation configuration. */
|
||||
public class Compile {
|
||||
/** Whether SystemUI was compiled in debug mode, and supports debug features */
|
||||
public static final boolean IS_DEBUG = true;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.util;
|
||||
|
||||
/** Constants that vary by compilation configuration. */
|
||||
public class Compile {
|
||||
/** Whether SystemUI was compiled in debug mode, and supports debug features */
|
||||
public static final boolean IS_DEBUG = false;
|
||||
}
|
||||
@@ -59,6 +59,7 @@ import com.android.systemui.statusbar.notification.collection.notifcollection.No
|
||||
import com.android.systemui.statusbar.notification.dagger.NotificationsModule;
|
||||
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
|
||||
import com.android.systemui.util.Assert;
|
||||
import com.android.systemui.util.Compile;
|
||||
import com.android.systemui.util.leak.LeakDetector;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -1011,7 +1012,7 @@ public class NotificationEntryManager implements
|
||||
}
|
||||
|
||||
private static final String TAG = "NotificationEntryMgr";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
/**
|
||||
* Used when a notification is removed and it doesn't have a reason that maps to one of the
|
||||
|
||||
@@ -34,9 +34,9 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
|
||||
import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
|
||||
import com.android.systemui.util.Compile;
|
||||
import com.android.wm.shell.bubbles.Bubbles;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -69,8 +69,8 @@ public class NotificationGroupManagerLegacy implements
|
||||
Dumpable {
|
||||
|
||||
private static final String TAG = "NotifGroupManager";
|
||||
private static final boolean DEBUG = StatusBar.DEBUG;
|
||||
private static final boolean SPEW = StatusBar.SPEW;
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean SPEW = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE);
|
||||
/**
|
||||
* The maximum amount of time (in ms) between the posting of notifications that can be
|
||||
* considered part of the same update batch.
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.android.systemui.statusbar.notification.NotificationFilter;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
import com.android.systemui.util.Compile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -52,8 +53,8 @@ import javax.inject.Inject;
|
||||
@SysUISingleton
|
||||
public class NotificationInterruptStateProviderImpl implements NotificationInterruptStateProvider {
|
||||
private static final String TAG = "InterruptionStateProvider";
|
||||
private static final boolean DEBUG = true; //false;
|
||||
private static final boolean DEBUG_HEADS_UP = true;
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG;
|
||||
private static final boolean DEBUG_HEADS_UP = Compile.IS_DEBUG;
|
||||
private static final boolean ENABLE_HEADS_UP = true;
|
||||
private static final String SETTING_HEADS_UP_TICKER = "ticker_gets_heads_up";
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.android.systemui.statusbar.notification.collection.render.Notificatio
|
||||
import com.android.systemui.statusbar.notification.dagger.NotificationsModule;
|
||||
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
|
||||
import com.android.systemui.util.Compile;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -65,7 +66,7 @@ import javax.inject.Inject;
|
||||
*/
|
||||
public class NotificationLogger implements StateListener {
|
||||
private static final String TAG = "NotificationLogger";
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
/** The minimum delay in ms between reports of notification visibility. */
|
||||
private static final int VISIBILITY_REPORT_MIN_DELAY_MS = 500;
|
||||
|
||||
@@ -115,6 +115,7 @@ import com.android.systemui.statusbar.phone.StatusBar;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
import com.android.systemui.statusbar.policy.InflatedSmartReplyState;
|
||||
import com.android.systemui.statusbar.policy.dagger.RemoteInputViewSubcomponent;
|
||||
import com.android.systemui.util.Compile;
|
||||
import com.android.systemui.util.DumpUtilsKt;
|
||||
import com.android.systemui.wmshell.BubblesManager;
|
||||
|
||||
@@ -136,11 +137,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
implements PluginListener<NotificationMenuRowPlugin>, SwipeableView,
|
||||
NotificationFadeAware.FadeOptimizedNotification {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "ExpandableNotifRow";
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final int DEFAULT_DIVIDER_ALPHA = 0x29;
|
||||
private static final int COLORED_DIVIDER_ALPHA = 0x7B;
|
||||
private static final int MENU_VIEW_INDEX = 0;
|
||||
private static final String TAG = "ExpandableNotifRow";
|
||||
public static final float DEFAULT_HEADER_VISIBLE_AMOUNT = 1.0f;
|
||||
private static final long RECENTLY_ALERTED_THRESHOLD_MS = TimeUnit.SECONDS.toMillis(30);
|
||||
|
||||
|
||||
@@ -48,11 +48,12 @@ import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.util.Compile;
|
||||
|
||||
public class FeedbackInfo extends LinearLayout implements NotificationGuts.GutsContent {
|
||||
|
||||
private static final String TAG = "FeedbackInfo";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
private NotificationGuts mGutsContainer;
|
||||
private NotificationListenerService.Ranking mRanking;
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
|
||||
import com.android.systemui.statusbar.notification.dagger.NotificationsModule;
|
||||
import com.android.systemui.statusbar.notification.logging.NotificationCounters;
|
||||
import com.android.systemui.util.Compile;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -43,8 +44,9 @@ import java.util.Set;
|
||||
*/
|
||||
public class NotificationBlockingHelperManager {
|
||||
/** Enables debug logging and always makes the blocking helper show up after a dismiss. */
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "BlockingHelper";
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean DEBUG_ALWAYS_SHOW = false;
|
||||
|
||||
private final Context mContext;
|
||||
private final NotificationGutsManager mNotificationGutsManager;
|
||||
@@ -98,7 +100,7 @@ public class NotificationBlockingHelperManager {
|
||||
// - The dismissed row is a valid group (>1 or 0 children from the same channel)
|
||||
// or the only child in the group
|
||||
final NotificationEntry entry = row.getEntry();
|
||||
if ((entry.getUserSentiment() == USER_SENTIMENT_NEGATIVE || DEBUG)
|
||||
if ((entry.getUserSentiment() == USER_SENTIMENT_NEGATIVE || DEBUG_ALWAYS_SHOW)
|
||||
&& mIsShadeExpanded
|
||||
&& !row.getIsNonblockable()
|
||||
&& ((!row.isChildInGroup() || mGroupMembershipManager.isOnlyChildInGroup(entry))
|
||||
|
||||
@@ -61,6 +61,7 @@ import com.android.systemui.statusbar.policy.SmartReplyConstants;
|
||||
import com.android.systemui.statusbar.policy.SmartReplyStateInflaterKt;
|
||||
import com.android.systemui.statusbar.policy.SmartReplyView;
|
||||
import com.android.systemui.statusbar.policy.dagger.RemoteInputViewSubcomponent;
|
||||
import com.android.systemui.util.Compile;
|
||||
import com.android.systemui.wmshell.BubblesManager;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -77,7 +78,7 @@ import java.util.List;
|
||||
public class NotificationContentView extends FrameLayout implements NotificationFadeAware {
|
||||
|
||||
private static final String TAG = "NotificationContentView";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
public static final int VISIBLE_TYPE_CONTRACTED = 0;
|
||||
public static final int VISIBLE_TYPE_EXPANDED = 1;
|
||||
public static final int VISIBLE_TYPE_HEADSUP = 2;
|
||||
|
||||
@@ -57,9 +57,6 @@ import java.util.Map;
|
||||
public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnClickListener,
|
||||
ExpandableNotificationRow.LayoutListener {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "swipe";
|
||||
|
||||
// Notification must be swiped at least this fraction of a single menu item to show menu
|
||||
private static final float SWIPED_FAR_ENOUGH_MENU_FRACTION = 0.25f;
|
||||
private static final float SWIPED_FAR_ENOUGH_MENU_UNCLEARABLE_FRACTION = 0.15f;
|
||||
|
||||
@@ -127,6 +127,7 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceP
|
||||
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
|
||||
import com.android.systemui.statusbar.policy.ZenModeController;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
import com.android.systemui.util.Compile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -144,7 +145,7 @@ import kotlin.Unit;
|
||||
@StatusBarComponent.StatusBarScope
|
||||
public class NotificationStackScrollLayoutController {
|
||||
private static final String TAG = "StackScrollerController";
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
private final boolean mAllowLongPress;
|
||||
private final NotificationGutsManager mNotificationGutsManager;
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.android.systemui.statusbar.notification.row.RowContentBindStage;
|
||||
import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
|
||||
import com.android.systemui.util.Compile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -54,8 +55,8 @@ public class NotificationGroupAlertTransferHelper implements OnHeadsUpChangedLis
|
||||
|
||||
private static final long ALERT_TRANSFER_TIMEOUT = 300;
|
||||
private static final String TAG = "NotifGroupAlertTransfer";
|
||||
private static final boolean DEBUG = StatusBar.DEBUG;
|
||||
private static final boolean SPEW = StatusBar.SPEW;
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean SPEW = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE);
|
||||
|
||||
/**
|
||||
* The list of entries containing group alert metadata for each group. Keyed by group key.
|
||||
|
||||
Reference in New Issue
Block a user