diff options
author | Janis Danisevskis <jdanis@google.com> | 2021-03-23 19:18:55 -0700 |
---|---|---|
committer | Janis Danisevskis <jdanis@google.com> | 2021-03-23 19:18:55 -0700 |
commit | fd5cba448308ddce72fbbd93c504b4183810a9c3 (patch) | |
tree | 5e66f1d287c85d9d23263470e27771bd0098ad49 /keystore/java/android/security/AndroidKeyStoreMaintenance.java | |
parent | d880cf50a54acd6d9d7659db42195e563a4089ed (diff) |
Keystore 2.0: Add onDeviceOffBody to AndroidKeyStoreMaintenance.
Also have KeyStore.onDeviceOffBody call
AndroidKeyStoreMaintenance.onDeviceOffBody.
Test: N/A
Bug: 171305684
Change-Id: I0b01764bfc4c5828d17ccfffb4f8dad5f3bcea6d
Diffstat (limited to 'keystore/java/android/security/AndroidKeyStoreMaintenance.java')
-rw-r--r-- | keystore/java/android/security/AndroidKeyStoreMaintenance.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/keystore/java/android/security/AndroidKeyStoreMaintenance.java b/keystore/java/android/security/AndroidKeyStoreMaintenance.java index 35b1c169f283..72cea0cacd12 100644 --- a/keystore/java/android/security/AndroidKeyStoreMaintenance.java +++ b/keystore/java/android/security/AndroidKeyStoreMaintenance.java @@ -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); + } + } } |