Merge "Clear mCurrentChallengeOwner when owner dies"

This commit is contained in:
TreeHugger Robot
2020-09-09 00:21:31 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;
}