Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -2680,6 +2680,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { && mStatusBarStateController.getDozeAmount() == 1f && mWakefulnessLifecycle.getLastWakeReason() == PowerManager.WAKE_REASON_POWER_BUTTON && mFingerprintManager.get() != null && mFingerprintManager.get().isPowerbuttonFps() && mKeyguardUpdateMonitor .getCachedIsUnlockWithFingerprintPossible( Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +26 −1 Original line number Diff line number Diff line Loading @@ -399,7 +399,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase { when(mGradientColors.supportsDarkText()).thenReturn(true); when(mColorExtractor.getNeutralColors()).thenReturn(mGradientColors); ConfigurationController configurationController = new ConfigurationControllerImpl(mContext); when(mLockscreenWallpaperLazy.get()).thenReturn(mLockscreenWallpaper); when(mBiometricUnlockControllerLazy.get()).thenReturn(mBiometricUnlockController); Loading Loading @@ -438,6 +437,11 @@ public class CentralSurfacesImplTest extends SysuiTestCase { when(mUserTracker.getUserHandle()).thenReturn( UserHandle.of(ActivityManager.getCurrentUser())); createCentralSurfaces(); } private void createCentralSurfaces() { ConfigurationController configurationController = new ConfigurationControllerImpl(mContext); mCentralSurfaces = new CentralSurfacesImpl( mContext, mNotificationsController, Loading Loading @@ -1083,6 +1087,27 @@ public class CentralSurfacesImplTest extends SysuiTestCase { verify(mNotificationPanelViewController).setTouchAndAnimationDisabled(true); } /** Regression test for b/298355063 */ @Test public void fingerprintManagerNull_noNPE() { // GIVEN null fingerprint manager mFingerprintManager = null; createCentralSurfaces(); // GIVEN should animate doze wakeup when(mDozeServiceHost.shouldAnimateWakeup()).thenReturn(true); when(mBiometricUnlockController.getMode()).thenReturn( BiometricUnlockController.MODE_ONLY_WAKE); when(mDozeServiceHost.isPulsing()).thenReturn(false); when(mStatusBarStateController.getDozeAmount()).thenReturn(1f); // WHEN waking up from the power button mWakefulnessLifecycle.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); // THEN no NPE when fingerprintManager is null } /** * Configures the appropriate mocks and then calls {@link CentralSurfacesImpl#updateIsKeyguard} * to reconfigure the keyguard to reflect the requested showing/occluded states. Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -2680,6 +2680,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { && mStatusBarStateController.getDozeAmount() == 1f && mWakefulnessLifecycle.getLastWakeReason() == PowerManager.WAKE_REASON_POWER_BUTTON && mFingerprintManager.get() != null && mFingerprintManager.get().isPowerbuttonFps() && mKeyguardUpdateMonitor .getCachedIsUnlockWithFingerprintPossible( Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +26 −1 Original line number Diff line number Diff line Loading @@ -399,7 +399,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase { when(mGradientColors.supportsDarkText()).thenReturn(true); when(mColorExtractor.getNeutralColors()).thenReturn(mGradientColors); ConfigurationController configurationController = new ConfigurationControllerImpl(mContext); when(mLockscreenWallpaperLazy.get()).thenReturn(mLockscreenWallpaper); when(mBiometricUnlockControllerLazy.get()).thenReturn(mBiometricUnlockController); Loading Loading @@ -438,6 +437,11 @@ public class CentralSurfacesImplTest extends SysuiTestCase { when(mUserTracker.getUserHandle()).thenReturn( UserHandle.of(ActivityManager.getCurrentUser())); createCentralSurfaces(); } private void createCentralSurfaces() { ConfigurationController configurationController = new ConfigurationControllerImpl(mContext); mCentralSurfaces = new CentralSurfacesImpl( mContext, mNotificationsController, Loading Loading @@ -1083,6 +1087,27 @@ public class CentralSurfacesImplTest extends SysuiTestCase { verify(mNotificationPanelViewController).setTouchAndAnimationDisabled(true); } /** Regression test for b/298355063 */ @Test public void fingerprintManagerNull_noNPE() { // GIVEN null fingerprint manager mFingerprintManager = null; createCentralSurfaces(); // GIVEN should animate doze wakeup when(mDozeServiceHost.shouldAnimateWakeup()).thenReturn(true); when(mBiometricUnlockController.getMode()).thenReturn( BiometricUnlockController.MODE_ONLY_WAKE); when(mDozeServiceHost.isPulsing()).thenReturn(false); when(mStatusBarStateController.getDozeAmount()).thenReturn(1f); // WHEN waking up from the power button mWakefulnessLifecycle.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); // THEN no NPE when fingerprintManager is null } /** * Configures the appropriate mocks and then calls {@link CentralSurfacesImpl#updateIsKeyguard} * to reconfigure the keyguard to reflect the requested showing/occluded states. Loading