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

Commit 36497cd2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Release wakelock when binder died or exception occurs"

parents 302a8b09 71d04218
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -941,9 +941,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death

                        @Override
                        public void sendResult(Bundle data) throws RemoteException {
                            if (mWakeLock.isHeld()) {
                                mWakeLock.release();
                            }
                            releaseWakelock();
                        }
                    });
                } catch (DeadObjectException e) {
@@ -951,6 +949,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
                    mHandler.post(mRemoveCallbackRunnable);
                } catch (RemoteException e) {
                    Slog.w(TAG, "Failed to invoke onLockoutReset: ", e);
                    releaseWakelock();
                }
            }
        }
@@ -958,9 +957,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
        private final Runnable mRemoveCallbackRunnable = new Runnable() {
            @Override
            public void run() {
                if (mWakeLock.isHeld()) {
                    mWakeLock.release();
                }
                releaseWakelock();
                removeLockoutResetCallback(FingerprintServiceLockoutResetMonitor.this);
            }
        };
@@ -970,6 +967,12 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
            Slog.e(TAG, "Lockout reset callback binder died");
            mHandler.post(mRemoveCallbackRunnable);
        }

        private void releaseWakelock() {
            if (mWakeLock.isHeld()) {
                mWakeLock.release();
            }
        }
    }

    private IBiometricsFingerprintClientCallback mDaemonCallback =