diff options
| author | sailendrabathi <sailendrabathi@google.com> | 2022-01-18 05:55:41 +0000 |
|---|---|---|
| committer | sailendrabathi <sailendrabathi@google.com> | 2022-02-02 06:27:02 +0000 |
| commit | 7a799535e1faa1452dd3c45980e417d55029e7fe (patch) | |
| tree | eedc1009d123bef29155abf5ddcad061a97142bb /core/java/android/os/UserManager.java | |
| parent | 00e99e742a9d9aedf4012924977d0e9fcafe674f (diff) | |
Use isCredentialSharedWithParent in LockSettingsService
Created property isCredentialSharedWithParent in UserTypeDetails which
is true for managed and clone profiles. This is used in
LockSettingsService for sharing the locking credentials with its parent
user.
Bug: 214355283
Test: atest android.multiuser.cts.UserManagerTest
Test: atest LockSettingsServiceTests
Change-Id: I6ceaf498aadce7e713b20a4d24e4a29e812eb0ca
Diffstat (limited to 'core/java/android/os/UserManager.java')
| -rw-r--r-- | core/java/android/os/UserManager.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 7b8d34b3b570..70995ffaaa57 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -4763,6 +4763,28 @@ public class UserManager { } /** + * Returns {@code true} if the user shares lock settings credential with its parent user + * + * This API only works for {@link UserManager#isProfile() profiles} + * and will always return false for any other user type. + * + * @hide + */ + @SystemApi + @UserHandleAware( + requiresAnyOfPermissionsIfNotCallerProfileGroup = { + Manifest.permission.MANAGE_USERS, + Manifest.permission.INTERACT_ACROSS_USERS}) + @SuppressAutoDoc + public boolean isCredentialSharedWithParent() { + try { + return mService.isCredentialSharedWithParent(mUserId); + } catch (RemoteException re) { + throw re.rethrowFromSystemServer(); + } + } + + /** * Removes a user and all associated data. * @param userId the integer handle of the user. * @hide |
