Merge "Add null check before invoking onChallengeInterruptFinished"

This commit is contained in:
Kevin Chyn
2020-11-02 19:17:55 +00:00
committed by Android (Google) Code Review

View File

@@ -582,13 +582,19 @@ class Face10 implements IHwBinder.DeathRecipient {
final FaceGenerateChallengeClient previousChallengeOwner =
mCurrentChallengeOwner.getInterruptedClient();
mCurrentChallengeOwner = null;
Slog.d(TAG, "Previous challenge owner: " + previousChallengeOwner);
if (previousChallengeOwner != null) {
try {
previousChallengeOwner.getListener()
.onChallengeInterruptFinished(mSensorId);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to notify interrupt finished", e);
final ClientMonitorCallbackConverter listener =
previousChallengeOwner.getListener();
if (listener == null) {
Slog.w(TAG, "Listener is null");
} else {
try {
listener.onChallengeInterruptFinished(mSensorId);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to notify interrupt finished", e);
}
}
}
}