Merge "Reduce duration of AOD headsup" into qt-r1-dev
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 7c24130..861187f 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -154,12 +154,8 @@
<!-- The number of milliseconds before the heads up notification accepts touches. -->
<integer name="touch_acceptance_delay">700</integer>
- <!-- The number of milliseconds before the ambient notification auto-dismisses. This will
- override the default pulse length. -->
- <integer name="heads_up_notification_decay_dozing">10000</integer>
-
<!-- The number of milliseconds to extend ambient pulse by when prompted (e.g. on touch) -->
- <integer name="ambient_notification_extension_time">6000</integer>
+ <integer name="ambient_notification_extension_time">10000</integer>
<!-- In multi-window, determines whether the stack where recents lives should grow from
the smallest position when being launched. -->
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
index cbaf85c..680e522 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
@@ -72,8 +72,6 @@
private NotificationGroupManager mGroupManager;
private VisualStabilityManager mVisualStabilityManager;
private StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
- @VisibleForTesting
- int mAutoDismissNotificationDecayDozing;
private boolean mReleaseOnExpandFinish;
private int mStatusBarHeight;
@@ -120,8 +118,6 @@
KeyguardBypassController bypassController) {
super(context);
Resources resources = mContext.getResources();
- mAutoDismissNotificationDecayDozing = resources.getInteger(
- R.integer.heads_up_notification_decay_dozing);
mExtensionTime = resources.getInteger(R.integer.ambient_notification_extension_time);
mAutoHeadsUpNotificationDecay = resources.getInteger(
R.integer.auto_heads_up_notification_decay);
@@ -612,9 +608,7 @@
}
private int getDecayDuration() {
- if (mStatusBarStateController.isDozing()) {
- return mAutoDismissNotificationDecayDozing;
- } else if (isAutoHeadsUp()) {
+ if (isAutoHeadsUp()) {
return getRecommendedHeadsUpTimeoutMs(mAutoHeadsUpNotificationDecay);
} else {
return getRecommendedHeadsUpTimeoutMs(mAutoDismissNotificationDecay);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
index 5c1f473..881cc39 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
@@ -64,7 +64,7 @@
protected static final int TEST_AUTO_DISMISS_TIME = 500;
// Number of notifications to use in tests requiring multiple notifications
private static final int TEST_NUM_NOTIFICATIONS = 4;
- protected static final int TEST_TIMEOUT_TIME = 10000;
+ protected static final int TEST_TIMEOUT_TIME = 15000;
protected final Runnable TEST_TIMEOUT_RUNNABLE = () -> mTimedOut = true;
private AlertingNotificationManager mAlertingNotificationManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java
index f8b9e68..48934da 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java
@@ -70,7 +70,6 @@
setUp(statusBarWindowView, groupManager, bar, vsManager);
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
- mAutoDismissNotificationDecayDozing = TEST_AUTO_DISMISS_TIME;
}
}
@@ -134,13 +133,11 @@
@Test
public void testExtendHeadsUp() {
- when(mStatusBarStateController.isDozing()).thenReturn(true);
mHeadsUpManager.showNotification(mEntry);
Runnable pastNormalTimeRunnable =
() -> mLivesPastNormalTime = mHeadsUpManager.isAlerting(mEntry.key);
mTestHandler.postDelayed(pastNormalTimeRunnable,
- mHeadsUpManager.mAutoDismissNotificationDecayDozing +
- mHeadsUpManager.mExtensionTime / 2);
+ TEST_AUTO_DISMISS_TIME + mHeadsUpManager.mExtensionTime / 2);
mTestHandler.postDelayed(TEST_TIMEOUT_RUNNABLE, TEST_TIMEOUT_TIME);
mHeadsUpManager.extendHeadsUp();