Loading packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +6 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,12 @@ public class DozeLog { + state + " blocked=" + blocked); } public static void tracePulseDropped(Context context, String why) { if (!ENABLED) return; init(context); log("pulseDropped why=" + why); } public static void tracePulseTouchDisabledByProx(Context context, boolean disabled) { if (!ENABLED) return; init(context); Loading packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +3 −0 Original line number Diff line number Diff line Loading @@ -113,11 +113,13 @@ public class DozeTriggers implements DozeMachine.Part { if (!sWakeDisplaySensorState) { Log.d(TAG, "Wake display false. Pulse denied."); runIfNotNull(onPulseSuppressedListener); DozeLog.tracePulseDropped(mContext, "wakeDisplaySensor"); return; } mNotificationPulseTime = SystemClock.elapsedRealtime(); if (!mConfig.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) { runIfNotNull(onPulseSuppressedListener); DozeLog.tracePulseDropped(mContext, "pulseOnNotificationsDisabled"); return; } requestPulse(DozeLog.PULSE_REASON_NOTIFICATION, false /* performedProxCheck */, Loading Loading @@ -376,6 +378,7 @@ public class DozeTriggers implements DozeMachine.Part { proximityCheckThenCall((result) -> { if (result == ProximityCheck.RESULT_NEAR) { // in pocket, abort pulse DozeLog.tracePulseDropped(mContext, "inPocket"); mPulsePending = false; runIfNotNull(onPulseSuppressedListener); } else { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java +18 −16 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.app.NotificationManager; import android.content.Context; import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Bundle; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; Loading @@ -32,7 +31,6 @@ import android.provider.Settings; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading @@ -51,6 +49,7 @@ public class NotificationInterruptionStateProvider { private static final String TAG = "InterruptionStateProvider"; private static final boolean DEBUG = false; private static final boolean DEBUG_HEADS_UP = true; private static final boolean ENABLE_HEADS_UP = true; private static final String SETTING_HEADS_UP_TICKER = "ticker_gets_heads_up"; Loading Loading @@ -199,7 +198,7 @@ public class NotificationInterruptionStateProvider { boolean inShade = mStatusBarStateController.getState() == SHADE; if (entry.isBubble() && inShade) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: in unlocked shade where notification is shown as a " + "bubble: " + sbn.getKey()); } Loading @@ -207,7 +206,7 @@ public class NotificationInterruptionStateProvider { } if (!canAlertCommon(entry)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: notification shouldn't alert: " + sbn.getKey()); } return false; Loading @@ -218,7 +217,7 @@ public class NotificationInterruptionStateProvider { } if (entry.importance < NotificationManager.IMPORTANCE_HIGH) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: unimportant notification: " + sbn.getKey()); } return false; Loading @@ -233,13 +232,16 @@ public class NotificationInterruptionStateProvider { boolean inUse = mPowerManager.isScreenOn() && !isDreaming; if (!inUse) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: not in use: " + sbn.getKey()); } return false; } if (!mHeadsUpSuppressor.canHeadsUp(entry, sbn)) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: aborted by suppressor: " + sbn.getKey()); } return false; } Loading @@ -257,28 +259,28 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (!mAmbientDisplayConfiguration.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: disabled by setting: " + sbn.getKey()); } return false; } if (!canAlertCommon(entry)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: notification shouldn't alert: " + sbn.getKey()); } return false; } if (entry.shouldSuppressAmbient()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: ambient effect suppressed: " + sbn.getKey()); } return false; } if (entry.importance < NotificationManager.IMPORTANCE_DEFAULT) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: not important enough: " + sbn.getKey()); } return false; Loading @@ -300,7 +302,7 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (mNotificationFilter.shouldFilterOut(entry)) { if (DEBUG) { if (DEBUG || DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: filtered notification: " + sbn.getKey()); } return false; Loading @@ -308,7 +310,7 @@ public class NotificationInterruptionStateProvider { // Don't alert notifications that are suppressed due to group alert behavior if (sbn.isGroup() && sbn.getNotification().suppressAlertingDueToGrouping()) { if (DEBUG) { if (DEBUG || DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: suppressed due to group alert behavior"); } return false; Loading @@ -330,28 +332,28 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (!mUseHeadsUp || mPresenter.isDeviceInVrMode()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: no huns or vr mode"); } return false; } if (entry.shouldSuppressPeek()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: suppressed by DND: " + sbn.getKey()); } return false; } if (isSnoozedPackage(sbn)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: snoozed package: " + sbn.getKey()); } return false; } if (entry.hasJustLaunchedFullScreenIntent()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: recent fullscreen: " + sbn.getKey()); } return false; Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +6 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,12 @@ public class DozeLog { + state + " blocked=" + blocked); } public static void tracePulseDropped(Context context, String why) { if (!ENABLED) return; init(context); log("pulseDropped why=" + why); } public static void tracePulseTouchDisabledByProx(Context context, boolean disabled) { if (!ENABLED) return; init(context); Loading
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +3 −0 Original line number Diff line number Diff line Loading @@ -113,11 +113,13 @@ public class DozeTriggers implements DozeMachine.Part { if (!sWakeDisplaySensorState) { Log.d(TAG, "Wake display false. Pulse denied."); runIfNotNull(onPulseSuppressedListener); DozeLog.tracePulseDropped(mContext, "wakeDisplaySensor"); return; } mNotificationPulseTime = SystemClock.elapsedRealtime(); if (!mConfig.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) { runIfNotNull(onPulseSuppressedListener); DozeLog.tracePulseDropped(mContext, "pulseOnNotificationsDisabled"); return; } requestPulse(DozeLog.PULSE_REASON_NOTIFICATION, false /* performedProxCheck */, Loading Loading @@ -376,6 +378,7 @@ public class DozeTriggers implements DozeMachine.Part { proximityCheckThenCall((result) -> { if (result == ProximityCheck.RESULT_NEAR) { // in pocket, abort pulse DozeLog.tracePulseDropped(mContext, "inPocket"); mPulsePending = false; runIfNotNull(onPulseSuppressedListener); } else { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java +18 −16 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.app.NotificationManager; import android.content.Context; import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Bundle; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; Loading @@ -32,7 +31,6 @@ import android.provider.Settings; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading @@ -51,6 +49,7 @@ public class NotificationInterruptionStateProvider { private static final String TAG = "InterruptionStateProvider"; private static final boolean DEBUG = false; private static final boolean DEBUG_HEADS_UP = true; private static final boolean ENABLE_HEADS_UP = true; private static final String SETTING_HEADS_UP_TICKER = "ticker_gets_heads_up"; Loading Loading @@ -199,7 +198,7 @@ public class NotificationInterruptionStateProvider { boolean inShade = mStatusBarStateController.getState() == SHADE; if (entry.isBubble() && inShade) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: in unlocked shade where notification is shown as a " + "bubble: " + sbn.getKey()); } Loading @@ -207,7 +206,7 @@ public class NotificationInterruptionStateProvider { } if (!canAlertCommon(entry)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: notification shouldn't alert: " + sbn.getKey()); } return false; Loading @@ -218,7 +217,7 @@ public class NotificationInterruptionStateProvider { } if (entry.importance < NotificationManager.IMPORTANCE_HIGH) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: unimportant notification: " + sbn.getKey()); } return false; Loading @@ -233,13 +232,16 @@ public class NotificationInterruptionStateProvider { boolean inUse = mPowerManager.isScreenOn() && !isDreaming; if (!inUse) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: not in use: " + sbn.getKey()); } return false; } if (!mHeadsUpSuppressor.canHeadsUp(entry, sbn)) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: aborted by suppressor: " + sbn.getKey()); } return false; } Loading @@ -257,28 +259,28 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (!mAmbientDisplayConfiguration.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: disabled by setting: " + sbn.getKey()); } return false; } if (!canAlertCommon(entry)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: notification shouldn't alert: " + sbn.getKey()); } return false; } if (entry.shouldSuppressAmbient()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: ambient effect suppressed: " + sbn.getKey()); } return false; } if (entry.importance < NotificationManager.IMPORTANCE_DEFAULT) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: not important enough: " + sbn.getKey()); } return false; Loading @@ -300,7 +302,7 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (mNotificationFilter.shouldFilterOut(entry)) { if (DEBUG) { if (DEBUG || DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: filtered notification: " + sbn.getKey()); } return false; Loading @@ -308,7 +310,7 @@ public class NotificationInterruptionStateProvider { // Don't alert notifications that are suppressed due to group alert behavior if (sbn.isGroup() && sbn.getNotification().suppressAlertingDueToGrouping()) { if (DEBUG) { if (DEBUG || DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: suppressed due to group alert behavior"); } return false; Loading @@ -330,28 +332,28 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (!mUseHeadsUp || mPresenter.isDeviceInVrMode()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: no huns or vr mode"); } return false; } if (entry.shouldSuppressPeek()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: suppressed by DND: " + sbn.getKey()); } return false; } if (isSnoozedPackage(sbn)) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: snoozed package: " + sbn.getKey()); } return false; } if (entry.hasJustLaunchedFullScreenIntent()) { if (DEBUG) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: recent fullscreen: " + sbn.getKey()); } return false; Loading