Revert "Use waitForService() istead of getService()"
Revert submission 2264526 Reason for revert: Droidfood blocking bug: 262191143 Reverted changes: /q/submissionid:2264526 Change-Id: I32906f3c406ec0e4c1f83671bb988ae0e5d17dff
This commit is contained in:
committed by
Gerrit Code Review
parent
a8c470fb71
commit
0d3977c185
@@ -565,7 +565,8 @@ public final class NfcAdapter {
|
||||
return sNullContextNfcAdapter;
|
||||
}
|
||||
if (!sIsInitialized) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
PackageManager pm;
|
||||
pm = context.getPackageManager();
|
||||
sHasNfcFeature = pm.hasSystemFeature(PackageManager.FEATURE_NFC);
|
||||
sHasBeamFeature = pm.hasSystemFeature(PackageManager.FEATURE_NFC_BEAM);
|
||||
boolean hasHceFeature =
|
||||
@@ -616,12 +617,8 @@ public final class NfcAdapter {
|
||||
|
||||
/** get handle to NFC service interface */
|
||||
private static INfcAdapter getServiceInterface() {
|
||||
if (!sHasNfcFeature) {
|
||||
/* NFC is not supported */
|
||||
return null;
|
||||
}
|
||||
/* get a handle to NFC service */
|
||||
IBinder b = ServiceManager.waitForService("nfc");
|
||||
IBinder b = ServiceManager.getService("nfc");
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -651,15 +648,6 @@ public final class NfcAdapter {
|
||||
"context not associated with any application (using a mock context?)");
|
||||
}
|
||||
|
||||
synchronized (NfcAdapter.class) {
|
||||
if (!sIsInitialized) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
sHasNfcFeature = pm.hasSystemFeature(PackageManager.FEATURE_NFC);
|
||||
}
|
||||
if (!sHasNfcFeature) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (getServiceInterface() == null) {
|
||||
// NFC is not available
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user