blob: f643c578ebe7b002ff23b7ad516102cfb2177006 [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);
Andrew Scull85a63bc2016-10-24 13:47:47 +010048 void evictCredentialEncryptionKey(int userHandle);
Amith Yamasani258848d2012-08-10 17:06:33 -070049 boolean removeUser(int userHandle);
Nicolas Prevotd37c4a92017-01-23 11:56:00 +000050 boolean removeUserEvenWhenDisallowed(int userHandle);
Amith Yamasani258848d2012-08-10 17:06:33 -070051 void setUserName(int userHandle, String name);
Amith Yamasanie928d7d2012-09-17 21:46:51 -070052 void setUserIcon(int userHandle, in Bitmap icon);
Adrian Roos1bdff912015-02-17 15:51:35 +010053 ParcelFileDescriptor getUserIcon(int userHandle);
Xiaohui Chen70f6c382015-04-28 14:21:43 -070054 UserInfo getPrimaryUser();
Amith Yamasani920ace02012-09-20 22:15:37 -070055 List<UserInfo> getUsers(boolean excludeDying);
Alexandra Gherghina385124d2014-04-03 13:37:39 +010056 List<UserInfo> getProfiles(int userHandle, boolean enabledOnly);
Fyodor Kupolov7f98aa42016-04-07 14:56:25 -070057 int[] getProfileIds(int userId, boolean enabledOnly);
Amith Yamasani12747872015-12-07 14:19:49 -080058 boolean canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne);
Jessica Hummelbe81c802014-04-22 15:49:22 +010059 UserInfo getProfileParent(int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080060 boolean isSameProfileGroup(int userHandle, int otherUserHandle);
Amith Yamasani258848d2012-08-10 17:06:33 -070061 UserInfo getUserInfo(int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080062 String getUserAccount(int userHandle);
63 void setUserAccount(int userHandle, String accountName);
Fyodor Kupolovff7233e2015-04-08 11:28:52 -070064 long getUserCreationTime(int userHandle);
Amith Yamasani71e6c692013-03-24 17:39:28 -070065 boolean isRestricted();
Amith Yamasani12747872015-12-07 14:19:49 -080066 boolean canHaveRestrictedProfile(int userHandle);
Amith Yamasani2a003292012-08-14 18:25:45 -070067 int getUserSerialNumber(int userHandle);
68 int getUserHandle(int userSerialNumber);
Zoltan Szatmary-Bane7834602016-04-08 18:41:11 +010069 int getUserRestrictionSource(String restrictionKey, int userHandle);
Pavel Grafov6a40f092016-10-25 15:46:51 +010070 List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userHandle);
Amith Yamasanie4cf7342012-12-17 11:12:09 -080071 Bundle getUserRestrictions(int userHandle);
Zoltan Szatmary-Ban3bbcedd2015-11-26 13:45:51 +000072 boolean hasBaseUserRestriction(String restrictionKey, int userHandle);
Amith Yamasani8cd28b52014-06-08 17:54:27 -070073 boolean hasUserRestriction(in String restrictionKey, int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080074 void setUserRestriction(String key, boolean value, int userHandle);
Amith Yamasani7e99bc02013-04-16 18:24:51 -070075 void setApplicationRestrictions(in String packageName, in Bundle restrictions,
Amith Yamasanidf2e92a2013-03-01 17:04:38 -080076 int userHandle);
Amith Yamasani7e99bc02013-04-16 18:24:51 -070077 Bundle getApplicationRestrictions(in String packageName);
78 Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle);
Amith Yamasanie4afaa32014-06-30 14:55:07 +053079 void setDefaultGuestRestrictions(in Bundle restrictions);
80 Bundle getDefaultGuestRestrictions();
Amith Yamasani1df14732014-08-29 21:37:27 -070081 boolean markGuestForDeletion(int userHandle);
Rubin Xu0a29ecd2015-11-04 15:11:48 +000082 boolean isQuietModeEnabled(int userHandle);
Amith Yamasani12747872015-12-07 14:19:49 -080083 void setSeedAccountData(int userHandle, in String accountName,
84 in String accountType, in PersistableBundle accountOptions, boolean persist);
85 String getSeedAccountName();
86 String getSeedAccountType();
87 PersistableBundle getSeedAccountOptions();
88 void clearSeedAccountData();
89 boolean someUserHasSeedAccount(in String accountName, in String accountType);
Tony Mak8673b282016-03-21 21:10:59 +000090 boolean isManagedProfile(int userId);
Amith Yamasani1c41dc82016-06-28 16:13:15 -070091 boolean isDemoUser(int userId);
Tony Mak6dc428f2016-10-10 15:48:27 +010092 UserInfo createProfileForUserEvenWhenDisallowed(in String name, int flags, int userHandle,
93 in String[] disallowedPackages);
Fyodor Kupolovc413f702016-10-06 17:11:14 -070094 boolean isUserUnlockingOrUnlocked(int userId);
Kenny Guy02c89902016-11-15 19:36:38 +000095 int getManagedProfileBadge(int userId);
Fyodor Kupolov2e7e0962016-12-01 18:09:17 -080096 boolean isUserUnlocked(int userId);
97 boolean isUserRunning(int userId);
Fyodor Kupolov605b12a2017-05-10 15:58:09 -070098 boolean isUserNameSet(int userHandle);
Fyodor Kupolovca177562017-11-09 17:43:01 -080099 boolean hasRestrictedProfiles();
Tony Make3d1f652017-12-12 11:00:37 +0000100 boolean trySetQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userHandle, in IntentSender target);
Amith Yamasani258848d2012-08-10 17:06:33 -0700101}