am e4762675: Merge "Fix the build" into mnc-dev
* commit 'e4762675023bd2be20992c7bccce7e555a249e93': Fix the build
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package android.security;
|
package android.security;
|
||||||
|
|
||||||
|
import android.app.ActivityThread;
|
||||||
|
import android.app.Application;
|
||||||
import com.android.org.conscrypt.NativeConstants;
|
import com.android.org.conscrypt.NativeConstants;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -625,18 +627,31 @@ public class KeyStore {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String opPackageName = getMyOpPackageName();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
long deviceId = 0; // TODO: plumb hardware id to FPMS
|
long deviceId = 0; // TODO: plumb hardware id to FPMS
|
||||||
if (!service.isHardwareDetected(deviceId)) {
|
if (!service.isHardwareDetected(deviceId, opPackageName)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return service.getAuthenticatorId();
|
return service.getAuthenticatorId(opPackageName);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new IllegalStateException("Failed to communicate with fingerprint service", 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
|
* Returns an {@link InvalidKeyException} corresponding to the provided keystore/keymaster error
|
||||||
* code.
|
* code.
|
||||||
|
|||||||
Reference in New Issue
Block a user