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