am 63b7360e: Merge "Fix NPE on devices that don\'t have NFC." into ics-mr1
* commit '63b7360e9d8c6fb077bdd00c7ef08f402d5a76ba': Fix NPE on devices that don't have NFC.
This commit is contained in:
@@ -360,6 +360,10 @@ public final class NfcAdapter {
|
||||
/* use getSystemService() instead of just instantiating to take
|
||||
* advantage of the context's cached NfcManager & NfcAdapter */
|
||||
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
|
||||
if (manager == null) {
|
||||
// NFC not available
|
||||
return null;
|
||||
}
|
||||
return manager.getDefaultAdapter();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user