From ee88f23c613bd22e06f958d3ec864ab33ea962aa Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Fri, 26 Jun 2020 15:26:49 -0700 Subject: [PATCH] [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 --- .../com/android/server/biometrics/BiometricService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index 540c6ff09c9df..1217a507a8dcf 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -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; }