Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +12 −16 Original line number Diff line number Diff line Loading @@ -359,6 +359,16 @@ public class CentralSurfaces extends CoreStartable implements private float mTransitionToFullShadeProgress = 0f; private NotificationListContainer mNotifListContainer; private final KeyguardStateController.Callback mKeyguardStateControllerCallback = new KeyguardStateController.Callback() { @Override public void onKeyguardShowingChanged() { boolean occluded = mKeyguardStateController.isOccluded(); mStatusBarHideIconsForBouncerManager.setIsOccludedAndTriggerUpdate(occluded); mScrimController.setKeyguardOccluded(occluded); } }; void onStatusBarWindowStateChanged(@WindowVisibleState int state) { updateBubblesVisibility(); mStatusBarWindowState = state; Loading Loading @@ -655,7 +665,6 @@ public class CentralSurfaces extends CoreStartable implements private int mLastLoggedStateFingerprint; private boolean mTopHidesStatusBar; private boolean mStatusBarWindowHidden; private boolean mIsOccluded; private boolean mIsLaunchingActivityOverLockscreen; private final UserSwitcherController mUserSwitcherController; Loading Loading @@ -1002,7 +1011,6 @@ public class CentralSurfaces extends CoreStartable implements mCommandQueue.setIcon(result.mIcons.keyAt(i), result.mIcons.valueAt(i)); } if (DEBUG) { Log.d(TAG, String.format( "init: icons=%d disabled=0x%08x lights=0x%08x imeButton=0x%08x", Loading Loading @@ -1036,7 +1044,6 @@ public class CentralSurfaces extends CoreStartable implements mKeyguardStateController.addCallback(new KeyguardStateController.Callback() { @Override public void onUnlockedChanged() { updateKeyguardState(); logStateToEventlog(); } }); Loading Loading @@ -1599,6 +1606,7 @@ public class CentralSurfaces extends CoreStartable implements mBiometricUnlockController, mStackScroller, mKeyguardBypassController); mKeyguardStateController.addCallback(mKeyguardStateControllerCallback); mKeyguardIndicationController .setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mBiometricUnlockController.setKeyguardViewController(mStatusBarKeyguardViewManager); Loading Loading @@ -1853,13 +1861,7 @@ public class CentralSurfaces extends CoreStartable implements * @return whether the keyguard is currently occluded */ public boolean isOccluded() { return mIsOccluded; } public void setOccluded(boolean occluded) { mIsOccluded = occluded; mStatusBarHideIconsForBouncerManager.setIsOccludedAndTriggerUpdate(occluded); mScrimController.setKeyguardOccluded(occluded); return mKeyguardStateController.isOccluded(); } /** A launch animation was cancelled. */ Loading Loading @@ -3383,11 +3385,6 @@ public class CentralSurfaces extends CoreStartable implements return mLightRevealScrim; } private void updateKeyguardState() { mKeyguardStateController.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(), mStatusBarKeyguardViewManager.isOccluded()); } public void onTrackingStarted() { mShadeController.runPostCollapseRunnables(); } Loading Loading @@ -4396,7 +4393,6 @@ public class CentralSurfaces extends CoreStartable implements checkBarModes(); updateScrimController(); mPresenter.updateMediaMetaData(false, mState != StatusBarState.KEYGUARD); updateKeyguardState(); Trace.endSection(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +10 −11 Original line number Diff line number Diff line Loading @@ -670,12 +670,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void setOccluded(boolean occluded, boolean animate) { mCentralSurfaces.setOccluded(occluded); if (occluded && !mOccluded && mShowing) { final boolean isOccluding = !mOccluded && occluded; final boolean isUnOccluding = mOccluded && !occluded; setOccludedAndUpdateStates(occluded); if (mShowing && isOccluding) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_STATE_CHANGED, SysUiStatsLog.KEYGUARD_STATE_CHANGED__STATE__OCCLUDED); if (mCentralSurfaces.isInLaunchTransition()) { setOccludedAndUpdateStates(true); final Runnable endRunnable = new Runnable() { @Override public void run() { Loading @@ -691,8 +693,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } if (mCentralSurfaces.isLaunchingActivityOverLockscreen()) { setOccludedAndUpdateStates(true); // When isLaunchingActivityOverLockscreen() is true, we know for sure that the post // collapse runnables will be run. mShadeController.get().addPostCollapseAction(() -> { Loading @@ -701,16 +701,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb }); return; } } else if (!occluded && mOccluded && mShowing) { } else if (mShowing && isUnOccluding) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_STATE_CHANGED, SysUiStatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN); } boolean isOccluding = !mOccluded && occluded; setOccludedAndUpdateStates(occluded); if (mShowing) { mMediaManager.updateMediaMetaData(false, animate && !occluded); mMediaManager.updateMediaMetaData(false, animate && !mOccluded); } mNotificationShadeWindowController.setKeyguardOccluded(occluded); mNotificationShadeWindowController.setKeyguardOccluded(mOccluded); // setDozing(false) will call reset once we stop dozing. if (!mDozing) { Loading @@ -718,7 +716,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb // by a FLAG_DISMISS_KEYGUARD_ACTIVITY. reset(isOccluding /* hideBouncerWhenShowing*/); } if (animate && !occluded && mShowing && !mBouncer.isShowing()) { if (animate && !mOccluded && mShowing && !mBouncer.isShowing()) { mCentralSurfaces.animateKeyguardUnoccluding(); } } Loading Loading @@ -1052,6 +1050,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (occluded != mLastOccluded || mFirstUpdate) { mKeyguardUpdateManager.onKeyguardOccludedChanged(occluded); mKeyguardStateController.notifyKeyguardState(showing, occluded); } if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) { mKeyguardUpdateManager.onKeyguardVisibilityChanged(showing && !occluded); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -861,11 +861,17 @@ public class CentralSurfacesTest extends SysuiTestCase { @Test public void testSetOccluded_propagatesToScrimController() { mCentralSurfaces.setOccluded(true); ArgumentCaptor<KeyguardStateController.Callback> callbackCaptor = ArgumentCaptor.forClass(KeyguardStateController.Callback.class); verify(mKeyguardStateController).addCallback(callbackCaptor.capture()); when(mKeyguardStateController.isOccluded()).thenReturn(true); callbackCaptor.getValue().onKeyguardShowingChanged(); verify(mScrimController).setKeyguardOccluded(eq(true)); reset(mScrimController); mCentralSurfaces.setOccluded(false); when(mKeyguardStateController.isOccluded()).thenReturn(false); callbackCaptor.getValue().onKeyguardShowingChanged(); verify(mScrimController).setKeyguardOccluded(eq(false)); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +10 −3 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mBiometricUnlockController, mNotificationContainer, mBypassController); when(mKeyguardStateController.isOccluded()).thenReturn(false); mStatusBarKeyguardViewManager.show(null); } Loading Loading @@ -286,23 +287,27 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void setOccluded_onKeyguardOccludedChangedCalledCorrectly() { mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(false); clearInvocations(mKeyguardStateController); clearInvocations(mKeyguardUpdateMonitor); // Should be false to start, so no invocations mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor, never()).onKeyguardOccludedChanged(anyBoolean()); verify(mKeyguardStateController, never()).notifyKeyguardState(anyBoolean(), anyBoolean()); clearInvocations(mKeyguardUpdateMonitor); clearInvocations(mKeyguardStateController); mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true); verify(mKeyguardStateController).notifyKeyguardState(true, true); clearInvocations(mKeyguardUpdateMonitor); clearInvocations(mKeyguardStateController); mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor, never()).onKeyguardOccludedChanged(anyBoolean()); verify(mKeyguardStateController, never()).notifyKeyguardState(anyBoolean(), anyBoolean()); } @Test Loading @@ -312,6 +317,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true); verify(mKeyguardStateController).notifyKeyguardState(true, true); } @Test Loading @@ -321,6 +327,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true); verify(mKeyguardStateController).notifyKeyguardState(true, true); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +12 −16 Original line number Diff line number Diff line Loading @@ -359,6 +359,16 @@ public class CentralSurfaces extends CoreStartable implements private float mTransitionToFullShadeProgress = 0f; private NotificationListContainer mNotifListContainer; private final KeyguardStateController.Callback mKeyguardStateControllerCallback = new KeyguardStateController.Callback() { @Override public void onKeyguardShowingChanged() { boolean occluded = mKeyguardStateController.isOccluded(); mStatusBarHideIconsForBouncerManager.setIsOccludedAndTriggerUpdate(occluded); mScrimController.setKeyguardOccluded(occluded); } }; void onStatusBarWindowStateChanged(@WindowVisibleState int state) { updateBubblesVisibility(); mStatusBarWindowState = state; Loading Loading @@ -655,7 +665,6 @@ public class CentralSurfaces extends CoreStartable implements private int mLastLoggedStateFingerprint; private boolean mTopHidesStatusBar; private boolean mStatusBarWindowHidden; private boolean mIsOccluded; private boolean mIsLaunchingActivityOverLockscreen; private final UserSwitcherController mUserSwitcherController; Loading Loading @@ -1002,7 +1011,6 @@ public class CentralSurfaces extends CoreStartable implements mCommandQueue.setIcon(result.mIcons.keyAt(i), result.mIcons.valueAt(i)); } if (DEBUG) { Log.d(TAG, String.format( "init: icons=%d disabled=0x%08x lights=0x%08x imeButton=0x%08x", Loading Loading @@ -1036,7 +1044,6 @@ public class CentralSurfaces extends CoreStartable implements mKeyguardStateController.addCallback(new KeyguardStateController.Callback() { @Override public void onUnlockedChanged() { updateKeyguardState(); logStateToEventlog(); } }); Loading Loading @@ -1599,6 +1606,7 @@ public class CentralSurfaces extends CoreStartable implements mBiometricUnlockController, mStackScroller, mKeyguardBypassController); mKeyguardStateController.addCallback(mKeyguardStateControllerCallback); mKeyguardIndicationController .setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mBiometricUnlockController.setKeyguardViewController(mStatusBarKeyguardViewManager); Loading Loading @@ -1853,13 +1861,7 @@ public class CentralSurfaces extends CoreStartable implements * @return whether the keyguard is currently occluded */ public boolean isOccluded() { return mIsOccluded; } public void setOccluded(boolean occluded) { mIsOccluded = occluded; mStatusBarHideIconsForBouncerManager.setIsOccludedAndTriggerUpdate(occluded); mScrimController.setKeyguardOccluded(occluded); return mKeyguardStateController.isOccluded(); } /** A launch animation was cancelled. */ Loading Loading @@ -3383,11 +3385,6 @@ public class CentralSurfaces extends CoreStartable implements return mLightRevealScrim; } private void updateKeyguardState() { mKeyguardStateController.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(), mStatusBarKeyguardViewManager.isOccluded()); } public void onTrackingStarted() { mShadeController.runPostCollapseRunnables(); } Loading Loading @@ -4396,7 +4393,6 @@ public class CentralSurfaces extends CoreStartable implements checkBarModes(); updateScrimController(); mPresenter.updateMediaMetaData(false, mState != StatusBarState.KEYGUARD); updateKeyguardState(); Trace.endSection(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +10 −11 Original line number Diff line number Diff line Loading @@ -670,12 +670,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void setOccluded(boolean occluded, boolean animate) { mCentralSurfaces.setOccluded(occluded); if (occluded && !mOccluded && mShowing) { final boolean isOccluding = !mOccluded && occluded; final boolean isUnOccluding = mOccluded && !occluded; setOccludedAndUpdateStates(occluded); if (mShowing && isOccluding) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_STATE_CHANGED, SysUiStatsLog.KEYGUARD_STATE_CHANGED__STATE__OCCLUDED); if (mCentralSurfaces.isInLaunchTransition()) { setOccludedAndUpdateStates(true); final Runnable endRunnable = new Runnable() { @Override public void run() { Loading @@ -691,8 +693,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } if (mCentralSurfaces.isLaunchingActivityOverLockscreen()) { setOccludedAndUpdateStates(true); // When isLaunchingActivityOverLockscreen() is true, we know for sure that the post // collapse runnables will be run. mShadeController.get().addPostCollapseAction(() -> { Loading @@ -701,16 +701,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb }); return; } } else if (!occluded && mOccluded && mShowing) { } else if (mShowing && isUnOccluding) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_STATE_CHANGED, SysUiStatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN); } boolean isOccluding = !mOccluded && occluded; setOccludedAndUpdateStates(occluded); if (mShowing) { mMediaManager.updateMediaMetaData(false, animate && !occluded); mMediaManager.updateMediaMetaData(false, animate && !mOccluded); } mNotificationShadeWindowController.setKeyguardOccluded(occluded); mNotificationShadeWindowController.setKeyguardOccluded(mOccluded); // setDozing(false) will call reset once we stop dozing. if (!mDozing) { Loading @@ -718,7 +716,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb // by a FLAG_DISMISS_KEYGUARD_ACTIVITY. reset(isOccluding /* hideBouncerWhenShowing*/); } if (animate && !occluded && mShowing && !mBouncer.isShowing()) { if (animate && !mOccluded && mShowing && !mBouncer.isShowing()) { mCentralSurfaces.animateKeyguardUnoccluding(); } } Loading Loading @@ -1052,6 +1050,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (occluded != mLastOccluded || mFirstUpdate) { mKeyguardUpdateManager.onKeyguardOccludedChanged(occluded); mKeyguardStateController.notifyKeyguardState(showing, occluded); } if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) { mKeyguardUpdateManager.onKeyguardVisibilityChanged(showing && !occluded); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -861,11 +861,17 @@ public class CentralSurfacesTest extends SysuiTestCase { @Test public void testSetOccluded_propagatesToScrimController() { mCentralSurfaces.setOccluded(true); ArgumentCaptor<KeyguardStateController.Callback> callbackCaptor = ArgumentCaptor.forClass(KeyguardStateController.Callback.class); verify(mKeyguardStateController).addCallback(callbackCaptor.capture()); when(mKeyguardStateController.isOccluded()).thenReturn(true); callbackCaptor.getValue().onKeyguardShowingChanged(); verify(mScrimController).setKeyguardOccluded(eq(true)); reset(mScrimController); mCentralSurfaces.setOccluded(false); when(mKeyguardStateController.isOccluded()).thenReturn(false); callbackCaptor.getValue().onKeyguardShowingChanged(); verify(mScrimController).setKeyguardOccluded(eq(false)); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +10 −3 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mBiometricUnlockController, mNotificationContainer, mBypassController); when(mKeyguardStateController.isOccluded()).thenReturn(false); mStatusBarKeyguardViewManager.show(null); } Loading Loading @@ -286,23 +287,27 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void setOccluded_onKeyguardOccludedChangedCalledCorrectly() { mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(false); clearInvocations(mKeyguardStateController); clearInvocations(mKeyguardUpdateMonitor); // Should be false to start, so no invocations mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor, never()).onKeyguardOccludedChanged(anyBoolean()); verify(mKeyguardStateController, never()).notifyKeyguardState(anyBoolean(), anyBoolean()); clearInvocations(mKeyguardUpdateMonitor); clearInvocations(mKeyguardStateController); mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true); verify(mKeyguardStateController).notifyKeyguardState(true, true); clearInvocations(mKeyguardUpdateMonitor); clearInvocations(mKeyguardStateController); mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor, never()).onKeyguardOccludedChanged(anyBoolean()); verify(mKeyguardStateController, never()).notifyKeyguardState(anyBoolean(), anyBoolean()); } @Test Loading @@ -312,6 +317,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true); verify(mKeyguardStateController).notifyKeyguardState(true, true); } @Test Loading @@ -321,6 +327,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true); verify(mKeyguardStateController).notifyKeyguardState(true, true); } @Test Loading