Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79a4f2b7 authored by Janis Danisevskis's avatar Janis Danisevskis Committed by Automerger Merge Worker
Browse files

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

Merge "Keystore 2.0: Add onDeviceOffBody to AndroidKeyStoreMaintenance." am: e36f5154 am: bbc3e755

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

Change-Id: I00948f85fec91708609344c9d55f839edca457e7
parents 598eae0d bbc3e755
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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);
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -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) {