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

Commit 16452102 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Remove pieces of device entry flag - Piece #4" into main

parents 9c6750cf ceb7595d
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -68,13 +68,13 @@ import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.util.LatencyTracker;
import com.android.internal.util.LatencyTracker;
import com.android.keyguard.EmptyLockIconViewController;
import com.android.keyguard.KeyguardClockSwitch;
import com.android.keyguard.KeyguardClockSwitch;
import com.android.keyguard.KeyguardClockSwitchController;
import com.android.keyguard.KeyguardClockSwitchController;
import com.android.keyguard.KeyguardSliceViewController;
import com.android.keyguard.KeyguardSliceViewController;
import com.android.keyguard.KeyguardStatusView;
import com.android.keyguard.KeyguardStatusView;
import com.android.keyguard.KeyguardStatusViewController;
import com.android.keyguard.KeyguardStatusViewController;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.LegacyLockIconViewController;
import com.android.keyguard.dagger.KeyguardQsUserSwitchComponent;
import com.android.keyguard.dagger.KeyguardQsUserSwitchComponent;
import com.android.keyguard.dagger.KeyguardStatusBarViewComponent;
import com.android.keyguard.dagger.KeyguardStatusBarViewComponent;
import com.android.keyguard.dagger.KeyguardStatusViewComponent;
import com.android.keyguard.dagger.KeyguardStatusViewComponent;
@@ -271,6 +271,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected KeyguardUserSwitcherController mKeyguardUserSwitcherController;
    @Mock protected KeyguardUserSwitcherController mKeyguardUserSwitcherController;
    @Mock protected KeyguardStatusViewComponent mKeyguardStatusViewComponent;
    @Mock protected KeyguardStatusViewComponent mKeyguardStatusViewComponent;
    @Mock protected KeyguardStatusBarViewComponent.Factory mKeyguardStatusBarViewComponentFactory;
    @Mock protected KeyguardStatusBarViewComponent.Factory mKeyguardStatusBarViewComponentFactory;
    @Mock protected EmptyLockIconViewController mLockIconViewController;
    @Mock protected KeyguardStatusBarViewComponent mKeyguardStatusBarViewComponent;
    @Mock protected KeyguardStatusBarViewComponent mKeyguardStatusBarViewComponent;
    @Mock protected KeyguardClockSwitchController mKeyguardClockSwitchController;
    @Mock protected KeyguardClockSwitchController mKeyguardClockSwitchController;
    @Mock protected KeyguardStatusBarViewController mKeyguardStatusBarViewController;
    @Mock protected KeyguardStatusBarViewController mKeyguardStatusBarViewController;
@@ -285,7 +286,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected AmbientState mAmbientState;
    @Mock protected AmbientState mAmbientState;
    @Mock protected UserManager mUserManager;
    @Mock protected UserManager mUserManager;
    @Mock protected UiEventLogger mUiEventLogger;
    @Mock protected UiEventLogger mUiEventLogger;
    @Mock protected LegacyLockIconViewController mLockIconViewController;
    @Mock protected KeyguardViewConfigurator mKeyguardViewConfigurator;
    @Mock protected KeyguardViewConfigurator mKeyguardViewConfigurator;
    @Mock protected KeyguardRootView mKeyguardRootView;
    @Mock protected KeyguardRootView mKeyguardRootView;
    @Mock protected View mKeyguardRootViewChild;
    @Mock protected View mKeyguardRootViewChild;
@@ -397,7 +397,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        mFeatureFlags.set(Flags.QS_USER_DETAIL_SHORTCUT, false);
        mFeatureFlags.set(Flags.QS_USER_DETAIL_SHORTCUT, false);


        mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR);
        mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR);
        mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);


        mMainDispatcher = getMainDispatcher();
        mMainDispatcher = getMainDispatcher();
        KeyguardInteractorFactory.WithDependencies keyguardInteractorDeps =
        KeyguardInteractorFactory.WithDependencies keyguardInteractorDeps =
