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

Unverified Commit d113be0d authored by Michael W's avatar Michael W Committed by Michael Bestas
Browse files

SystemUI: Prevent NPE when checking for powerbutton FPS

* Without a fingerprint sensor at all we also have no access to a
  FingerprintManager, resulting in a NPE
* Check the FingerprintManager before accessign it

Change-Id: Ia5019524fdf195a9477392fc0264ead8d4d31994
parent c2bde32b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2888,13 +2888,15 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                    // Delay if we're waking up, not mid-doze animation (which means we are
                    // cancelling a sleep), from the power button, on a device with a power button
                    // FPS, and 'press to unlock' is required.
                    FingerprintManager fpm = mFingerprintManager.get();
                    mShouldDelayWakeUpAnimation =
                            !isPulsing()
                                    && mStatusBarStateController.getDozeAmount() == 1f
                                    && mWakefulnessLifecycle.getLastWakeReason()
                                    == PowerManager.WAKE_REASON_POWER_BUTTON
                                    && mFingerprintManager.get().isPowerbuttonFps()
                                    && mFingerprintManager.get().hasEnrolledFingerprints()
                                    && fpm != null
                                    && fpm.isPowerbuttonFps()
                                    && fpm.hasEnrolledFingerprints()
                                    && !touchToUnlockAnytime;
                    if (DEBUG_WAKEUP_DELAY) {
                        Log.d(TAG, "mShouldDelayWakeUpAnimation=" + mShouldDelayWakeUpAnimation);