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; |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 21 | import android.os.PersistableBundle; |
Pavel Grafov | 6a40f09 | 2016-10-25 15:46:51 +0100 | [diff] [blame] | 22 | import android.os.UserManager; |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 23 | import android.content.pm.UserInfo; |
Benjamin Franz | f02420c | 2016-04-04 18:52:21 +0100 | [diff] [blame] | 24 | import android.content.IntentSender; |
Amith Yamasani | df2e92a | 2013-03-01 17:04:38 -0800 | [diff] [blame] | 25 | import android.content.RestrictionEntry; |
Amith Yamasani | e928d7d | 2012-09-17 21:46:51 -0700 | [diff] [blame] | 26 | import android.graphics.Bitmap; |
Adrian Roos | 1bdff91 | 2015-02-17 15:51:35 +0100 | [diff] [blame] | 27 | import android.os.ParcelFileDescriptor; |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * {@hide} |
| 31 | */ |
| 32 | interface IUserManager { |
Andres Morales | c5548c0 | 2015-08-05 10:23:12 -0700 | [diff] [blame] | 33 | |
| 34 | /* |
| 35 | * DO NOT MOVE - UserManager.h depends on the ordering of this function. |
| 36 | */ |
| 37 | int getCredentialOwnerProfile(int userHandle); |
Jakub Pawlowski | 0f1f5b7 | 2017-11-15 14:50:43 -0800 | [diff] [blame] | 38 | int getProfileParentId(int userHandle); |
| 39 | /* |
| 40 | * END OF DO NOT MOVE |
| 41 | */ |
Andres Morales | c5548c0 | 2015-08-05 10:23:12 -0700 | [diff] [blame] | 42 | |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 43 | UserInfo createUser(in String name, int flags); |
Sudheer Shanka | 7cb54a3 | 2016-09-16 12:59:05 -0700 | [diff] [blame] | 44 | UserInfo createProfileForUser(in String name, int flags, int userHandle, |
| 45 | in String[] disallowedPackages); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 46 | UserInfo createRestrictedProfile(String name, int parentUserHandle); |
Alexandra Gherghina | df35d57 | 2014-04-09 13:54:39 +0100 | [diff] [blame] | 47 | void setUserEnabled(int userHandle); |
jovanak | f24ad49 | 2018-05-18 12:15:59 -0700 | [diff] [blame] | 48 | void setUserAdmin(int userId); |
Andrew Scull | 85a63bc | 2016-10-24 13:47:47 +0100 | [diff] [blame] | 49 | void evictCredentialEncryptionKey(int userHandle); |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 50 | boolean removeUser(int userHandle); |
Nicolas Prevot | d37c4a9 | 2017-01-23 11:56:00 +0000 | [diff] [blame] | 51 | boolean removeUserEvenWhenDisallowed(int userHandle); |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 52 | void setUserName(int userHandle, String name); |
Amith Yamasani | e928d7d | 2012-09-17 21:46:51 -0700 | [diff] [blame] | 53 | void setUserIcon(int userHandle, in Bitmap icon); |
Adrian Roos | 1bdff91 | 2015-02-17 15:51:35 +0100 | [diff] [blame] | 54 | ParcelFileDescriptor getUserIcon(int userHandle); |
Xiaohui Chen | 70f6c38 | 2015-04-28 14:21:43 -0700 | [diff] [blame] | 55 | UserInfo getPrimaryUser(); |
Amith Yamasani | 920ace0 | 2012-09-20 22:15:37 -0700 | [diff] [blame] | 56 | List<UserInfo> getUsers(boolean excludeDying); |
Alexandra Gherghina | 385124d | 2014-04-03 13:37:39 +0100 | [diff] [blame] | 57 | List<UserInfo> getProfiles(int userHandle, boolean enabledOnly); |
Fyodor Kupolov | 7f98aa4 | 2016-04-07 14:56:25 -0700 | [diff] [blame] | 58 | int[] getProfileIds(int userId, boolean enabledOnly); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 59 | boolean canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne); |
Jessica Hummel | be81c80 | 2014-04-22 15:49:22 +0100 | [diff] [blame] | 60 | UserInfo getProfileParent(int userHandle); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 61 | boolean isSameProfileGroup(int userHandle, int otherUserHandle); |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 62 | UserInfo getUserInfo(int userHandle); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 63 | String getUserAccount(int userHandle); |
| 64 | void setUserAccount(int userHandle, String accountName); |
Fyodor Kupolov | ff7233e | 2015-04-08 11:28:52 -0700 | [diff] [blame] | 65 | long getUserCreationTime(int userHandle); |
Amith Yamasani | 71e6c69 | 2013-03-24 17:39:28 -0700 | [diff] [blame] | 66 | boolean isRestricted(); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 67 | boolean canHaveRestrictedProfile(int userHandle); |
Amith Yamasani | 2a00329 | 2012-08-14 18:25:45 -0700 | [diff] [blame] | 68 | int getUserSerialNumber(int userHandle); |
| 69 | int getUserHandle(int userSerialNumber); |
Zoltan Szatmary-Ban | e783460 | 2016-04-08 18:41:11 +0100 | [diff] [blame] | 70 | int getUserRestrictionSource(String restrictionKey, int userHandle); |
Pavel Grafov | 6a40f09 | 2016-10-25 15:46:51 +0100 | [diff] [blame] | 71 | List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userHandle); |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 72 | Bundle getUserRestrictions(int userHandle); |
Zoltan Szatmary-Ban | 3bbcedd | 2015-11-26 13:45:51 +0000 | [diff] [blame] | 73 | boolean hasBaseUserRestriction(String restrictionKey, int userHandle); |
Amith Yamasani | 8cd28b5 | 2014-06-08 17:54:27 -0700 | [diff] [blame] | 74 | boolean hasUserRestriction(in String restrictionKey, int userHandle); |
Makoto Onuki | acc5046 | 2018-02-14 14:13:49 -0800 | [diff] [blame] | 75 | boolean hasUserRestrictionOnAnyUser(in String restrictionKey); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 76 | void setUserRestriction(String key, boolean value, int userHandle); |
Amith Yamasani | 7e99bc0 | 2013-04-16 18:24:51 -0700 | [diff] [blame] | 77 | void setApplicationRestrictions(in String packageName, in Bundle restrictions, |
Amith Yamasani | df2e92a | 2013-03-01 17:04:38 -0800 | [diff] [blame] | 78 | int userHandle); |
Amith Yamasani | 7e99bc0 | 2013-04-16 18:24:51 -0700 | [diff] [blame] | 79 | Bundle getApplicationRestrictions(in String packageName); |
| 80 | Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle); |
Amith Yamasani | e4afaa3 | 2014-06-30 14:55:07 +0530 | [diff] [blame] | 81 | void setDefaultGuestRestrictions(in Bundle restrictions); |
| 82 | Bundle getDefaultGuestRestrictions(); |
Amith Yamasani | 1df1473 | 2014-08-29 21:37:27 -0700 | [diff] [blame] | 83 | boolean markGuestForDeletion(int userHandle); |
Rubin Xu | 0a29ecd | 2015-11-04 15:11:48 +0000 | [diff] [blame] | 84 | boolean isQuietModeEnabled(int userHandle); |
Amith Yamasani | 1274787 | 2015-12-07 14:19:49 -0800 | [diff] [blame] | 85 | void setSeedAccountData(int userHandle, in String accountName, |
| 86 | in String accountType, in PersistableBundle accountOptions, boolean persist); |
| 87 | String getSeedAccountName(); |
| 88 | String getSeedAccountType(); |
| 89 | PersistableBundle getSeedAccountOptions(); |
| 90 | void clearSeedAccountData(); |
| 91 | boolean someUserHasSeedAccount(in String accountName, in String accountType); |
Tony Mak | 8673b28 | 2016-03-21 21:10:59 +0000 | [diff] [blame] | 92 | boolean isManagedProfile(int userId); |
Amith Yamasani | 1c41dc8 | 2016-06-28 16:13:15 -0700 | [diff] [blame] | 93 | boolean isDemoUser(int userId); |
Tony Mak | 6dc428f | 2016-10-10 15:48:27 +0100 | [diff] [blame] | 94 | UserInfo createProfileForUserEvenWhenDisallowed(in String name, int flags, int userHandle, |
| 95 | in String[] disallowedPackages); |
Fyodor Kupolov | c413f70 | 2016-10-06 17:11:14 -0700 | [diff] [blame] | 96 | boolean isUserUnlockingOrUnlocked(int userId); |
Kenny Guy | 02c8990 | 2016-11-15 19:36:38 +0000 | [diff] [blame] | 97 | int getManagedProfileBadge(int userId); |
Fyodor Kupolov | 2e7e096 | 2016-12-01 18:09:17 -0800 | [diff] [blame] | 98 | boolean isUserUnlocked(int userId); |
| 99 | boolean isUserRunning(int userId); |
Fyodor Kupolov | 605b12a | 2017-05-10 15:58:09 -0700 | [diff] [blame] | 100 | boolean isUserNameSet(int userHandle); |
Fyodor Kupolov | ca17756 | 2017-11-09 17:43:01 -0800 | [diff] [blame] | 101 | boolean hasRestrictedProfiles(); |
Tony Mak | bece85d | 2018-01-12 12:10:17 +0000 | [diff] [blame] | 102 | boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userHandle, in IntentSender target); |
Makoto Onuki | 73dded2 | 2017-12-20 13:14:48 +0900 | [diff] [blame] | 103 | long getUserStartRealtime(); |
| 104 | long getUserUnlockRealtime(); |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 105 | } |