@@ -687,6 +686,9 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        when(longPressHandlingView.getResources()).thenReturn(longPressHandlingViewRes);
        when(longPressHandlingView.getResources()).thenReturn(longPressHandlingViewRes);
        when(longPressHandlingViewRes.getString(anyInt())).thenReturn("");
        when(longPressHandlingViewRes.getString(anyInt())).thenReturn("");


        when(mKeyguardRootView.findViewById(anyInt())).thenReturn(mKeyguardRootViewChild);
        when(mKeyguardViewConfigurator.getKeyguardRootView()).thenReturn(mKeyguardRootView);

        mNotificationPanelViewController = new NotificationPanelViewController(
        mNotificationPanelViewController = new NotificationPanelViewController(
                mView,
                mView,
                mMainHandler,
                mMainHandler,
@@ -869,11 +871,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        when(mNotificationStackScrollLayoutController.getTop()).thenReturn(0);
        when(mNotificationStackScrollLayoutController.getTop()).thenReturn(0);
        when(mNotificationStackScrollLayoutController.getHeight()).thenReturn(stackBottom);
        when(mNotificationStackScrollLayoutController.getHeight()).thenReturn(stackBottom);
        when(mNotificationStackScrollLayoutController.getBottom()).thenReturn(stackBottom);
        when(mNotificationStackScrollLayoutController.getBottom()).thenReturn(stackBottom);
        when(mLockIconViewController.getTop()).thenReturn((float) (stackBottom - lockIconPadding));

        when(mKeyguardRootViewChild.getTop()).thenReturn((int) (stackBottom - lockIconPadding));
        when(mKeyguardRootViewChild.getTop()).thenReturn((int) (stackBottom - lockIconPadding));
        when(mKeyguardRootView.findViewById(anyInt())).thenReturn(mKeyguardRootViewChild);
        when(mKeyguardViewConfigurator.getKeyguardRootView()).thenReturn(mKeyguardRootView);


        when(mResources.getDimensionPixelSize(R.dimen.keyguard_indication_bottom_padding))
        when(mResources.getDimensionPixelSize(R.dimen.keyguard_indication_bottom_padding))
                .thenReturn(indicationPadding);
                .thenReturn(indicationPadding);
+0 −6
Original line number Original line Diff line number Diff line
@@ -217,7 +217,6 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(5);
                .isEqualTo(5);


        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(5);
                .isEqualTo(5);
    }
    }
@@ -235,7 +234,6 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
                .isEqualTo(0);


        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
                .isEqualTo(0);
    }
    }
@@ -253,7 +251,6 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
                .isEqualTo(0);


        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
                .isEqualTo(0);
    }
    }
@@ -271,7 +268,6 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(2);
                .isEqualTo(2);


        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(2);
                .isEqualTo(2);
    }
    }
@@ -289,7 +285,6 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
                .isEqualTo(0);


        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
                .isEqualTo(0);
    }
    }
