blob: 63641e538b8e45c77140c40781313e4d83730e67 [file] [log] [blame]
Amith Yamasani258848d2012-08-10 17:06:33 -07001/*
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
18package android.os;
19
Amith Yamasanie4cf7342012-12-17 11:12:09 -080020import android.os.Bundle;
Amith Yamasani12747872015-12-07 14:19:49 -080021import android.os.PersistableBundle;
Pavel Grafov6a40f092016-10-25 15:46:51 +010022import android.os.UserManager;
Amith Yamasani258848d2012-08-10 17:06:33 -070023import android.content.pm.UserInfo;
Benjamin Franzf02420c2016-04-04 18:52:21 +010024import android.content.IntentSender;
Amith Yamasanidf2e92a2013-03-01 17:04:38 -080025import android.content.RestrictionEntry;
Amith Yamasanie928d7d2012-09-17 21:46:51 -070026import android.graphics.Bitmap;
Adrian Roos1bdff912015-02-17 15:51:35 +010027import android.os.ParcelFileDescriptor;
Amith Yamasani258848d2012-08-10 17:06:33 -070028
29/**
30 * {@hide}
31 */
32interface IUserManager {
Andres Moralesc5548c02015-08-05 10:23:12 -070033
34 /*
35 * DO NOT MOVE - UserManager.h depends on the ordering of this function.
36 */
37 int getCredentialOwnerProfile(int userHandle);
Jakub Pawlowski0f1f5b72017-11-15 14:50:43 -080038 int getProfileParentId(int userHandle);
39 /*
40 * END OF DO NOT MOVE
41 */
Andres Moralesc5548c02015-08-05 10:23:12 -070042
Amith Yamasani258848d2012-08-10 17:06:33 -070043 UserInfo createUser(in String name, int flags);
Sudheer Shanka7cb54a32016-09-16 12:59:05 -070044 UserInfo createProfileForUser(in String name, int flags, int userHandle,
45 in String[] disallowedPackages);
Amith Yamasani12747872015-12-07 14:19:49 -080046 UserInfo createRestrictedProfile(String name, int parentUserHandle);
Alexandra Gherghinadf35d572014-04-09 13:54:39 +010047 void setUserEnabled(int userHandle);
jovanakf24ad492018-05-18 12:15:59 -070048 void setUserAdmin(int userId);
Andrew Scull85a63bc2016-10-24 13:47:47 +010049 void evictCredentialEncryptionKey(int userHandle);
Amith Yamasani258848d2012-08-10 17:06:33 -070050 boolean removeUser(int userHandle);
Nicolas Prevotd37c4a92017-01-23 11:56:00 +000051 boolean removeUserEvenWhenDisallowed(int userHandle);
Amith Yamasani258848d2012-08-10 17:06:33 -070052 void setUserName(int userHandle, String name);
Amith Yamasanie928d7d2012-09-17 21:46:51 -070053 void setUserIcon(int userHandle, in Bitmap icon);
Adrian Roos1bdff912015-02-17 15:51:35 +010054 ParcelFileDescriptor getUserIcon(int userHandle);
Xiaohui Chen70f6c382015-04-28 14:21:43 -070055 UserInfo getPrimaryUser();
Amith Yamasani920ace02012-09-20 22:15:37 -070056 List<UserInfo> getUsers(boolean excludeDying);
Alexandra Gherghina385124d2014-04-03 13:37:39 +010057 List<UserInfo> getProfiles(int userHandle, boolean enabledOnly);
Fyodor Kupolov7f98aa42016-04-07 14:56:25 -070058 int[] getProfileIds(int userId, boolean enabledOnly);
Amith Yamasani12747872015-12-07 14:19:49 -080059 boolean canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne);
Jessica Hummelbe81c802014-04-22 15:49:22 +010060 UserInfo getProfileParent(int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080061 boolean isSameProfileGroup(int userHandle, int otherUserHandle);
Andrei Onea24ec3212019-03-15 17:35:05 +000062 @UnsupportedAppUsage
Amith Yamasani258848d2012-08-10 17:06:33 -070063 UserInfo getUserInfo(int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080064 String getUserAccount(int userHandle);
65 void setUserAccount(int userHandle, String accountName);
Fyodor Kupolovff7233e2015-04-08 11:28:52 -070066 long getUserCreationTime(int userHandle);
Amith Yamasani71e6c692013-03-24 17:39:28 -070067 boolean isRestricted();
Amith Yamasani12747872015-12-07 14:19:49 -080068 boolean canHaveRestrictedProfile(int userHandle);
Amith Yamasani2a003292012-08-14 18:25:45 -070069 int getUserSerialNumber(int userHandle);
70 int getUserHandle(int userSerialNumber);
Zoltan Szatmary-Bane7834602016-04-08 18:41:11 +010071 int getUserRestrictionSource(String restrictionKey, int userHandle);
Pavel Grafov6a40f092016-10-25 15:46:51 +010072 List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userHandle);
Amith Yamasanie4cf7342012-12-17 11:12:09 -080073 Bundle getUserRestrictions(int userHandle);
Zoltan Szatmary-Ban3bbcedd2015-11-26 13:45:51 +000074 boolean hasBaseUserRestriction(String restrictionKey, int userHandle);
Amith Yamasani8cd28b52014-06-08 17:54:27 -070075 boolean hasUserRestriction(in String restrictionKey, int userHandle);
Makoto Onukiacc50462018-02-14 14:13:49 -080076 boolean hasUserRestrictionOnAnyUser(in String restrictionKey);
Amith Yamasani12747872015-12-07 14:19:49 -080077 void setUserRestriction(String key, boolean value, int userHandle);
Amith Yamasani7e99bc02013-04-16 18:24:51 -070078 void setApplicationRestrictions(in String packageName, in Bundle restrictions,
Amith Yamasanidf2e92a2013-03-01 17:04:38 -080079 int userHandle);
Amith Yamasani7e99bc02013-04-16 18:24:51 -070080 Bundle getApplicationRestrictions(in String packageName);
81 Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle);
Amith Yamasanie4afaa32014-06-30 14:55:07 +053082 void setDefaultGuestRestrictions(in Bundle restrictions);
83 Bundle getDefaultGuestRestrictions();
Amith Yamasani1df14732014-08-29 21:37:27 -070084 boolean markGuestForDeletion(int userHandle);
Rubin Xu0a29ecd2015-11-04 15:11:48 +000085 boolean isQuietModeEnabled(int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080086 void setSeedAccountData(int userHandle, in String accountName,
87 in String accountType, in PersistableBundle accountOptions, boolean persist);
88 String getSeedAccountName();
89 String getSeedAccountType();
90 PersistableBundle getSeedAccountOptions();
91 void clearSeedAccountData();
92 boolean someUserHasSeedAccount(in String accountName, in String accountType);
Tony Mak8673b282016-03-21 21:10:59 +000093 boolean isManagedProfile(int userId);
Amith Yamasani1c41dc82016-06-28 16:13:15 -070094 boolean isDemoUser(int userId);
Tony Mak6dc428f2016-10-10 15:48:27 +010095 UserInfo createProfileForUserEvenWhenDisallowed(in String name, int flags, int userHandle,
96 in String[] disallowedPackages);
Fyodor Kupolovc413f702016-10-06 17:11:14 -070097 boolean isUserUnlockingOrUnlocked(int userId);
Kenny Guy02c89902016-11-15 19:36:38 +000098 int getManagedProfileBadge(int userId);
Fyodor Kupolov2e7e0962016-12-01 18:09:17 -080099 boolean isUserUnlocked(int userId);
100 boolean isUserRunning(int userId);
Fyodor Kupolov605b12a2017-05-10 15:58:09 -0700101 boolean isUserNameSet(int userHandle);
Fyodor Kupolovca177562017-11-09 17:43:01 -0800102 boolean hasRestrictedProfiles();
Tony Makbece85d2018-01-12 12:10:17 +0000103 boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userHandle, in IntentSender target);
Bookatzcde3d922019-03-08 14:30:00 -0800104 String getUserName();
Makoto Onuki73dded22017-12-20 13:14:48 +0900105 long getUserStartRealtime();
106 long getUserUnlockRealtime();
Amith Yamasani258848d2012-08-10 17:06:33 -0700107}