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
This commit is contained in:
Roshan Pius
2023-06-21 00:28:25 +00:00
parent cc112e1010
commit 322c9daeeb

View File

@@ -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);