Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e03623ce authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 6050d6b6 d534c123
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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. -->
+1 −7
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −4
Original line number Diff line number Diff line
@@ -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();