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

Commit ee88f23c authored by Kevin Chyn's avatar Kevin Chyn
Browse files

[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
parent 5731877f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
        }