Loading packages/SystemUI/src/com/android/systemui/flags/Flags.kt +0 −6 Original line number Diff line number Diff line Loading @@ -474,12 +474,6 @@ object Flags { @JvmField val DECOUPLE_REMOTE_INPUT_DELEGATE_AND_CALLBACK_UPDATE = unreleasedFlag("decouple_remote_input_delegate_and_callback_update") // 2900 - CentralSurfaces-related flags // TODO(b/285174336): Tracking Bug @JvmField val USE_REPOS_FOR_BOUNCER_SHOWING = releasedFlag("use_repos_for_bouncer_showing") /** TODO(b/296223317): Enables the new keyguard presentation containing a clock. */ @JvmField val ENABLE_CLOCK_KEYGUARD_PRESENTATION = releasedFlag("enable_clock_keyguard_presentation") Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +1 −33 Original line number Diff line number Diff line Loading @@ -68,8 +68,6 @@ import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlagsClassic; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository; import com.android.systemui.keyguard.shared.model.KeyguardState; Loading Loading @@ -210,11 +208,9 @@ public class NotificationStackScrollLayoutController implements Dumpable { @Nullable private Boolean mHistoryEnabled; private int mBarState; private boolean mIsBouncerShowingFromCentralSurfaces; private HeadsUpAppearanceController mHeadsUpAppearanceController; private boolean mIsInTransitionToAod = false; private final FeatureFlagsClassic mFeatureFlags; private final NotificationTargetsHelper mNotificationTargetsHelper; private final SecureSettings mSecureSettings; private final NotificationDismissibilityProvider mDismissibilityProvider; Loading Loading @@ -745,7 +741,6 @@ public class NotificationStackScrollLayoutController implements Dumpable { StackStateLogger stackLogger, NotificationStackScrollLogger logger, NotificationStackSizeCalculator notificationStackSizeCalculator, FeatureFlagsClassic featureFlags, NotificationTargetsHelper notificationTargetsHelper, SecureSettings secureSettings, NotificationDismissibilityProvider dismissibilityProvider, Loading Loading @@ -793,7 +788,6 @@ public class NotificationStackScrollLayoutController implements Dumpable { mSeenNotificationsInteractor = seenNotificationsInteractor; mShadeController = shadeController; mWindowRootView = windowRootView; mFeatureFlags = featureFlags; mNotificationTargetsHelper = notificationTargetsHelper; mSecureSettings = secureSettings; mDismissibilityProvider = dismissibilityProvider; Loading Loading @@ -1390,14 +1384,6 @@ public class NotificationStackScrollLayoutController implements Dumpable { mView.setPanelFlinging(flinging); } /** * Sets whether the bouncer is currently showing. Should only be called from * {@link CentralSurfaces}. */ public void setBouncerShowingFromCentralSurfaces(boolean bouncerShowing) { mIsBouncerShowingFromCentralSurfaces = bouncerShowing; } /** * Set the visibility of the view, and propagate it to specific children. * Loading Loading @@ -1435,31 +1421,13 @@ public class NotificationStackScrollLayoutController implements Dumpable { // For more details, see: b/228790482 && !mIsInTransitionToAod // Don't show any notification content if the bouncer is showing. See b/267060171. && !isBouncerShowing(); && !mPrimaryBouncerInteractor.isBouncerShowing(); mView.updateEmptyShadeView(shouldShow, mZenModeController.areNotificationsHiddenInShade()); Trace.endSection(); } /** * Returns whether the bouncer is currently showing. * * There's a possible timing difference between when CentralSurfaces marks the bouncer as not * showing and when PrimaryBouncerInteractor marks the bouncer as not showing. (CentralSurfaces * appears to mark the bouncer as showing for 10-200ms longer than PrimaryBouncerInteractor.) * * This timing difference could be load bearing, which is why we have a feature flag protecting * where we fetch the value from. This flag is intended to be short-lived. */ private boolean isBouncerShowing() { if (mFeatureFlags.isEnabled(Flags.USE_REPOS_FOR_BOUNCER_SHOWING)) { return mPrimaryBouncerInteractor.isBouncerShowing(); } else { return mIsBouncerShowingFromCentralSurfaces; } } /** * Update the importantForAccessibility of NotificationStackScrollLayout. * <p> Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +0 −1 Original line number Diff line number Diff line Loading @@ -2416,7 +2416,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mBouncerShowing = bouncerShowing; mKeyguardBypassController.setBouncerShowing(bouncerShowing); mPulseExpansionHandler.setBouncerShowing(bouncerShowing); mStackScrollerController.setBouncerShowingFromCentralSurfaces(bouncerShowing); setBouncerShowingForStatusBarComponents(bouncerShowing); mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +4 −60 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_ALL; import static kotlinx.coroutines.flow.FlowKt.emptyFlow; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; Loading @@ -36,8 +38,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import static kotlinx.coroutines.flow.FlowKt.emptyFlow; import android.metrics.LogMaker; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; Loading @@ -56,8 +56,6 @@ import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor; import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.classifier.FalsingManagerFake; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FakeFeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository; import com.android.systemui.keyguard.shared.model.KeyguardState; import com.android.systemui.keyguard.shared.model.TransitionStep; Loading Loading @@ -126,7 +124,6 @@ import javax.inject.Provider; public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { protected KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this); private final FakeFeatureFlags mFeatureFlags = new FakeFeatureFlags(); @Mock private NotificationGutsManager mNotificationGutsManager; @Mock private NotificationsController mNotificationsController; @Mock private NotificationVisibilityProvider mVisibilityProvider; Loading Loading @@ -193,8 +190,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { allowTestableLooperAsMainThread(); MockitoAnnotations.initMocks(this); mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, true); when(mNotificationSwipeHelperBuilder.build()).thenReturn(mNotificationSwipeHelper); when(mKeyguardTransitionRepo.getTransitions()).thenReturn(emptyFlow()); } Loading Loading @@ -299,36 +294,11 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOff_hideEmptyView() { public void testUpdateEmptyShadeView_bouncerShowing_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is off and *only* CentralSurfaces has bouncer as showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, false); mController.setBouncerShowingFromCentralSurfaces(true); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(false); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); mController.updateShowEmptyShadeView(); // THEN the CentralSurfaces value is used. Since the bouncer is showing, we hide the empty // view. verify(mNotificationStackScrollLayout).updateEmptyShadeView( /* visible= */ false, /* areNotificationsHiddenInShade= */ false); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOn_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is on and *only* PrimaryBouncerInteractor has bouncer as showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, true); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(true); mController.setBouncerShowingFromCentralSurfaces(false); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); Loading @@ -343,36 +313,11 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOff_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is off and *only* CentralSurfaces has bouncer as not showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, false); mController.setBouncerShowingFromCentralSurfaces(false); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(true); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); mController.updateShowEmptyShadeView(); // THEN the CentralSurfaces value is used. Since the bouncer isn't showing, we can show the // empty view. verify(mNotificationStackScrollLayout).updateEmptyShadeView( /* visible= */ true, /* areNotificationsHiddenInShade= */ false); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOn_showEmptyView() { public void testUpdateEmptyShadeView_bouncerNotShowing_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is on and *only* PrimaryBouncerInteractor has bouncer as not showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, true); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(false); mController.setBouncerShowingFromCentralSurfaces(true); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); Loading Loading @@ -1018,7 +963,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mStackLogger, mLogger, mNotificationStackSizeCalculator, mFeatureFlags, mNotificationTargetsHelper, mSecureSettings, mock(NotificationDismissibilityProvider.class), Loading Loading
packages/SystemUI/src/com/android/systemui/flags/Flags.kt +0 −6 Original line number Diff line number Diff line Loading @@ -474,12 +474,6 @@ object Flags { @JvmField val DECOUPLE_REMOTE_INPUT_DELEGATE_AND_CALLBACK_UPDATE = unreleasedFlag("decouple_remote_input_delegate_and_callback_update") // 2900 - CentralSurfaces-related flags // TODO(b/285174336): Tracking Bug @JvmField val USE_REPOS_FOR_BOUNCER_SHOWING = releasedFlag("use_repos_for_bouncer_showing") /** TODO(b/296223317): Enables the new keyguard presentation containing a clock. */ @JvmField val ENABLE_CLOCK_KEYGUARD_PRESENTATION = releasedFlag("enable_clock_keyguard_presentation") Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +1 −33 Original line number Diff line number Diff line Loading @@ -68,8 +68,6 @@ import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlagsClassic; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository; import com.android.systemui.keyguard.shared.model.KeyguardState; Loading Loading @@ -210,11 +208,9 @@ public class NotificationStackScrollLayoutController implements Dumpable { @Nullable private Boolean mHistoryEnabled; private int mBarState; private boolean mIsBouncerShowingFromCentralSurfaces; private HeadsUpAppearanceController mHeadsUpAppearanceController; private boolean mIsInTransitionToAod = false; private final FeatureFlagsClassic mFeatureFlags; private final NotificationTargetsHelper mNotificationTargetsHelper; private final SecureSettings mSecureSettings; private final NotificationDismissibilityProvider mDismissibilityProvider; Loading Loading @@ -745,7 +741,6 @@ public class NotificationStackScrollLayoutController implements Dumpable { StackStateLogger stackLogger, NotificationStackScrollLogger logger, NotificationStackSizeCalculator notificationStackSizeCalculator, FeatureFlagsClassic featureFlags, NotificationTargetsHelper notificationTargetsHelper, SecureSettings secureSettings, NotificationDismissibilityProvider dismissibilityProvider, Loading Loading @@ -793,7 +788,6 @@ public class NotificationStackScrollLayoutController implements Dumpable { mSeenNotificationsInteractor = seenNotificationsInteractor; mShadeController = shadeController; mWindowRootView = windowRootView; mFeatureFlags = featureFlags; mNotificationTargetsHelper = notificationTargetsHelper; mSecureSettings = secureSettings; mDismissibilityProvider = dismissibilityProvider; Loading Loading @@ -1390,14 +1384,6 @@ public class NotificationStackScrollLayoutController implements Dumpable { mView.setPanelFlinging(flinging); } /** * Sets whether the bouncer is currently showing. Should only be called from * {@link CentralSurfaces}. */ public void setBouncerShowingFromCentralSurfaces(boolean bouncerShowing) { mIsBouncerShowingFromCentralSurfaces = bouncerShowing; } /** * Set the visibility of the view, and propagate it to specific children. * Loading Loading @@ -1435,31 +1421,13 @@ public class NotificationStackScrollLayoutController implements Dumpable { // For more details, see: b/228790482 && !mIsInTransitionToAod // Don't show any notification content if the bouncer is showing. See b/267060171. && !isBouncerShowing(); && !mPrimaryBouncerInteractor.isBouncerShowing(); mView.updateEmptyShadeView(shouldShow, mZenModeController.areNotificationsHiddenInShade()); Trace.endSection(); } /** * Returns whether the bouncer is currently showing. * * There's a possible timing difference between when CentralSurfaces marks the bouncer as not * showing and when PrimaryBouncerInteractor marks the bouncer as not showing. (CentralSurfaces * appears to mark the bouncer as showing for 10-200ms longer than PrimaryBouncerInteractor.) * * This timing difference could be load bearing, which is why we have a feature flag protecting * where we fetch the value from. This flag is intended to be short-lived. */ private boolean isBouncerShowing() { if (mFeatureFlags.isEnabled(Flags.USE_REPOS_FOR_BOUNCER_SHOWING)) { return mPrimaryBouncerInteractor.isBouncerShowing(); } else { return mIsBouncerShowingFromCentralSurfaces; } } /** * Update the importantForAccessibility of NotificationStackScrollLayout. * <p> Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +0 −1 Original line number Diff line number Diff line Loading @@ -2416,7 +2416,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mBouncerShowing = bouncerShowing; mKeyguardBypassController.setBouncerShowing(bouncerShowing); mPulseExpansionHandler.setBouncerShowing(bouncerShowing); mStackScrollerController.setBouncerShowingFromCentralSurfaces(bouncerShowing); setBouncerShowingForStatusBarComponents(bouncerShowing); mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +4 −60 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_ALL; import static kotlinx.coroutines.flow.FlowKt.emptyFlow; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; Loading @@ -36,8 +38,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import static kotlinx.coroutines.flow.FlowKt.emptyFlow; import android.metrics.LogMaker; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; Loading @@ -56,8 +56,6 @@ import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor; import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.classifier.FalsingManagerFake; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FakeFeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository; import com.android.systemui.keyguard.shared.model.KeyguardState; import com.android.systemui.keyguard.shared.model.TransitionStep; Loading Loading @@ -126,7 +124,6 @@ import javax.inject.Provider; public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { protected KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this); private final FakeFeatureFlags mFeatureFlags = new FakeFeatureFlags(); @Mock private NotificationGutsManager mNotificationGutsManager; @Mock private NotificationsController mNotificationsController; @Mock private NotificationVisibilityProvider mVisibilityProvider; Loading Loading @@ -193,8 +190,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { allowTestableLooperAsMainThread(); MockitoAnnotations.initMocks(this); mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, true); when(mNotificationSwipeHelperBuilder.build()).thenReturn(mNotificationSwipeHelper); when(mKeyguardTransitionRepo.getTransitions()).thenReturn(emptyFlow()); } Loading Loading @@ -299,36 +294,11 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOff_hideEmptyView() { public void testUpdateEmptyShadeView_bouncerShowing_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is off and *only* CentralSurfaces has bouncer as showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, false); mController.setBouncerShowingFromCentralSurfaces(true); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(false); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); mController.updateShowEmptyShadeView(); // THEN the CentralSurfaces value is used. Since the bouncer is showing, we hide the empty // view. verify(mNotificationStackScrollLayout).updateEmptyShadeView( /* visible= */ false, /* areNotificationsHiddenInShade= */ false); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOn_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is on and *only* PrimaryBouncerInteractor has bouncer as showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, true); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(true); mController.setBouncerShowingFromCentralSurfaces(false); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); Loading @@ -343,36 +313,11 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOff_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is off and *only* CentralSurfaces has bouncer as not showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, false); mController.setBouncerShowingFromCentralSurfaces(false); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(true); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); mController.updateShowEmptyShadeView(); // THEN the CentralSurfaces value is used. Since the bouncer isn't showing, we can show the // empty view. verify(mNotificationStackScrollLayout).updateEmptyShadeView( /* visible= */ true, /* areNotificationsHiddenInShade= */ false); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOn_showEmptyView() { public void testUpdateEmptyShadeView_bouncerNotShowing_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); // WHEN the flag is on and *only* PrimaryBouncerInteractor has bouncer as not showing mFeatureFlags.set(Flags.USE_REPOS_FOR_BOUNCER_SHOWING, true); when(mPrimaryBouncerInteractor.isBouncerShowing()).thenReturn(false); mController.setBouncerShowingFromCentralSurfaces(true); setupShowEmptyShadeViewState(true); reset(mNotificationStackScrollLayout); Loading Loading @@ -1018,7 +963,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mStackLogger, mLogger, mNotificationStackSizeCalculator, mFeatureFlags, mNotificationTargetsHelper, mSecureSettings, mock(NotificationDismissibilityProvider.class), Loading