Merge "Keystore 2.0: Add onDeviceOffBody to AndroidKeyStoreMaintenance." am: e36f515441

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651545

Change-Id: I8f32ec1e083dc17d51911d6a493c7a74a32e8cea
This commit is contained in:
Janis Danisevskis
2021-03-24 18:39:28 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 0 deletions

View File

@@ -139,4 +139,18 @@ public class AndroidKeyStoreMaintenance {
return SYSTEM_ERROR;
}
}
/**
* Informs Keystore 2.0 that an off body event was detected.
*/
public static void onDeviceOffBody() {
if (!android.security.keystore2.AndroidKeyStoreProvider.isInstalled()) return;
try {
getService().onDeviceOffBody();
} catch (Exception e) {
// TODO This fails open. This is not a regression with respect to keystore1 but it
// should get fixed.
Log.e(TAG, "Error while reporting device off body event.", e);
}
}
}

View File

@@ -1204,6 +1204,7 @@ public class KeyStore {
* Notify keystore that the device went off-body.
*/
public void onDeviceOffBody() {
AndroidKeyStoreMaintenance.onDeviceOffBody();
try {
mBinder.onDeviceOffBody();
} catch (RemoteException e) {