diff options
author | Svetoslav <svetoslavganov@google.com> | 2015-04-30 18:31:35 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-30 18:31:37 +0000 |
commit | e4762675023bd2be20992c7bccce7e555a249e93 (patch) | |
tree | 2aa3fa78f047d7a9e07d1ffeb0785ecb1ae44bc6 /keystore | |
parent | 4223ce7dc8b1f0544a7d273831b674b6be1e5c4f (diff) | |
parent | 2dac95d03399bb9fa59999e4964d7f8bcd485c38 (diff) | |
download | frameworks_base-e4762675023bd2be20992c7bccce7e555a249e93.zip frameworks_base-e4762675023bd2be20992c7bccce7e555a249e93.tar.gz frameworks_base-e4762675023bd2be20992c7bccce7e555a249e93.tar.bz2 |
Merge "Fix the build" into mnc-dev
Diffstat (limited to 'keystore')
-rw-r--r-- | keystore/java/android/security/KeyStore.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index 1563863..5b0e74a 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -16,6 +16,8 @@ package android.security; +import android.app.ActivityThread; +import android.app.Application; import com.android.org.conscrypt.NativeConstants; import android.content.Context; @@ -625,18 +627,31 @@ public class KeyStore { return 0; } + String opPackageName = getMyOpPackageName(); + try { long deviceId = 0; // TODO: plumb hardware id to FPMS - if (!service.isHardwareDetected(deviceId)) { + if (!service.isHardwareDetected(deviceId, opPackageName)) { return 0; } - return service.getAuthenticatorId(); + return service.getAuthenticatorId(opPackageName); } catch (RemoteException e) { throw new IllegalStateException("Failed to communicate with fingerprint service", e); } } + private static String getMyOpPackageName() { + ActivityThread activityThread = ActivityThread.currentActivityThread(); + if (activityThread != null) { + Application application = activityThread.getApplication(); + if (application != null) { + return application.getOpPackageName(); + } + } + throw new IllegalStateException("Cannot create AudioRecord outside of an app"); + } + /** * Returns an {@link InvalidKeyException} corresponding to the provided keystore/keymaster error * code. |