summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2015-04-30 11:30:33 -0700
committerSvetoslav <svetoslavganov@google.com>2015-04-30 11:30:33 -0700
commit2dac95d03399bb9fa59999e4964d7f8bcd485c38 (patch)
tree0c5dc1c7701dddba38e190d54e6c97de5e6f8779 /keystore
parent3327f3d6886a96ad70f4e96e4b7c26b9555429b6 (diff)
downloadframeworks_base-2dac95d03399bb9fa59999e4964d7f8bcd485c38.zip
frameworks_base-2dac95d03399bb9fa59999e4964d7f8bcd485c38.tar.gz
frameworks_base-2dac95d03399bb9fa59999e4964d7f8bcd485c38.tar.bz2
Fix the build
Change-Id: I24e697e989b5f88c3f5e61343fbff60a09aa4c12
Diffstat (limited to 'keystore')
-rw-r--r--keystore/java/android/security/KeyStore.java19
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.