Skip to content

Commit

Permalink
Add the onDeviceOffBody API method to KeyStore
Browse files Browse the repository at this point in the history
This is necessary for allowing the KeyStore to lock keys that remain
authorized as long as the device is on-body.

Bug 28911985

Change-Id: If50bc84d5a1cb23f9b01b1950c3676d1519cc4f5
  • Loading branch information
Tucker Sylvestro committed Sep 23, 2016
1 parent 1c49ec3 commit b32aae2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/java/android/security/IKeystoreService.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ interface IKeystoreService {
int onUserAdded(int userId, int parentId);
int onUserRemoved(int userId);
int attestKey(String alias, in KeymasterArguments params, out KeymasterCertificateChain chain);
int onDeviceOffBody();
}
10 changes: 10 additions & 0 deletions keystore/java/android/security/KeyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,16 @@ public int attestKey(
}
}

/**
* Notify keystore that the device went off-body.
*/
public void onDeviceOffBody() {
try {
mBinder.onDeviceOffBody();
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
}
}

/**
* Returns a {@link KeyStoreException} corresponding to the provided keystore/keymaster error
Expand Down

0 comments on commit b32aae2

Please sign in to comment.