Merge "Nfc adapter randomly returns null on devices having Nfc" into rvc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
aadceeb17a
@@ -677,6 +677,12 @@ public final class NfcAdapter {
|
|||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"context not associated with any application (using a mock context?)");
|
"context not associated with any application (using a mock context?)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getServiceInterface() == null) {
|
||||||
|
// NFC is not available
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* use getSystemService() for consistency */
|
/* use getSystemService() for consistency */
|
||||||
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
|
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
|
||||||
if (manager == null) {
|
if (manager == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user