diff options
Diffstat (limited to 'src/com/android/nfc/NfcService.java')
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 10 |
1 files changed, 7 insertions, 3 deletions
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) { |