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

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

SystemUI: SideFpsEventHandler: Don't crash without FingerprintManager

* On devices without FP, no FingerprintManager service is published
  resulting in a crash when accessing it
* Since notifyPowerPressed is sent unconditionally, make sure we even
  have a FPS

Change-Id: I74dbd6357aac4d3a0fb108018755b08968330156
parent d113be0d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -127,6 +127,10 @@ public class SideFpsEventHandler implements View.OnClickListener {
     */
    public void notifyPowerPressed() {
        Log.i(TAG, "notifyPowerPressed");
        final PackageManager pm = mContext.getPackageManager();
        if (!pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
            return;
        }
        if (mFingerprintManager == null && mSideFpsEventHandlerReady.get()) {
            mFingerprintManager = mContext.getSystemService(FingerprintManager.class);
        }