• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
20 import android.os.Bundle;
21 import android.os.IUserRestrictionsListener;
22 import android.os.PersistableBundle;
23 import android.os.UserHandle;
24 import android.os.UserManager;
25 import android.content.pm.UserInfo;
26 import android.content.IntentSender;
27 import android.content.RestrictionEntry;
28 import android.graphics.Bitmap;
29 import android.os.ParcelFileDescriptor;
30 
31 /**
32  *  {@hide}
33  */
34 interface IUserManager {
35 
36     /*
37      * DO NOT MOVE - UserManager.h depends on the ordering of this function.
38      */
getCredentialOwnerProfile(int userId)39     int getCredentialOwnerProfile(int userId);
getProfileParentId(int userId)40     int getProfileParentId(int userId);
41     /*
42      * END OF DO NOT MOVE
43      */
44 
createUserWithThrow(in String name, in String userType, int flags)45     UserInfo createUserWithThrow(in String name, in String userType, int flags);
preCreateUserWithThrow(in String userType)46     UserInfo preCreateUserWithThrow(in String userType);
createProfileForUserWithThrow(in String name, in String userType, int flags, int userId, in String[] disallowedPackages)47     UserInfo createProfileForUserWithThrow(in String name, in String userType, int flags, int userId,
48             in String[] disallowedPackages);
createRestrictedProfileWithThrow(String name, int parentUserHandle)49     UserInfo createRestrictedProfileWithThrow(String name, int parentUserHandle);
getPreInstallableSystemPackages(in String userType)50     String[] getPreInstallableSystemPackages(in String userType);
setUserEnabled(int userId)51     void setUserEnabled(int userId);
setUserAdmin(int userId)52     void setUserAdmin(int userId);
evictCredentialEncryptionKey(int userId)53     void evictCredentialEncryptionKey(int userId);
removeUser(int userId)54     boolean removeUser(int userId);
removeUserEvenWhenDisallowed(int userId)55     boolean removeUserEvenWhenDisallowed(int userId);
setUserName(int userId, String name)56     void setUserName(int userId, String name);
setUserIcon(int userId, in Bitmap icon)57     void setUserIcon(int userId, in Bitmap icon);
getUserIcon(int userId)58     ParcelFileDescriptor getUserIcon(int userId);
getPrimaryUser()59     UserInfo getPrimaryUser();
getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated)60     List<UserInfo> getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated);
getProfiles(int userId, boolean enabledOnly)61     List<UserInfo> getProfiles(int userId, boolean enabledOnly);
getProfileIds(int userId, boolean enabledOnly)62     int[] getProfileIds(int userId, boolean enabledOnly);
isUserTypeEnabled(in String userType)63     boolean isUserTypeEnabled(in String userType);
canAddMoreUsersOfType(in String userType)64     boolean canAddMoreUsersOfType(in String userType);
getRemainingCreatableUserCount(in String userType)65     int getRemainingCreatableUserCount(in String userType);
getRemainingCreatableProfileCount(in String userType, int userId)66     int getRemainingCreatableProfileCount(in String userType, int userId);
canAddMoreProfilesToUser(in String userType, int userId, boolean allowedToRemoveOne)67     boolean canAddMoreProfilesToUser(in String userType, int userId, boolean allowedToRemoveOne);
canAddMoreManagedProfiles(int userId, boolean allowedToRemoveOne)68     boolean canAddMoreManagedProfiles(int userId, boolean allowedToRemoveOne);
getProfileParent(int userId)69     UserInfo getProfileParent(int userId);
isSameProfileGroup(int userId, int otherUserHandle)70     boolean isSameProfileGroup(int userId, int otherUserHandle);
isUserOfType(int userId, in String userType)71     boolean isUserOfType(int userId, in String userType);
72     @UnsupportedAppUsage
getUserInfo(int userId)73     UserInfo getUserInfo(int userId);
getUserAccount(int userId)74     String getUserAccount(int userId);
setUserAccount(int userId, String accountName)75     void setUserAccount(int userId, String accountName);
getUserCreationTime(int userId)76     long getUserCreationTime(int userId);
getUserSwitchability(int userId)77     int getUserSwitchability(int userId);
isUserSwitcherEnabled(int mUserId)78     boolean isUserSwitcherEnabled(int mUserId);
isRestricted(int userId)79     boolean isRestricted(int userId);
canHaveRestrictedProfile(int userId)80     boolean canHaveRestrictedProfile(int userId);
getUserSerialNumber(int userId)81     int getUserSerialNumber(int userId);
getUserHandle(int userSerialNumber)82     int getUserHandle(int userSerialNumber);
getUserRestrictionSource(String restrictionKey, int userId)83     int getUserRestrictionSource(String restrictionKey, int userId);
getUserRestrictionSources(String restrictionKey, int userId)84     List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userId);
getUserRestrictions(int userId)85     Bundle getUserRestrictions(int userId);
hasBaseUserRestriction(String restrictionKey, int userId)86     boolean hasBaseUserRestriction(String restrictionKey, int userId);
hasUserRestriction(in String restrictionKey, int userId)87     boolean hasUserRestriction(in String restrictionKey, int userId);
hasUserRestrictionOnAnyUser(in String restrictionKey)88     boolean hasUserRestrictionOnAnyUser(in String restrictionKey);
isSettingRestrictedForUser(in String setting, int userId, in String value, int callingUid)89     boolean isSettingRestrictedForUser(in String setting, int userId, in String value, int callingUid);
addUserRestrictionsListener(IUserRestrictionsListener listener)90     void addUserRestrictionsListener(IUserRestrictionsListener listener);
setUserRestriction(String key, boolean value, int userId)91     void setUserRestriction(String key, boolean value, int userId);
setApplicationRestrictions(in String packageName, in Bundle restrictions, int userId)92     void setApplicationRestrictions(in String packageName, in Bundle restrictions, int userId);
getApplicationRestrictions(in String packageName)93     Bundle getApplicationRestrictions(in String packageName);
getApplicationRestrictionsForUser(in String packageName, int userId)94     Bundle getApplicationRestrictionsForUser(in String packageName, int userId);
setDefaultGuestRestrictions(in Bundle restrictions)95     void setDefaultGuestRestrictions(in Bundle restrictions);
getDefaultGuestRestrictions()96     Bundle getDefaultGuestRestrictions();
removeUserWhenPossible(int userId, boolean overrideDevicePolicy)97     int removeUserWhenPossible(int userId, boolean overrideDevicePolicy);
markGuestForDeletion(int userId)98     boolean markGuestForDeletion(int userId);
findCurrentGuestUser()99     UserInfo findCurrentGuestUser();
isQuietModeEnabled(int userId)100     boolean isQuietModeEnabled(int userId);
createUserWithAttributes(in String userName, in String userType, int flags, in Bitmap userIcon, in String accountName, in String accountType, in PersistableBundle accountOptions)101     UserHandle createUserWithAttributes(in String userName, in String userType, int flags,
102             in Bitmap userIcon,
103             in String accountName, in String accountType, in PersistableBundle accountOptions);
setSeedAccountData(int userId, in String accountName, in String accountType, in PersistableBundle accountOptions, boolean persist)104     void setSeedAccountData(int userId, in String accountName,
105             in String accountType, in PersistableBundle accountOptions, boolean persist);
getSeedAccountName(int userId)106     String getSeedAccountName(int userId);
getSeedAccountType(int userId)107     String getSeedAccountType(int userId);
getSeedAccountOptions(int userId)108     PersistableBundle getSeedAccountOptions(int userId);
clearSeedAccountData(int userId)109     void clearSeedAccountData(int userId);
someUserHasSeedAccount(in String accountName, in String accountType)110     boolean someUserHasSeedAccount(in String accountName, in String accountType);
someUserHasAccount(in String accountName, in String accountType)111     boolean someUserHasAccount(in String accountName, in String accountType);
getProfileType(int userId)112     String getProfileType(int userId);
isMediaSharedWithParent(int userId)113     boolean isMediaSharedWithParent(int userId);
isCredentialSharableWithParent(int userId)114     boolean isCredentialSharableWithParent(int userId);
isDemoUser(int userId)115     boolean isDemoUser(int userId);
isPreCreated(int userId)116     boolean isPreCreated(int userId);
createProfileForUserEvenWhenDisallowedWithThrow(in String name, in String userType, int flags, int userId, in String[] disallowedPackages)117     UserInfo createProfileForUserEvenWhenDisallowedWithThrow(in String name, in String userType, int flags,
118             int userId, in String[] disallowedPackages);
isUserUnlockingOrUnlocked(int userId)119     boolean isUserUnlockingOrUnlocked(int userId);
getUserIconBadgeResId(int userId)120     int getUserIconBadgeResId(int userId);
getUserBadgeResId(int userId)121     int getUserBadgeResId(int userId);
getUserBadgeNoBackgroundResId(int userId)122     int getUserBadgeNoBackgroundResId(int userId);
getUserBadgeLabelResId(int userId)123     int getUserBadgeLabelResId(int userId);
getUserBadgeColorResId(int userId)124     int getUserBadgeColorResId(int userId);
getUserBadgeDarkColorResId(int userId)125     int getUserBadgeDarkColorResId(int userId);
hasBadge(int userId)126     boolean hasBadge(int userId);
isUserUnlocked(int userId)127     boolean isUserUnlocked(int userId);
isUserRunning(int userId)128     boolean isUserRunning(int userId);
isUserForeground(int userId)129     boolean isUserForeground(int userId);
isUserNameSet(int userId)130     boolean isUserNameSet(int userId);
hasRestrictedProfiles(int userId)131     boolean hasRestrictedProfiles(int userId);
requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userId, in IntentSender target, int flags)132     boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userId, in IntentSender target, int flags);
getUserName()133     String getUserName();
getUserStartRealtime()134     long getUserStartRealtime();
getUserUnlockRealtime()135     long getUserUnlockRealtime();
setUserEphemeral(int userId, boolean enableEphemeral)136     boolean setUserEphemeral(int userId, boolean enableEphemeral);
137 }
138