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

Commit 322c9dae authored by Roshan Pius's avatar Roshan Pius
Browse files

nfc(api): Restore behavior from Android T

When Nfc service is not ready, dont fetch NfcManager to avoid getting
into a state where the app keeps getting a bad NfcManager.

Restoring the fix from aosp/1498599.

Bug: 286025476
Change-Id: I4aaa0a87c38eaddccc566c18b75cd1acedc29d75
Test: Manual tests
parent cc112e10
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -711,6 +711,7 @@ public final class NfcAdapter {
                /* Stale sService pointer */
                if (sIsInitialized) sIsInitialized = false;
            }
            return null;
        }
        /* Try to initialize the service */
        NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);