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); setUserEnabled(int userId)49 void setUserEnabled(int userId); setUserAdmin(int userId)50 void setUserAdmin(int userId); evictCredentialEncryptionKey(int userId)51 void evictCredentialEncryptionKey(int userId); removeUser(int userId)52 boolean removeUser(int userId); removeUserEvenWhenDisallowed(int userId)53 boolean removeUserEvenWhenDisallowed(int userId); setUserName(int userId, String name)54 void setUserName(int userId, String name); setUserIcon(int userId, in Bitmap icon)55 void setUserIcon(int userId, in Bitmap icon); getUserIcon(int userId)56 ParcelFileDescriptor getUserIcon(int userId); getPrimaryUser()57 UserInfo getPrimaryUser(); getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated)58 List<UserInfo> getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated); getProfiles(int userId, boolean enabledOnly)59 List<UserInfo> getProfiles(int userId, boolean enabledOnly); getProfileIds(int userId, boolean enabledOnly)60 int[] getProfileIds(int userId, boolean enabledOnly); canAddMoreProfilesToUser(in String userType, int userId, boolean allowedToRemoveOne)61 boolean canAddMoreProfilesToUser(in String userType, int userId, boolean allowedToRemoveOne); canAddMoreManagedProfiles(int userId, boolean allowedToRemoveOne)62 boolean canAddMoreManagedProfiles(int userId, boolean allowedToRemoveOne); getProfileParent(int userId)63 UserInfo getProfileParent(int userId); isSameProfileGroup(int userId, int otherUserHandle)64 boolean isSameProfileGroup(int userId, int otherUserHandle); isUserOfType(int userId, in String userType)65 boolean isUserOfType(int userId, in String userType); 66 @UnsupportedAppUsage getUserInfo(int userId)67 UserInfo getUserInfo(int userId); getUserAccount(int userId)68 String getUserAccount(int userId); setUserAccount(int userId, String accountName)69 void setUserAccount(int userId, String accountName); getUserCreationTime(int userId)70 long getUserCreationTime(int userId); isRestricted()71 boolean isRestricted(); canHaveRestrictedProfile(int userId)72 boolean canHaveRestrictedProfile(int userId); getUserSerialNumber(int userId)73 int getUserSerialNumber(int userId); getUserHandle(int userSerialNumber)74 int getUserHandle(int userSerialNumber); getUserRestrictionSource(String restrictionKey, int userId)75 int getUserRestrictionSource(String restrictionKey, int userId); getUserRestrictionSources(String restrictionKey, int userId)76 List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userId); getUserRestrictions(int userId)77 Bundle getUserRestrictions(int userId); hasBaseUserRestriction(String restrictionKey, int userId)78 boolean hasBaseUserRestriction(String restrictionKey, int userId); hasUserRestriction(in String restrictionKey, int userId)79 boolean hasUserRestriction(in String restrictionKey, int userId); hasUserRestrictionOnAnyUser(in String restrictionKey)80 boolean hasUserRestrictionOnAnyUser(in String restrictionKey); isSettingRestrictedForUser(in String setting, int userId, in String value, int callingUid)81 boolean isSettingRestrictedForUser(in String setting, int userId, in String value, int callingUid); addUserRestrictionsListener(IUserRestrictionsListener listener)82 void addUserRestrictionsListener(IUserRestrictionsListener listener); setUserRestriction(String key, boolean value, int userId)83 void setUserRestriction(String key, boolean value, int userId); setApplicationRestrictions(in String packageName, in Bundle restrictions, int userId)84 void setApplicationRestrictions(in String packageName, in Bundle restrictions, int userId); getApplicationRestrictions(in String packageName)85 Bundle getApplicationRestrictions(in String packageName); getApplicationRestrictionsForUser(in String packageName, int userId)86 Bundle getApplicationRestrictionsForUser(in String packageName, int userId); setDefaultGuestRestrictions(in Bundle restrictions)87 void setDefaultGuestRestrictions(in Bundle restrictions); getDefaultGuestRestrictions()88 Bundle getDefaultGuestRestrictions(); markGuestForDeletion(int userId)89 boolean markGuestForDeletion(int userId); findCurrentGuestUser()90 UserInfo findCurrentGuestUser(); isQuietModeEnabled(int userId)91 boolean isQuietModeEnabled(int userId); setSeedAccountData(int userId, in String accountName, in String accountType, in PersistableBundle accountOptions, boolean persist)92 void setSeedAccountData(int userId, in String accountName, 93 in String accountType, in PersistableBundle accountOptions, boolean persist); getSeedAccountName()94 String getSeedAccountName(); getSeedAccountType()95 String getSeedAccountType(); getSeedAccountOptions()96 PersistableBundle getSeedAccountOptions(); clearSeedAccountData()97 void clearSeedAccountData(); someUserHasSeedAccount(in String accountName, in String accountType)98 boolean someUserHasSeedAccount(in String accountName, in String accountType); isProfile(int userId)99 boolean isProfile(int userId); isManagedProfile(int userId)100 boolean isManagedProfile(int userId); isDemoUser(int userId)101 boolean isDemoUser(int userId); isPreCreated(int userId)102 boolean isPreCreated(int userId); createProfileForUserEvenWhenDisallowedWithThrow(in String name, in String userType, int flags, int userId, in String[] disallowedPackages)103 UserInfo createProfileForUserEvenWhenDisallowedWithThrow(in String name, in String userType, int flags, 104 int userId, in String[] disallowedPackages); isUserUnlockingOrUnlocked(int userId)105 boolean isUserUnlockingOrUnlocked(int userId); getUserIconBadgeResId(int userId)106 int getUserIconBadgeResId(int userId); getUserBadgeResId(int userId)107 int getUserBadgeResId(int userId); getUserBadgeNoBackgroundResId(int userId)108 int getUserBadgeNoBackgroundResId(int userId); getUserBadgeLabelResId(int userId)109 int getUserBadgeLabelResId(int userId); getUserBadgeColorResId(int userId)110 int getUserBadgeColorResId(int userId); getUserBadgeDarkColorResId(int userId)111 int getUserBadgeDarkColorResId(int userId); hasBadge(int userId)112 boolean hasBadge(int userId); isUserUnlocked(int userId)113 boolean isUserUnlocked(int userId); isUserRunning(int userId)114 boolean isUserRunning(int userId); isUserNameSet(int userId)115 boolean isUserNameSet(int userId); hasRestrictedProfiles()116 boolean hasRestrictedProfiles(); requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userId, in IntentSender target, int flags)117 boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userId, in IntentSender target, int flags); getUserName()118 String getUserName(); getUserStartRealtime()119 long getUserStartRealtime(); getUserUnlockRealtime()120 long getUserUnlockRealtime(); 121 } 122