@@ -389,7 +384,6 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
    @Test
    @Test
    @DisableFlags(com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
    @DisableFlags(com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
    public void alternateBouncerVisible_onTouchEvent_notHandled() {
    public void alternateBouncerVisible_onTouchEvent_notHandled() {
        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        // GIVEN alternate bouncer is visible
        // GIVEN alternate bouncer is visible
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);


+5 −12
Original line number Original line Diff line number Diff line
@@ -123,7 +123,6 @@ import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor;
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor;
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.dump.DumpsysTableLogger;
import com.android.systemui.dump.DumpsysTableLogger;
@@ -1859,17 +1858,12 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    /** Returns space between top of lock icon and bottom of NotificationStackScrollLayout. */
    /** Returns space between top of lock icon and bottom of NotificationStackScrollLayout. */
    private float getLockIconPadding() {
    private float getLockIconPadding() {
        float lockIconPadding = 0f;
        float lockIconPadding = 0f;
        if (DeviceEntryUdfpsRefactor.isEnabled()) {
        View deviceEntryIconView = mKeyguardViewConfigurator.getKeyguardRootView()
        View deviceEntryIconView = mKeyguardViewConfigurator.getKeyguardRootView()
                .findViewById(R.id.device_entry_icon_view);
                .findViewById(R.id.device_entry_icon_view);
        if (deviceEntryIconView != null) {
        if (deviceEntryIconView != null) {
            lockIconPadding = mNotificationStackScrollLayoutController.getBottom()
            lockIconPadding = mNotificationStackScrollLayoutController.getBottom()
                - deviceEntryIconView.getTop();
                - deviceEntryIconView.getTop();
        }
        }
        } else if (mLockIconViewController.getTop() != 0f) {
            lockIconPadding = mNotificationStackScrollLayoutController.getBottom()
                    - mLockIconViewController.getTop();
        }
        return lockIconPadding;
        return lockIconPadding;
    }
    }


@@ -5059,8 +5053,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                return false;
                return false;
            }
            }


            if (DeviceEntryUdfpsRefactor.isEnabled()
            if (mAlternateBouncerInteractor.isVisibleState()) {
                    && mAlternateBouncerInteractor.isVisibleState()) {
                // never send touches to shade if the alternate bouncer is showing
                // never send touches to shade if the alternate bouncer is showing
                return false;
                return false;
            }
            }
+8 −23
Original line number Original line Diff line number Diff line
@@ -128,7 +128,6 @@ import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.demomode.DemoMode;
import com.android.systemui.demomode.DemoMode;
import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor;
import com.android.systemui.emergency.EmergencyGesture;
import com.android.systemui.emergency.EmergencyGesture;
import com.android.systemui.emergency.EmergencyGestureModule.EmergencyGestureIntentFactory;
import com.android.systemui.emergency.EmergencyGestureModule.EmergencyGestureIntentFactory;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.FeatureFlags;
@@ -2825,7 +2824,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        mScrimController.setExpansionAffectsAlpha(!unlocking);
        mScrimController.setExpansionAffectsAlpha(!unlocking);


        if (mAlternateBouncerInteractor.isVisibleState()) {
        if (mAlternateBouncerInteractor.isVisibleState()) {
            if (DeviceEntryUdfpsRefactor.isEnabled()) {
            if ((!mKeyguardStateController.isOccluded() || mShadeSurface.isPanelExpanded())
            if ((!mKeyguardStateController.isOccluded() || mShadeSurface.isPanelExpanded())
                    && (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED
                    && (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED
                    || mTransitionToFullShadeProgress > 0f)) {
                    || mTransitionToFullShadeProgress > 0f)) {
@@ -2834,15 +2832,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                // Safeguard which prevents the scrim from being stuck in the wrong state
                // Safeguard which prevents the scrim from being stuck in the wrong state
                mScrimController.legacyTransitionTo(ScrimState.KEYGUARD);
                mScrimController.legacyTransitionTo(ScrimState.KEYGUARD);
            }
            }
            } else {
                if ((!mKeyguardStateController.isOccluded() || mShadeSurface.isPanelExpanded())
                        && (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED
                        || mTransitionToFullShadeProgress > 0f)) {
                    mScrimController.legacyTransitionTo(ScrimState.AUTH_SCRIMMED_SHADE);
                } else {
                    mScrimController.legacyTransitionTo(ScrimState.AUTH_SCRIMMED);
                }
            }
            // This will cancel the keyguardFadingAway animation if it is running. We need to do
            // This will cancel the keyguardFadingAway animation if it is running. We need to do
            // this as otherwise it can remain pending and leave keyguard in a weird state.
            // this as otherwise it can remain pending and leave keyguard in a weird state.
            mUnlockScrimCallback.onCancelled();
            mUnlockScrimCallback.onCancelled();
@@ -3168,14 +3157,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                public void onDozeAmountChanged(float linear, float eased) {
                public void onDozeAmountChanged(float linear, float eased) {
                    if (!lightRevealMigration()
                    if (!lightRevealMigration()
                            && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
                            && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
                        if (DeviceEntryUdfpsRefactor.isEnabled()) {
                        // If wakeAndUnlocking, this is handled in AuthRippleInteractor
                        // If wakeAndUnlocking, this is handled in AuthRippleInteractor
                        if (!mBiometricUnlockController.isWakeAndUnlock()) {
                        if (!mBiometricUnlockController.isWakeAndUnlock()) {
                            mLightRevealScrim.setRevealAmount(1f - linear);
                            mLightRevealScrim.setRevealAmount(1f - linear);
                        }
                        }
                        } else {
                            mLightRevealScrim.setRevealAmount(1f - linear);
                        }
                    }
                    }
                }
                }


+0 −45
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
import static android.provider.Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED;
import static android.provider.Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED;
import static android.provider.Settings.Global.HEADS_UP_ON;
import static android.provider.Settings.Global.HEADS_UP_ON;


import static com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR;
import static com.android.systemui.Flags.FLAG_KEYBOARD_SHORTCUT_HELPER_REWRITE;
import static com.android.systemui.Flags.FLAG_KEYBOARD_SHORTCUT_HELPER_REWRITE;
import static com.android.systemui.Flags.FLAG_LIGHT_REVEAL_MIGRATION;
import static com.android.systemui.Flags.FLAG_LIGHT_REVEAL_MIGRATION;
import static com.android.systemui.flags.Flags.SHORTCUT_LIST_SEARCH_LAYOUT;
import static com.android.systemui.flags.Flags.SHORTCUT_LIST_SEARCH_LAYOUT;
@@ -859,34 +858,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
    }
    }


    @Test
    @Test
    @DisableFlags(FLAG_DEVICE_ENTRY_UDFPS_REFACTOR)
    public void testSetDozingNotUnlocking_transitionToAuthScrimmed_cancelKeyguardFadingAway() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);
        when(mKeyguardStateController.isKeyguardFadingAway()).thenReturn(true);

        mCentralSurfaces.updateScrimController();

        verify(mScrimController).legacyTransitionTo(eq(ScrimState.AUTH_SCRIMMED_SHADE));
        verify(mStatusBarKeyguardViewManager).onKeyguardFadedAway();
    }

    @Test
    @DisableFlags(FLAG_DEVICE_ENTRY_UDFPS_REFACTOR)
    public void testOccludingQSNotExpanded_flagOff_transitionToAuthScrimmed() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);

        // GIVEN device occluded and panel is NOT expanded
        mCentralSurfaces.setBarStateForTest(SHADE); // occluding on LS has StatusBarState = SHADE
        when(mKeyguardStateController.isOccluded()).thenReturn(true);
        when(mNotificationPanelViewController.isPanelExpanded()).thenReturn(false);

        mCentralSurfaces.updateScrimController();

        verify(mScrimController).legacyTransitionTo(eq(ScrimState.AUTH_SCRIMMED));
    }

    @Test
    @EnableFlags(FLAG_DEVICE_ENTRY_UDFPS_REFACTOR)
    public void testNotOccluding_QSNotExpanded_flagOn_doesNotTransitionScrimState() {
    public void testNotOccluding_QSNotExpanded_flagOn_doesNotTransitionScrimState() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);


