summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xAndroidManifest.xml6
-rwxr-xr-xsrc/com/android/nfc/NfcService.java10
2 files changed, 7 insertions, 9 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6177da4..3ce49b8 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -20,12 +20,6 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.VIBRATE" />
- <permission android:name="com.android.nfc.permission.NFCEE_ADMIN"
- android:label="@string/permlab_nfcAdmin"
- android:description="@string/permdesc_nfcAdmin"
- android:protectionLevel="dangerous"
- />
-
<application android:name="com.android.nfc.NfcService"
android:icon="@drawable/icon"
android:label="@string/app_name"
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 58a5732..7c1a8e6 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -1088,7 +1088,7 @@ public class NfcService extends Application implements DeviceHostListener {
//TODO: This is incorrect behavior - the close should interrupt pending
// operations. However this is not supported by current hardware.
- synchronized(NfcService.this) {
+ synchronized (NfcService.this) {
if (!isNfcEnabled()) {
throw new IOException("NFC adapter is disabled");
}
@@ -1168,7 +1168,11 @@ public class NfcService extends Application implements DeviceHostListener {
public Bundle close(String pkg, IBinder b) throws RemoteException {
NfcService.this.enforceNfceeAdminPerm(pkg);
- b.unlinkToDeath(mOpenEe, 0);
+ synchronized (this) {
+ if (mOpenEe != null) {
+ b.unlinkToDeath(mOpenEe, 0);
+ }
+ }
Bundle result;
try {
@@ -1201,7 +1205,7 @@ public class NfcService extends Application implements DeviceHostListener {
if (!isNfcEnabled()) {
throw new IOException("NFC is not enabled");
}
- if (mOpenEe == null){
+ if (mOpenEe == null) {
throw new IOException("NFC EE is not open");
}
if (getCallingPid() != mOpenEe.pid) {