Merge "Reduce duration of AOD headsup" into qt-r1-dev

am: e03623cee0

Change-Id: I64bb4c9763dd66060495a21c63c1e0ca0057ea3f
This commit is contained in:
Lucas Dupin
2019-07-17 13:58:19 -07:00
committed by android-build-merger
4 changed files with 4 additions and 17 deletions

View File

@@ -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. -->

View File

@@ -72,8 +72,6 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
private NotificationGroupManager mGroupManager;
private VisualStabilityManager mVisualStabilityManager;
private StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
@VisibleForTesting
int mAutoDismissNotificationDecayDozing;
private boolean mReleaseOnExpandFinish;
private int mStatusBarHeight;
@@ -120,8 +118,6 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
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 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
}
private int getDecayDuration() {
if (mStatusBarStateController.isDozing()) {
return mAutoDismissNotificationDecayDozing;
} else if (isAutoHeadsUp()) {
if (isAutoHeadsUp()) {
return getRecommendedHeadsUpTimeoutMs(mAutoHeadsUpNotificationDecay);
} else {
return getRecommendedHeadsUpTimeoutMs(mAutoDismissNotificationDecay);

View File

@@ -64,7 +64,7 @@ public class AlertingNotificationManagerTest extends SysuiTestCase {
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;

View File

@@ -70,7 +70,6 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
setUp(statusBarWindowView, groupManager, bar, vsManager);
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
mAutoDismissNotificationDecayDozing = TEST_AUTO_DISMISS_TIME;
}
}
@@ -134,13 +133,11 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
@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();