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

Commit 34639f47 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Clear mCurrentChallengeOwner when owner dies

Fixes: 167523869

Test: 1) enter face settings
      2) kill settings app (adb shell pkill -9 com.android.settings)
      3) enter password on lockscreen
      No crash observed
Change-Id: I20c9b2850e34c6e063e7cb25ee8e6934f0a86f29
parent 394d2eca
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -176,6 +176,9 @@ public abstract class ClientMonitor<T> extends LoggableMonitor implements IBinde

    // TODO(b/157790417): Move this to the scheduler
    void binderDiedInternal(boolean clearListener) {
        Slog.e(TAG, "Binder died, owner: " + getOwnerString()
                + ", operation: " + this.getClass().getName());

        if (isAlreadyDone()) {
            Slog.w(TAG, "Binder died but client is finished, ignoring");
            return;
+9 −2
Original line number Diff line number Diff line
@@ -510,8 +510,15 @@ class Face10 implements IHwBinder.DeathRecipient {
            if (mCurrentChallengeOwner != null) {
                Slog.w(TAG, "Current challenge owner: " + mCurrentChallengeOwner
                        + ", interrupted by: " + opPackageName);
                final ClientMonitorCallbackConverter listener =
                        mCurrentChallengeOwner.getListener();
                if (listener == null) {
                    Slog.w(TAG, "Null listener, skip sending interruption callback");
                    return;
                }

                try {
                    mCurrentChallengeOwner.getListener().onChallengeInterrupted(mSensorId);
                    listener.onChallengeInterrupted(mSensorId);
                } catch (RemoteException e) {
                    Slog.e(TAG, "Unable to notify challenge interrupted", e);
                }
@@ -524,7 +531,7 @@ class Face10 implements IHwBinder.DeathRecipient {
                @Override
                public void onClientStarted(@NonNull ClientMonitor<?> clientMonitor) {
                    if (client != clientMonitor) {
                        Slog.e(TAG, "scheduleGenerateChallenge, mismatched client."
                        Slog.e(TAG, "scheduleGenerateChallenge onClientStarted, mismatched client."
                                + " Expecting: " + client + ", received: " + clientMonitor);
                        return;
                    }