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

Commit d93909de authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Fixing setting mQsExpandImmediate state in correct context in...

Merge "Merge "Fixing setting mQsExpandImmediate state in correct context in split shade" into tm-dev am: b5310919 am: 8f4662c3 am: a18965d4" into tm-qpr-dev-plus-aosp
parents 29885843 e70790d0
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3178,12 +3178,6 @@ public class NotificationPanelViewController extends PanelViewController {
        mFalsingCollector.onTrackingStarted(!mKeyguardStateController.canDismissLockScreen());
        super.onTrackingStarted();
        mScrimController.onTrackingStarted();
        // normally we want to set mQsExpandImmediate for every split shade case (at least when
        // expanding), but keyguard tracking logic is different - this callback is called when
        // unlocking with swipe up but not when swiping down to reveal shade
        if (mShouldUseSplitNotificationShade && !mKeyguardShowing) {
            mQsExpandImmediate = true;
        }
        if (mQsFullyExpanded) {
            mQsExpandImmediate = true;
            setShowShelfOnly(true);
@@ -4930,6 +4924,12 @@ public class NotificationPanelViewController extends PanelViewController {
            mView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
        }
        if (state == STATE_OPENING) {
            // we need to ignore it on keyguard as this is a false alarm - transition from unlocked
            // to locked will trigger this event and we're not actually in the process of opening
            // the shade, lockscreen is just always expanded
            if (mShouldUseSplitNotificationShade && !isOnKeyguard()) {
                mQsExpandImmediate = true;
            }
            mCentralSurfaces.makeExpandedVisible(false);
        }
        if (state == STATE_CLOSED) {
+26 −3
Original line number Diff line number Diff line
@@ -352,6 +352,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
    private FalsingManagerFake mFalsingManager = new FalsingManagerFake();
    private FakeExecutor mExecutor = new FakeExecutor(new FakeSystemClock());
    private Handler mMainHandler;
    private final PanelExpansionStateManager mPanelExpansionStateManager =
            new PanelExpansionStateManager();

    @Before
    public void setup() {
@@ -516,7 +518,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
                mLargeScreenShadeHeaderController,
                mScreenOffAnimationController,
                mLockscreenGestureLogger,
                new PanelExpansionStateManager(),
                mPanelExpansionStateManager,
                mNotificationRemoteInputManager,
                mSysUIUnfoldComponent,
                mControlsComponent,
@@ -1018,14 +1020,35 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
    }

    @Test
    public void testQsToBeImmediatelyExpandedInSplitShade() {
    public void testQsToBeImmediatelyExpandedWhenOpeningPanelInSplitShade() {
        enableSplitShade(/* enabled= */ true);
        // set panel state to CLOSED
        mPanelExpansionStateManager.onPanelExpansionChanged(/* fraction= */ 0,
                /* expanded= */ false, /* tracking= */ false, /* dragDownPxAmount= */ 0);
        assertThat(mNotificationPanelViewController.mQsExpandImmediate).isFalse();

        mNotificationPanelViewController.onTrackingStarted();
        // change panel state to OPENING
        mPanelExpansionStateManager.onPanelExpansionChanged(/* fraction= */ 0.5f,
                /* expanded= */ true, /* tracking= */ true, /* dragDownPxAmount= */ 100);

        assertThat(mNotificationPanelViewController.mQsExpandImmediate).isTrue();
    }

    @Test
    public void testQsNotToBeImmediatelyExpandedWhenGoingFromUnlockedToLocked() {
        enableSplitShade(/* enabled= */ true);
        // set panel state to CLOSED
        mPanelExpansionStateManager.onPanelExpansionChanged(/* fraction= */ 0,
                /* expanded= */ false, /* tracking= */ false, /* dragDownPxAmount= */ 0);

        // go to lockscreen, which also sets fraction to 1.0f and makes shade "expanded"
        mStatusBarStateController.setState(KEYGUARD);
        mPanelExpansionStateManager.onPanelExpansionChanged(/* fraction= */ 1,
                /* expanded= */ true, /* tracking= */ true, /* dragDownPxAmount= */ 0);

        assertThat(mNotificationPanelViewController.mQsExpandImmediate).isFalse();
    }

    @Test
    public void interceptTouchEvent_withinQs_shadeExpanded_startsQsTracking() {
        mNotificationPanelViewController.mQs = mQs;