From 83ce095c848b972156256855d0f2a2ff4aa068fd Mon Sep 17 00:00:00 2001 From: Chad Brubaker Date: Tue, 12 May 2015 13:00:02 -0700 Subject: Add keystore onUserAdded/Removed methods (cherry-picked from commit 31c2897105e6d71f8e6edeab312d2147bbdbaeb1) Change-Id: I73fe9344ec5660e58425d5c85d14381820533d57 --- keystore/java/android/security/KeyStore.java | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'keystore/java') diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index 7e3193d..caa4fec 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -581,6 +581,44 @@ public class KeyStore { } } + /** + * Notify keystore that a user was added. + * + * @param userId the new user. + * @param parentId the parent of the new user, or -1 if the user has no parent. If parentId is + * specified then the new user's keystore will be intialized with the same secure lockscreen + * password as the parent. + */ + public void onUserAdded(int userId, int parentId) { + try { + mBinder.onUserAdded(userId, parentId); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + } + } + + /** + * Notify keystore that a user was added. + * + * @param userId the new user. + */ + public void onUserAdded(int userId) { + onUserAdded(userId, -1); + } + + /** + * Notify keystore that a user was removed. + * + * @param userId the removed user. + */ + public void onUserRemoved(int userId) { + try { + mBinder.onUserRemoved(userId); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + } + } + public boolean onUserPasswordChanged(String newPassword) { return onUserPasswordChanged(UserHandle.getUserId(Process.myUid()), newPassword); } -- cgit v1.1