summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2019-08-01 21:46:54 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-08-01 21:46:54 +0000
commitcd39363d82777a268efda0b051906b4e98721061 (patch)
tree0bbf4550c4d55bcb6283034cf359e20c81040b43
parent523c6cead30b4d26fa706071fc828e58fd8f769e (diff)
parentc0b8111679b6e47fbfffcb56aa10ba89873b32af (diff)
Merge "Debug when pulses are dropped" into qt-r1-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/doze/DozeLog.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java34
3 files changed, 27 insertions, 16 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
index 9bca3c7382ca..c09e28426072 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
@@ -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);
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
index 2ca85c074a89..310f04abc36c 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
@@ -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 */,
@@ -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 {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java
index 5bab0ef39326..4fc646119261 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java
@@ -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;
@@ -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;
@@ -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";
@@ -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());
}
@@ -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;
@@ -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;
@@ -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;
}
@@ -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;
@@ -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;
@@ -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;
@@ -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;