@@ -902,7 +873,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
    }
    }


    @Test
    @Test
    @EnableFlags(FLAG_DEVICE_ENTRY_UDFPS_REFACTOR)
    public void testNotOccluding_QSExpanded_flagOn_doesTransitionScrimStateToKeyguard() {
    public void testNotOccluding_QSExpanded_flagOn_doesTransitionScrimStateToKeyguard() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);


@@ -917,21 +887,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
        verify(mScrimController, never()).legacyTransitionTo(eq(ScrimState.KEYGUARD));
        verify(mScrimController, never()).legacyTransitionTo(eq(ScrimState.KEYGUARD));
    }
    }


    @Test
    @DisableFlags(FLAG_DEVICE_ENTRY_UDFPS_REFACTOR)
    public void testOccludingQSExpanded_transitionToAuthScrimmedShade() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);

        // GIVEN device occluded and qs IS expanded
        mCentralSurfaces.setBarStateForTest(SHADE); // occluding on LS has StatusBarState = SHADE
        when(mKeyguardStateController.isOccluded()).thenReturn(true);
        when(mNotificationPanelViewController.isPanelExpanded()).thenReturn(true);

        mCentralSurfaces.updateScrimController();

        verify(mScrimController).legacyTransitionTo(eq(ScrimState.AUTH_SCRIMMED_SHADE));
    }

    @Test
    @Test
    public void testEnteringGlanceableHub_updatesScrim() {
    public void testEnteringGlanceableHub_updatesScrim() {
        // Transition to the glanceable hub.
        // Transition to the glanceable hub.