[DO NOT MERGE] Move AuthSession usage to after null check

The system already schedules anything that reads/modifies/writes
AuthSession on the handler, so there shouldn't be any race condition
that can cause this. Simply move the session reading to after
the null check.

Fixes: 159897806

Test: Builds
Change-Id: Ia4c3ce32e9af3e8b73c02f5eab969f7314afc4c8
This commit is contained in:
Kevin Chyn
2020-06-26 15:26:49 -07:00
parent 5731877f1e
commit ee88f23c61

View File

@@ -1630,15 +1630,15 @@ public class BiometricService extends SystemService {
}
private void handleOnSystemEvent(int event) {
final boolean shouldReceive = mCurrentAuthSession.mBundle
.getBoolean(BiometricPrompt.KEY_RECEIVE_SYSTEM_EVENTS, false);
Slog.d(TAG, "onSystemEvent: " + event + ", shouldReceive: " + shouldReceive);
if (mCurrentAuthSession == null) {
Slog.e(TAG, "Auth session null");
return;
}
final boolean shouldReceive = mCurrentAuthSession.mBundle
.getBoolean(BiometricPrompt.KEY_RECEIVE_SYSTEM_EVENTS, false);
Slog.d(TAG, "onSystemEvent: " + event + ", shouldReceive: " + shouldReceive);
if (!shouldReceive) {
return;
}