Merge "Reduce duration of AOD headsup" into qt-r1-dev
am: e03623cee0
Change-Id: I64bb4c9763dd66060495a21c63c1e0ca0057ea3f
This commit is contained in:
@@ -154,12 +154,8 @@
|
|||||||
<!-- The number of milliseconds before the heads up notification accepts touches. -->
|
<!-- The number of milliseconds before the heads up notification accepts touches. -->
|
||||||
<integer name="touch_acceptance_delay">700</integer>
|
<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) -->
|
<!-- 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
|
<!-- In multi-window, determines whether the stack where recents lives should grow from
|
||||||
the smallest position when being launched. -->
|
the smallest position when being launched. -->
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
private NotificationGroupManager mGroupManager;
|
private NotificationGroupManager mGroupManager;
|
||||||
private VisualStabilityManager mVisualStabilityManager;
|
private VisualStabilityManager mVisualStabilityManager;
|
||||||
private StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
|
private StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
|
||||||
@VisibleForTesting
|
|
||||||
int mAutoDismissNotificationDecayDozing;
|
|
||||||
private boolean mReleaseOnExpandFinish;
|
private boolean mReleaseOnExpandFinish;
|
||||||
|
|
||||||
private int mStatusBarHeight;
|
private int mStatusBarHeight;
|
||||||
@@ -120,8 +118,6 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
KeyguardBypassController bypassController) {
|
KeyguardBypassController bypassController) {
|
||||||
super(context);
|
super(context);
|
||||||
Resources resources = mContext.getResources();
|
Resources resources = mContext.getResources();
|
||||||
mAutoDismissNotificationDecayDozing = resources.getInteger(
|
|
||||||
R.integer.heads_up_notification_decay_dozing);
|
|
||||||
mExtensionTime = resources.getInteger(R.integer.ambient_notification_extension_time);
|
mExtensionTime = resources.getInteger(R.integer.ambient_notification_extension_time);
|
||||||
mAutoHeadsUpNotificationDecay = resources.getInteger(
|
mAutoHeadsUpNotificationDecay = resources.getInteger(
|
||||||
R.integer.auto_heads_up_notification_decay);
|
R.integer.auto_heads_up_notification_decay);
|
||||||
@@ -612,9 +608,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getDecayDuration() {
|
private int getDecayDuration() {
|
||||||
if (mStatusBarStateController.isDozing()) {
|
if (isAutoHeadsUp()) {
|
||||||
return mAutoDismissNotificationDecayDozing;
|
|
||||||
} else if (isAutoHeadsUp()) {
|
|
||||||
return getRecommendedHeadsUpTimeoutMs(mAutoHeadsUpNotificationDecay);
|
return getRecommendedHeadsUpTimeoutMs(mAutoHeadsUpNotificationDecay);
|
||||||
} else {
|
} else {
|
||||||
return getRecommendedHeadsUpTimeoutMs(mAutoDismissNotificationDecay);
|
return getRecommendedHeadsUpTimeoutMs(mAutoDismissNotificationDecay);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class AlertingNotificationManagerTest extends SysuiTestCase {
|
|||||||
protected static final int TEST_AUTO_DISMISS_TIME = 500;
|
protected static final int TEST_AUTO_DISMISS_TIME = 500;
|
||||||
// Number of notifications to use in tests requiring multiple notifications
|
// Number of notifications to use in tests requiring multiple notifications
|
||||||
private static final int TEST_NUM_NOTIFICATIONS = 4;
|
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;
|
protected final Runnable TEST_TIMEOUT_RUNNABLE = () -> mTimedOut = true;
|
||||||
|
|
||||||
private AlertingNotificationManager mAlertingNotificationManager;
|
private AlertingNotificationManager mAlertingNotificationManager;
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
|||||||
setUp(statusBarWindowView, groupManager, bar, vsManager);
|
setUp(statusBarWindowView, groupManager, bar, vsManager);
|
||||||
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
|
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
|
||||||
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
|
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
|
||||||
mAutoDismissNotificationDecayDozing = TEST_AUTO_DISMISS_TIME;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,13 +133,11 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExtendHeadsUp() {
|
public void testExtendHeadsUp() {
|
||||||
when(mStatusBarStateController.isDozing()).thenReturn(true);
|
|
||||||
mHeadsUpManager.showNotification(mEntry);
|
mHeadsUpManager.showNotification(mEntry);
|
||||||
Runnable pastNormalTimeRunnable =
|
Runnable pastNormalTimeRunnable =
|
||||||
() -> mLivesPastNormalTime = mHeadsUpManager.isAlerting(mEntry.key);
|
() -> mLivesPastNormalTime = mHeadsUpManager.isAlerting(mEntry.key);
|
||||||
mTestHandler.postDelayed(pastNormalTimeRunnable,
|
mTestHandler.postDelayed(pastNormalTimeRunnable,
|
||||||
mHeadsUpManager.mAutoDismissNotificationDecayDozing +
|
TEST_AUTO_DISMISS_TIME + mHeadsUpManager.mExtensionTime / 2);
|
||||||
mHeadsUpManager.mExtensionTime / 2);
|
|
||||||
mTestHandler.postDelayed(TEST_TIMEOUT_RUNNABLE, TEST_TIMEOUT_TIME);
|
mTestHandler.postDelayed(TEST_TIMEOUT_RUNNABLE, TEST_TIMEOUT_TIME);
|
||||||
|
|
||||||
mHeadsUpManager.extendHeadsUp();
|
mHeadsUpManager.extendHeadsUp();
|
||||||
|
|||||||
Reference in New Issue
Block a user