Expose isUserKeyUnlocked as a TestAPI

This is needed to replace usage of the adb shell
command 'dumpsys mount' in some cts tests -to identify
if user key is locked- with a more reliable TestAPI

Bug: 173695151
Bug: 180328483
Test: N/A
Change-Id: Iebcc0080195b207f133e8d7186a098f39e137f42
This commit is contained in:
kholoud mohamed
2021-02-15 18:02:13 +00:00
parent e1891e1e03
commit df404a78c3
2 changed files with 2 additions and 0 deletions

View File

@@ -1614,6 +1614,7 @@ package android.os.storage {
public class StorageManager {
method @NonNull public static java.util.UUID convert(@NonNull String);
method @NonNull public static String convert(@NonNull java.util.UUID);
method public static boolean isUserKeyUnlocked(int);
}
public final class StorageVolume implements android.os.Parcelable {

View File

@@ -1536,6 +1536,7 @@ public class StorageManager {
}
/** {@hide} */
@TestApi
public static boolean isUserKeyUnlocked(int userId) {
if (sStorageManager == null) {
sStorageManager = IStorageManager.Stub