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 */ getCredentialOwnerProfile(int userHandle)36 int getCredentialOwnerProfile(int userHandle); 37 createUser(in String name, int flags)38 UserInfo createUser(in String name, int flags); createProfileForUser(in String name, int flags, int userHandle)39 UserInfo createProfileForUser(in String name, int flags, int userHandle); createRestrictedProfile(String name, int parentUserHandle)40 UserInfo createRestrictedProfile(String name, int parentUserHandle); setUserEnabled(int userHandle)41 void setUserEnabled(int userHandle); removeUser(int userHandle)42 boolean removeUser(int userHandle); setUserName(int userHandle, String name)43 void setUserName(int userHandle, String name); setUserIcon(int userHandle, in Bitmap icon)44 void setUserIcon(int userHandle, in Bitmap icon); getUserIcon(int userHandle)45 ParcelFileDescriptor getUserIcon(int userHandle); getPrimaryUser()46 UserInfo getPrimaryUser(); getUsers(boolean excludeDying)47 List<UserInfo> getUsers(boolean excludeDying); getProfiles(int userHandle, boolean enabledOnly)48 List<UserInfo> getProfiles(int userHandle, boolean enabledOnly); getProfileIds(int userId, boolean enabledOnly)49 int[] getProfileIds(int userId, boolean enabledOnly); canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne)50 boolean canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne); getProfileParent(int userHandle)51 UserInfo getProfileParent(int userHandle); isSameProfileGroup(int userHandle, int otherUserHandle)52 boolean isSameProfileGroup(int userHandle, int otherUserHandle); getUserInfo(int userHandle)53 UserInfo getUserInfo(int userHandle); getUserAccount(int userHandle)54 String getUserAccount(int userHandle); setUserAccount(int userHandle, String accountName)55 void setUserAccount(int userHandle, String accountName); getUserCreationTime(int userHandle)56 long getUserCreationTime(int userHandle); isRestricted()57 boolean isRestricted(); canHaveRestrictedProfile(int userHandle)58 boolean canHaveRestrictedProfile(int userHandle); getUserSerialNumber(int userHandle)59 int getUserSerialNumber(int userHandle); getUserHandle(int userSerialNumber)60 int getUserHandle(int userSerialNumber); getUserRestrictionSource(String restrictionKey, int userHandle)61 int getUserRestrictionSource(String restrictionKey, int userHandle); getUserRestrictions(int userHandle)62 Bundle getUserRestrictions(int userHandle); hasBaseUserRestriction(String restrictionKey, int userHandle)63 boolean hasBaseUserRestriction(String restrictionKey, int userHandle); hasUserRestriction(in String restrictionKey, int userHandle)64 boolean hasUserRestriction(in String restrictionKey, int userHandle); setUserRestriction(String key, boolean value, int userHandle)65 void setUserRestriction(String key, boolean value, int userHandle); setApplicationRestrictions(in String packageName, in Bundle restrictions, int userHandle)66 void setApplicationRestrictions(in String packageName, in Bundle restrictions, 67 int userHandle); getApplicationRestrictions(in String packageName)68 Bundle getApplicationRestrictions(in String packageName); getApplicationRestrictionsForUser(in String packageName, int userHandle)69 Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle); setDefaultGuestRestrictions(in Bundle restrictions)70 void setDefaultGuestRestrictions(in Bundle restrictions); getDefaultGuestRestrictions()71 Bundle getDefaultGuestRestrictions(); markGuestForDeletion(int userHandle)72 boolean markGuestForDeletion(int userHandle); setQuietModeEnabled(int userHandle, boolean enableQuietMode)73 void setQuietModeEnabled(int userHandle, boolean enableQuietMode); isQuietModeEnabled(int userHandle)74 boolean isQuietModeEnabled(int userHandle); trySetQuietModeDisabled(int userHandle, in IntentSender target)75 boolean trySetQuietModeDisabled(int userHandle, in IntentSender target); setSeedAccountData(int userHandle, in String accountName, in String accountType, in PersistableBundle accountOptions, boolean persist)76 void setSeedAccountData(int userHandle, in String accountName, 77 in String accountType, in PersistableBundle accountOptions, boolean persist); getSeedAccountName()78 String getSeedAccountName(); getSeedAccountType()79 String getSeedAccountType(); getSeedAccountOptions()80 PersistableBundle getSeedAccountOptions(); clearSeedAccountData()81 void clearSeedAccountData(); someUserHasSeedAccount(in String accountName, in String accountType)82 boolean someUserHasSeedAccount(in String accountName, in String accountType); isManagedProfile(int userId)83 boolean isManagedProfile(int userId); isDemoUser(int userId)84 boolean isDemoUser(int userId); 85 } 86