Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2012, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | package android.os; |
| 19 | |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 20 | import android.os.Bundle; |
Christopher Tate | 65fb2e4 | 2019-10-11 17:00:23 -0700 | [diff] [blame] | 21 | import android.os.IUserRestrictionsListener; |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 22 | import android.os.PersistableBundle; |
Pavel Grafov | 6a40f09 | 2016-10-25 15:46:51 +0100 | [diff] [blame] | 23 | import android.os.UserManager; |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 24 | import android.content.pm.UserInfo; |
Benjamin Franz | f02420c | 2016-04-04 18:52:21 +0100 | [diff] [blame] | 25 | import android.content.IntentSender; |
Amith Yamasani | df2e92a | 2013-03-01 17:04:38 -0800 | [diff] [blame] | 26 | import android.content.RestrictionEntry; |
Amith Yamasani | e928d7d | 2012-09-17 21:46:51 -0700 | [diff] [blame] | 27 | import android.graphics.Bitmap; |
Adrian Roos | 1bdff91 | 2015-02-17 15:51:35 +0100 | [diff] [blame] | 28 | import android.os.ParcelFileDescriptor; |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * {@hide} |
| 32 | */ |
| 33 | interface IUserManager { |
Andres Morales | c5548c0 | 2015-08-05 10:23:12 -0700 | [diff] [blame] | 34 | |
| 35 | /* |
| 36 | * DO NOT MOVE - UserManager.h depends on the ordering of this function. |
| 37 | */ |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 38 | int getCredentialOwnerProfile(int userId); |
| 39 | int getProfileParentId(int userId); |
Jakub Pawlowski | 0f1f5b7 | 2017-11-15 14:50:43 -0800 | [diff] [blame] | 40 | /* |
| 41 | * END OF DO NOT MOVE |
| 42 | */ |
Andres Morales | c5548c0 | 2015-08-05 10:23:12 -0700 | [diff] [blame] | 43 | |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 44 | UserInfo createUser(in String name, in String userType, int flags); |
| 45 | UserInfo preCreateUser(in String userType); |
| 46 | UserInfo createProfileForUser(in String name, in String userType, int flags, int userId, |
Sudheer Shanka | 7cb54a3 | 2016-09-16 12:59:05 -0700 | [diff] [blame] | 47 | in String[] disallowedPackages); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 48 | UserInfo createRestrictedProfile(String name, int parentUserHandle); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 49 | void setUserEnabled(int userId); |
jovanak | f24ad49 | 2018-05-18 12:15:59 -0700 | [diff] [blame] | 50 | void setUserAdmin(int userId); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 51 | void evictCredentialEncryptionKey(int userId); |
| 52 | boolean removeUser(int userId); |
| 53 | boolean removeUserEvenWhenDisallowed(int userId); |
| 54 | void setUserName(int userId, String name); |
| 55 | void setUserIcon(int userId, in Bitmap icon); |
| 56 | ParcelFileDescriptor getUserIcon(int userId); |
Xiaohui Chen | 70f6c38 | 2015-04-28 14:21:43 -0700 | [diff] [blame] | 57 | UserInfo getPrimaryUser(); |
Felipe Leme | 09a7f2d | 2019-10-02 16:27:46 -0700 | [diff] [blame] | 58 | List<UserInfo> getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 59 | List<UserInfo> getProfiles(int userId, boolean enabledOnly); |
Fyodor Kupolov | 7f98aa4 | 2016-04-07 14:56:25 -0700 | [diff] [blame] | 60 | int[] getProfileIds(int userId, boolean enabledOnly); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 61 | boolean canAddMoreProfilesToUser(in String userType, int userId, boolean allowedToRemoveOne); |
| 62 | boolean canAddMoreManagedProfiles(int userId, boolean allowedToRemoveOne); |
| 63 | UserInfo getProfileParent(int userId); |
| 64 | boolean isSameProfileGroup(int userId, int otherUserHandle); |
| 65 | String getUserTypeForUser(int userId); |
Andrei Onea | 24ec321 | 2019-03-15 17:35:05 +0000 | [diff] [blame] | 66 | @UnsupportedAppUsage |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 67 | UserInfo getUserInfo(int userId); |
| 68 | String getUserAccount(int userId); |
| 69 | void setUserAccount(int userId, String accountName); |
| 70 | long getUserCreationTime(int userId); |
Amith Yamasani | 71e6c69 | 2013-03-24 17:39:28 -0700 | [diff] [blame] | 71 | boolean isRestricted(); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 72 | boolean canHaveRestrictedProfile(int userId); |
| 73 | int getUserSerialNumber(int userId); |
Amith Yamasani | 2a00329 | 2012-08-14 18:25:45 -0700 | [diff] [blame] | 74 | int getUserHandle(int userSerialNumber); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 75 | int getUserRestrictionSource(String restrictionKey, int userId); |
| 76 | List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userId); |
| 77 | Bundle getUserRestrictions(int userId); |
| 78 | boolean hasBaseUserRestriction(String restrictionKey, int userId); |
| 79 | boolean hasUserRestriction(in String restrictionKey, int userId); |
Makoto Onuki | acc5046 | 2018-02-14 14:13:49 -0800 | [diff] [blame] | 80 | boolean hasUserRestrictionOnAnyUser(in String restrictionKey); |
Christopher Tate | 65fb2e4 | 2019-10-11 17:00:23 -0700 | [diff] [blame] | 81 | boolean isSettingRestrictedForUser(in String setting, int userId, in String value, int callingUid); |
| 82 | void addUserRestrictionsListener(IUserRestrictionsListener listener); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 83 | void setUserRestriction(String key, boolean value, int userId); |
| 84 | void setApplicationRestrictions(in String packageName, in Bundle restrictions, int userId); |
Amith Yamasani | 7e99bc0 | 2013-04-16 18:24:51 -0700 | [diff] [blame] | 85 | Bundle getApplicationRestrictions(in String packageName); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 86 | Bundle getApplicationRestrictionsForUser(in String packageName, int userId); |
Amith Yamasani | e4afaa3 | 2014-06-30 14:55:07 +0530 | [diff] [blame] | 87 | void setDefaultGuestRestrictions(in Bundle restrictions); |
| 88 | Bundle getDefaultGuestRestrictions(); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 89 | boolean markGuestForDeletion(int userId); |
| 90 | boolean isQuietModeEnabled(int userId); |
| 91 | void setSeedAccountData(int userId, in String accountName, |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 92 | in String accountType, in PersistableBundle accountOptions, boolean persist); |
| 93 | String getSeedAccountName(); |
| 94 | String getSeedAccountType(); |
| 95 | PersistableBundle getSeedAccountOptions(); |
| 96 | void clearSeedAccountData(); |
| 97 | boolean someUserHasSeedAccount(in String accountName, in String accountType); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 98 | boolean isProfile(int userId); |
Tony Mak | 8673b28 | 2016-03-21 21:10:59 +0000 | [diff] [blame] | 99 | boolean isManagedProfile(int userId); |
Amith Yamasani | 1c41dc8 | 2016-06-28 16:13:15 -0700 | [diff] [blame] | 100 | boolean isDemoUser(int userId); |
Felipe Leme | c1ca441 | 2019-09-11 09:23:26 -0700 | [diff] [blame] | 101 | boolean isPreCreated(int userId); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 102 | UserInfo createProfileForUserEvenWhenDisallowed(in String name, in String userType, int flags, |
| 103 | int userId, in String[] disallowedPackages); |
Fyodor Kupolov | c413f70 | 2016-10-06 17:11:14 -0700 | [diff] [blame] | 104 | boolean isUserUnlockingOrUnlocked(int userId); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 105 | int getUserIconBadgeResId(int userId); |
| 106 | int getUserBadgeResId(int userId); |
| 107 | int getUserBadgeNoBackgroundResId(int userId); |
| 108 | int getUserBadgeLabelResId(int userId); |
| 109 | int getUserBadgeColorResId(int userId); |
| 110 | boolean hasBadge(int userId); |
Fyodor Kupolov | 2e7e096 | 2016-12-01 18:09:17 -0800 | [diff] [blame] | 111 | boolean isUserUnlocked(int userId); |
| 112 | boolean isUserRunning(int userId); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 113 | boolean isUserNameSet(int userId); |
Fyodor Kupolov | ca17756 | 2017-11-09 17:43:01 -0800 | [diff] [blame] | 114 | boolean hasRestrictedProfiles(); |
Bookatz | 029832a | 2019-10-04 16:50:22 -0700 | [diff] [blame^] | 115 | boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userId, in IntentSender target); |
Bookatz | cde3d92 | 2019-03-08 14:30:00 -0800 | [diff] [blame] | 116 | String getUserName(); |
Makoto Onuki | 73dded2 | 2017-12-20 13:14:48 +0900 | [diff] [blame] | 117 | long getUserStartRealtime(); |
| 118 | long getUserUnlockRealtime(); |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 119 | } |