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.PersistableBundle; 22 import android.content.pm.UserInfo; 23 import android.content.IntentSender; 24 import android.content.RestrictionEntry; 25 import android.graphics.Bitmap; 26 import android.os.ParcelFileDescriptor; 27 28 /** 29 * {@hide} 30 */ 31 interface IUserManager { 32 33 /* 34 * DO NOT MOVE - UserManager.h depends on the ordering of this function. 35 */ 36 int getCredentialOwnerProfile(int userHandle); 37 38 UserInfo createUser(in String name, int flags); 39 UserInfo createProfileForUser(in String name, int flags, int userHandle); 40 UserInfo createRestrictedProfile(String name, int parentUserHandle); 41 void setUserEnabled(int userHandle); 42 boolean removeUser(int userHandle); 43 void setUserName(int userHandle, String name); 44 void setUserIcon(int userHandle, in Bitmap icon); 45 ParcelFileDescriptor getUserIcon(int userHandle); 46 UserInfo getPrimaryUser(); 47 List<UserInfo> getUsers(boolean excludeDying); 48 List<UserInfo> getProfiles(int userHandle, boolean enabledOnly); 49 int[] getProfileIds(int userId, boolean enabledOnly); 50 boolean canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne); 51 UserInfo getProfileParent(int userHandle); 52 boolean isSameProfileGroup(int userHandle, int otherUserHandle); 53 UserInfo getUserInfo(int userHandle); 54 String getUserAccount(int userHandle); 55 void setUserAccount(int userHandle, String accountName); 56 long getUserCreationTime(int userHandle); 57 boolean isRestricted(); 58 boolean canHaveRestrictedProfile(int userHandle); 59 int getUserSerialNumber(int userHandle); 60 int getUserHandle(int userSerialNumber); 61 int getUserRestrictionSource(String restrictionKey, int userHandle); 62 Bundle getUserRestrictions(int userHandle); 63 boolean hasBaseUserRestriction(String restrictionKey, int userHandle); 64 boolean hasUserRestriction(in String restrictionKey, int userHandle); 65 void setUserRestriction(String key, boolean value, int userHandle); 66 void setApplicationRestrictions(in String packageName, in Bundle restrictions, 67 int userHandle); 68 Bundle getApplicationRestrictions(in String packageName); 69 Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle); 70 void setDefaultGuestRestrictions(in Bundle restrictions); 71 Bundle getDefaultGuestRestrictions(); 72 boolean markGuestForDeletion(int userHandle); 73 void setQuietModeEnabled(int userHandle, boolean enableQuietMode); 74 boolean isQuietModeEnabled(int userHandle); 75 boolean trySetQuietModeDisabled(int userHandle, in IntentSender target); 76 void setSeedAccountData(int userHandle, in String accountName, 77 in String accountType, in PersistableBundle accountOptions, boolean persist); 78 String getSeedAccountName(); 79 String getSeedAccountType(); 80 PersistableBundle getSeedAccountOptions(); 81 void clearSeedAccountData(); 82 boolean someUserHasSeedAccount(in String accountName, in String accountType); 83 boolean isManagedProfile(int userId); 84 boolean isDemoUser(int userId); 85 } 86