Keystore2: Integrate getState method of IKeystoreMaintenance AIDL.

Bug: 176123105
Test: TBD
Change-Id: I8bc6bf219f7c4bb3722c310debcc8a276d14ed98
This commit is contained in:
Hasini Gunasinghe
2021-03-11 21:50:04 +00:00
parent 1bec754c8b
commit e92adf724b
2 changed files with 32 additions and 0 deletions

View File

@@ -121,4 +121,22 @@ public class AndroidKeyStoreMaintenance {
return SYSTEM_ERROR;
}
}
/**
* Queries user state from Keystore 2.0.
*
* @param userId - Android user id of the user.
* @return UserState enum variant as integer if successful or an error
*/
public static int getState(int userId) {
try {
return getService().getState(userId);
} catch (ServiceSpecificException e) {
Log.e(TAG, "getState failed", e);
return e.errorCode;
} catch (Exception e) {
Log.e(TAG, "Can not connect to keystore", e);
return SYSTEM_ERROR;
}
}
}