diff options
author | Jason parks <jparks@google.com> | 2011-06-20 11:09:54 -0500 |
---|---|---|
committer | Jason parks <jparks@google.com> | 2011-06-20 11:09:54 -0500 |
commit | 9e52520889fa9ee7d045180504faadf0e3c70264 (patch) | |
tree | 4616c975ee09033b3d61362af56f98fbda88be82 /src | |
parent | 79414359cbf9be51a97963ddbee3fd29dcdeb009 (diff) | |
parent | 52eadbdda8fd2c8fe6f2f6327e5268e3b2b9f3cf (diff) | |
download | packages_apps_nfc-9e52520889fa9ee7d045180504faadf0e3c70264.zip packages_apps_nfc-9e52520889fa9ee7d045180504faadf0e3c70264.tar.gz packages_apps_nfc-9e52520889fa9ee7d045180504faadf0e3c70264.tar.bz2 |
Merge commit '52eadbdd' into nfc
Conflicts:
src/com/android/nfc/NfcService.java
Change-Id: I0cd15dbdc3540cb469d6fc13550006e1ab43b90f
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java index f27f6b1..aeac1fe 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -78,6 +78,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -146,7 +147,7 @@ public class NfcService extends Application implements DeviceHostListener { private final HashMap<Integer, Object> mObjectMap = new HashMap<Integer, Object>(); private final HashMap<Integer, Object> mSocketMap = new HashMap<Integer, Object>(); private boolean mScreenUnlocked; - private String mSePackageName; + private HashSet<String> mSePackages = new HashSet<String>(); // fields below are final after onCreate() Context mContext; @@ -1652,6 +1653,12 @@ public class NfcService extends Application implements DeviceHostListener { } catch (RemoteException e) { mOpenEe.binderDied(); } + + // Add the calling package to the list of packages that have accessed + // the secure element. + for (String packageName : getPackageManager().getPackagesForUid(getCallingUid())) { + mSePackages.add(packageName); + } } } @@ -2374,8 +2381,9 @@ public class NfcService extends Application implements DeviceHostListener { String packageName = data.getSchemeSpecificPart(); synchronized (NfcService.this) { - if (packageName.equals(mSePackageName)) { + if (mSePackages.contains(packageName)) { executeSeReset(); + mSePackages.remove(packageName); } } } |