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
18package android.os;
19
20import android.os.Bundle;
21import android.os.PersistableBundle;
22import android.os.UserManager;
23import android.content.pm.UserInfo;
24import android.content.IntentSender;
25import android.content.RestrictionEntry;
26import android.graphics.Bitmap;
27import android.os.ParcelFileDescriptor;
28
29/**
30 *  {@hide}
31 */
32interface IUserManager {
33
34    /*
35     * DO NOT MOVE - UserManager.h depends on the ordering of this function.
36     */
37    int getCredentialOwnerProfile(int userHandle);
38    int getProfileParentId(int userHandle);
39    /*
40     * END OF DO NOT MOVE
41     */
42
43    UserInfo createUser(in String name, int flags);
44    UserInfo createProfileForUser(in String name, int flags, int userHandle,
45            in String[] disallowedPackages);
46    UserInfo createRestrictedProfile(String name, int parentUserHandle);
47    void setUserEnabled(int userHandle);
48    void setUserAdmin(int userId);
49    void evictCredentialEncryptionKey(int userHandle);
50    boolean removeUser(int userHandle);
51    boolean removeUserEvenWhenDisallowed(int userHandle);
52    void setUserName(int userHandle, String name);
53    void setUserIcon(int userHandle, in Bitmap icon);
54    ParcelFileDescriptor getUserIcon(int userHandle);
55    UserInfo getPrimaryUser();
56    List<UserInfo> getUsers(boolean excludeDying);
57    List<UserInfo> getProfiles(int userHandle, boolean enabledOnly);
58    int[] getProfileIds(int userId, boolean enabledOnly);
59    boolean canAddMoreManagedProfiles(int userHandle, boolean allowedToRemoveOne);
60    UserInfo getProfileParent(int userHandle);
61    boolean isSameProfileGroup(int userHandle, int otherUserHandle);
62    UserInfo getUserInfo(int userHandle);
63    String getUserAccount(int userHandle);
64    void setUserAccount(int userHandle, String accountName);
65    long getUserCreationTime(int userHandle);
66    boolean isRestricted();
67    boolean canHaveRestrictedProfile(int userHandle);
68    int getUserSerialNumber(int userHandle);
69    int getUserHandle(int userSerialNumber);
70    int getUserRestrictionSource(String restrictionKey, int userHandle);
71    List<UserManager.EnforcingUser> getUserRestrictionSources(String restrictionKey, int userHandle);
72    Bundle getUserRestrictions(int userHandle);
73    boolean hasBaseUserRestriction(String restrictionKey, int userHandle);
74    boolean hasUserRestriction(in String restrictionKey, int userHandle);
75    boolean hasUserRestrictionOnAnyUser(in String restrictionKey);
76    void setUserRestriction(String key, boolean value, int userHandle);
77    void setApplicationRestrictions(in String packageName, in Bundle restrictions,
78            int userHandle);
79    Bundle getApplicationRestrictions(in String packageName);
80    Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle);
81    void setDefaultGuestRestrictions(in Bundle restrictions);
82    Bundle getDefaultGuestRestrictions();
83    boolean markGuestForDeletion(int userHandle);
84    boolean isQuietModeEnabled(int userHandle);
85    void setSeedAccountData(int userHandle, in String accountName,
86            in String accountType, in PersistableBundle accountOptions, boolean persist);
87    String getSeedAccountName();
88    String getSeedAccountType();
89    PersistableBundle getSeedAccountOptions();
90    void clearSeedAccountData();
91    boolean someUserHasSeedAccount(in String accountName, in String accountType);
92    boolean isManagedProfile(int userId);
93    boolean isDemoUser(int userId);
94    UserInfo createProfileForUserEvenWhenDisallowed(in String name, int flags, int userHandle,
95            in String[] disallowedPackages);
96    boolean isUserUnlockingOrUnlocked(int userId);
97    int getManagedProfileBadge(int userId);
98    boolean isUserUnlocked(int userId);
99    boolean isUserRunning(int userId);
100    boolean isUserNameSet(int userHandle);
101    boolean hasRestrictedProfiles();
102    boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userHandle, in IntentSender target);
103    long getUserStartRealtime();
104    long getUserUnlockRealtime();
105}
106