1 /*
2 **
3 ** Copyright 2010, 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.app.admin;
19 
20 import android.app.admin.NetworkEvent;
21 import android.app.IApplicationThread;
22 import android.app.IServiceConnection;
23 import android.app.admin.StartInstallingUpdateCallback;
24 import android.app.admin.SystemUpdateInfo;
25 import android.app.admin.SystemUpdatePolicy;
26 import android.app.admin.PasswordMetrics;
27 import android.content.ComponentName;
28 import android.content.Intent;
29 import android.content.IntentFilter;
30 import android.content.pm.IPackageDataObserver;
31 import android.content.pm.ParceledListSlice;
32 import android.content.pm.StringParceledListSlice;
33 import android.graphics.Bitmap;
34 import android.net.ProxyInfo;
35 import android.net.Uri;
36 import android.os.Bundle;
37 import android.os.PersistableBundle;
38 import android.os.RemoteCallback;
39 import android.os.UserHandle;
40 import android.security.keymaster.KeymasterCertificateChain;
41 import android.security.keystore.ParcelableKeyGenParameterSpec;
42 import android.telephony.data.ApnSetting;
43 
44 import java.util.List;
45 
46 /**
47  * Internal IPC interface to the device policy service.
48  * {@hide}
49  */
50 interface IDevicePolicyManager {
setPasswordQuality(in ComponentName who, int quality, boolean parent)51     void setPasswordQuality(in ComponentName who, int quality, boolean parent);
getPasswordQuality(in ComponentName who, int userHandle, boolean parent)52     int getPasswordQuality(in ComponentName who, int userHandle, boolean parent);
53 
setPasswordMinimumLength(in ComponentName who, int length, boolean parent)54     void setPasswordMinimumLength(in ComponentName who, int length, boolean parent);
getPasswordMinimumLength(in ComponentName who, int userHandle, boolean parent)55     int getPasswordMinimumLength(in ComponentName who, int userHandle, boolean parent);
56 
setPasswordMinimumUpperCase(in ComponentName who, int length, boolean parent)57     void setPasswordMinimumUpperCase(in ComponentName who, int length, boolean parent);
getPasswordMinimumUpperCase(in ComponentName who, int userHandle, boolean parent)58     int getPasswordMinimumUpperCase(in ComponentName who, int userHandle, boolean parent);
59 
setPasswordMinimumLowerCase(in ComponentName who, int length, boolean parent)60     void setPasswordMinimumLowerCase(in ComponentName who, int length, boolean parent);
getPasswordMinimumLowerCase(in ComponentName who, int userHandle, boolean parent)61     int getPasswordMinimumLowerCase(in ComponentName who, int userHandle, boolean parent);
62 
setPasswordMinimumLetters(in ComponentName who, int length, boolean parent)63     void setPasswordMinimumLetters(in ComponentName who, int length, boolean parent);
getPasswordMinimumLetters(in ComponentName who, int userHandle, boolean parent)64     int getPasswordMinimumLetters(in ComponentName who, int userHandle, boolean parent);
65 
setPasswordMinimumNumeric(in ComponentName who, int length, boolean parent)66     void setPasswordMinimumNumeric(in ComponentName who, int length, boolean parent);
getPasswordMinimumNumeric(in ComponentName who, int userHandle, boolean parent)67     int getPasswordMinimumNumeric(in ComponentName who, int userHandle, boolean parent);
68 
setPasswordMinimumSymbols(in ComponentName who, int length, boolean parent)69     void setPasswordMinimumSymbols(in ComponentName who, int length, boolean parent);
getPasswordMinimumSymbols(in ComponentName who, int userHandle, boolean parent)70     int getPasswordMinimumSymbols(in ComponentName who, int userHandle, boolean parent);
71 
setPasswordMinimumNonLetter(in ComponentName who, int length, boolean parent)72     void setPasswordMinimumNonLetter(in ComponentName who, int length, boolean parent);
getPasswordMinimumNonLetter(in ComponentName who, int userHandle, boolean parent)73     int getPasswordMinimumNonLetter(in ComponentName who, int userHandle, boolean parent);
74 
setPasswordHistoryLength(in ComponentName who, int length, boolean parent)75     void setPasswordHistoryLength(in ComponentName who, int length, boolean parent);
getPasswordHistoryLength(in ComponentName who, int userHandle, boolean parent)76     int getPasswordHistoryLength(in ComponentName who, int userHandle, boolean parent);
77 
setPasswordExpirationTimeout(in ComponentName who, long expiration, boolean parent)78     void setPasswordExpirationTimeout(in ComponentName who, long expiration, boolean parent);
getPasswordExpirationTimeout(in ComponentName who, int userHandle, boolean parent)79     long getPasswordExpirationTimeout(in ComponentName who, int userHandle, boolean parent);
80 
getPasswordExpiration(in ComponentName who, int userHandle, boolean parent)81     long getPasswordExpiration(in ComponentName who, int userHandle, boolean parent);
82 
isActivePasswordSufficient(int userHandle, boolean parent)83     boolean isActivePasswordSufficient(int userHandle, boolean parent);
isProfileActivePasswordSufficientForParent(int userHandle)84     boolean isProfileActivePasswordSufficientForParent(int userHandle);
getPasswordComplexity()85     int getPasswordComplexity();
isUsingUnifiedPassword(in ComponentName admin)86     boolean isUsingUnifiedPassword(in ComponentName admin);
getCurrentFailedPasswordAttempts(int userHandle, boolean parent)87     int getCurrentFailedPasswordAttempts(int userHandle, boolean parent);
getProfileWithMinimumFailedPasswordsForWipe(int userHandle, boolean parent)88     int getProfileWithMinimumFailedPasswordsForWipe(int userHandle, boolean parent);
89 
setMaximumFailedPasswordsForWipe(in ComponentName admin, int num, boolean parent)90     void setMaximumFailedPasswordsForWipe(in ComponentName admin, int num, boolean parent);
getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle, boolean parent)91     int getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle, boolean parent);
92 
resetPassword(String password, int flags)93     boolean resetPassword(String password, int flags);
94 
setMaximumTimeToLock(in ComponentName who, long timeMs, boolean parent)95     void setMaximumTimeToLock(in ComponentName who, long timeMs, boolean parent);
getMaximumTimeToLock(in ComponentName who, int userHandle, boolean parent)96     long getMaximumTimeToLock(in ComponentName who, int userHandle, boolean parent);
97 
setRequiredStrongAuthTimeout(in ComponentName who, long timeMs, boolean parent)98     void setRequiredStrongAuthTimeout(in ComponentName who, long timeMs, boolean parent);
getRequiredStrongAuthTimeout(in ComponentName who, int userId, boolean parent)99     long getRequiredStrongAuthTimeout(in ComponentName who, int userId, boolean parent);
100 
lockNow(int flags, boolean parent)101     void lockNow(int flags, boolean parent);
102 
wipeDataWithReason(int flags, String wipeReasonForUser)103     void wipeDataWithReason(int flags, String wipeReasonForUser);
104 
setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList)105     ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList);
getGlobalProxyAdmin(int userHandle)106     ComponentName getGlobalProxyAdmin(int userHandle);
setRecommendedGlobalProxy(in ComponentName admin, in ProxyInfo proxyInfo)107     void setRecommendedGlobalProxy(in ComponentName admin, in ProxyInfo proxyInfo);
108 
setStorageEncryption(in ComponentName who, boolean encrypt)109     int setStorageEncryption(in ComponentName who, boolean encrypt);
getStorageEncryption(in ComponentName who, int userHandle)110     boolean getStorageEncryption(in ComponentName who, int userHandle);
getStorageEncryptionStatus(in String callerPackage, int userHandle)111     int getStorageEncryptionStatus(in String callerPackage, int userHandle);
112 
requestBugreport(in ComponentName who)113     boolean requestBugreport(in ComponentName who);
114 
setCameraDisabled(in ComponentName who, boolean disabled)115     void setCameraDisabled(in ComponentName who, boolean disabled);
getCameraDisabled(in ComponentName who, int userHandle)116     boolean getCameraDisabled(in ComponentName who, int userHandle);
117 
setScreenCaptureDisabled(in ComponentName who, boolean disabled)118     void setScreenCaptureDisabled(in ComponentName who, boolean disabled);
getScreenCaptureDisabled(in ComponentName who, int userHandle)119     boolean getScreenCaptureDisabled(in ComponentName who, int userHandle);
120 
setKeyguardDisabledFeatures(in ComponentName who, int which, boolean parent)121     void setKeyguardDisabledFeatures(in ComponentName who, int which, boolean parent);
getKeyguardDisabledFeatures(in ComponentName who, int userHandle, boolean parent)122     int getKeyguardDisabledFeatures(in ComponentName who, int userHandle, boolean parent);
123 
setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle)124     void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle);
isAdminActive(in ComponentName policyReceiver, int userHandle)125     boolean isAdminActive(in ComponentName policyReceiver, int userHandle);
getActiveAdmins(int userHandle)126     List<ComponentName> getActiveAdmins(int userHandle);
127     @UnsupportedAppUsage
packageHasActiveAdmins(String packageName, int userHandle)128     boolean packageHasActiveAdmins(String packageName, int userHandle);
getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle)129     void getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle);
removeActiveAdmin(in ComponentName policyReceiver, int userHandle)130     void removeActiveAdmin(in ComponentName policyReceiver, int userHandle);
forceRemoveActiveAdmin(in ComponentName policyReceiver, int userHandle)131     void forceRemoveActiveAdmin(in ComponentName policyReceiver, int userHandle);
hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle)132     boolean hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle);
133 
setActivePasswordState(in PasswordMetrics metrics, int userHandle)134     void setActivePasswordState(in PasswordMetrics metrics, int userHandle);
reportPasswordChanged(int userId)135     void reportPasswordChanged(int userId);
reportFailedPasswordAttempt(int userHandle)136     void reportFailedPasswordAttempt(int userHandle);
reportSuccessfulPasswordAttempt(int userHandle)137     void reportSuccessfulPasswordAttempt(int userHandle);
reportFailedBiometricAttempt(int userHandle)138     void reportFailedBiometricAttempt(int userHandle);
reportSuccessfulBiometricAttempt(int userHandle)139     void reportSuccessfulBiometricAttempt(int userHandle);
reportKeyguardDismissed(int userHandle)140     void reportKeyguardDismissed(int userHandle);
reportKeyguardSecured(int userHandle)141     void reportKeyguardSecured(int userHandle);
142 
setDeviceOwner(in ComponentName who, String ownerName, int userId)143     boolean setDeviceOwner(in ComponentName who, String ownerName, int userId);
getDeviceOwnerComponent(boolean callingUserOnly)144     ComponentName getDeviceOwnerComponent(boolean callingUserOnly);
hasDeviceOwner()145     boolean hasDeviceOwner();
getDeviceOwnerName()146     String getDeviceOwnerName();
clearDeviceOwner(String packageName)147     void clearDeviceOwner(String packageName);
getDeviceOwnerUserId()148     int getDeviceOwnerUserId();
149 
setProfileOwner(in ComponentName who, String ownerName, int userHandle)150     boolean setProfileOwner(in ComponentName who, String ownerName, int userHandle);
getProfileOwnerAsUser(int userHandle)151     ComponentName getProfileOwnerAsUser(int userHandle);
getProfileOwner(int userHandle)152     ComponentName getProfileOwner(int userHandle);
getProfileOwnerName(int userHandle)153     String getProfileOwnerName(int userHandle);
setProfileEnabled(in ComponentName who)154     void setProfileEnabled(in ComponentName who);
setProfileName(in ComponentName who, String profileName)155     void setProfileName(in ComponentName who, String profileName);
clearProfileOwner(in ComponentName who)156     void clearProfileOwner(in ComponentName who);
hasUserSetupCompleted()157     boolean hasUserSetupCompleted();
158 
checkDeviceIdentifierAccess(in String packageName, int pid, int uid)159     boolean checkDeviceIdentifierAccess(in String packageName, int pid, int uid);
160 
setDeviceOwnerLockScreenInfo(in ComponentName who, CharSequence deviceOwnerInfo)161     void setDeviceOwnerLockScreenInfo(in ComponentName who, CharSequence deviceOwnerInfo);
getDeviceOwnerLockScreenInfo()162     CharSequence getDeviceOwnerLockScreenInfo();
163 
setPackagesSuspended(in ComponentName admin, in String callerPackage, in String[] packageNames, boolean suspended)164     String[] setPackagesSuspended(in ComponentName admin, in String callerPackage, in String[] packageNames, boolean suspended);
isPackageSuspended(in ComponentName admin, in String callerPackage, String packageName)165     boolean isPackageSuspended(in ComponentName admin, in String callerPackage, String packageName);
166 
installCaCert(in ComponentName admin, String callerPackage, in byte[] certBuffer)167     boolean installCaCert(in ComponentName admin, String callerPackage, in byte[] certBuffer);
uninstallCaCerts(in ComponentName admin, String callerPackage, in String[] aliases)168     void uninstallCaCerts(in ComponentName admin, String callerPackage, in String[] aliases);
enforceCanManageCaCerts(in ComponentName admin, in String callerPackage)169     void enforceCanManageCaCerts(in ComponentName admin, in String callerPackage);
approveCaCert(in String alias, int userHandle, boolean approval)170     boolean approveCaCert(in String alias, int userHandle, boolean approval);
isCaCertApproved(in String alias, int userHandle)171     boolean isCaCertApproved(in String alias, int userHandle);
172 
installKeyPair(in ComponentName who, in String callerPackage, in byte[] privKeyBuffer, in byte[] certBuffer, in byte[] certChainBuffer, String alias, boolean requestAccess, boolean isUserSelectable)173     boolean installKeyPair(in ComponentName who, in String callerPackage, in byte[] privKeyBuffer,
174             in byte[] certBuffer, in byte[] certChainBuffer, String alias, boolean requestAccess,
175             boolean isUserSelectable);
removeKeyPair(in ComponentName who, in String callerPackage, String alias)176     boolean removeKeyPair(in ComponentName who, in String callerPackage, String alias);
generateKeyPair(in ComponentName who, in String callerPackage, in String algorithm, in ParcelableKeyGenParameterSpec keySpec, in int idAttestationFlags, out KeymasterCertificateChain attestationChain)177     boolean generateKeyPair(in ComponentName who, in String callerPackage, in String algorithm,
178             in ParcelableKeyGenParameterSpec keySpec,
179             in int idAttestationFlags, out KeymasterCertificateChain attestationChain);
setKeyPairCertificate(in ComponentName who, in String callerPackage, in String alias, in byte[] certBuffer, in byte[] certChainBuffer, boolean isUserSelectable)180     boolean setKeyPairCertificate(in ComponentName who, in String callerPackage, in String alias,
181             in byte[] certBuffer, in byte[] certChainBuffer, boolean isUserSelectable);
choosePrivateKeyAlias(int uid, in Uri uri, in String alias, IBinder aliasCallback)182     void choosePrivateKeyAlias(int uid, in Uri uri, in String alias, IBinder aliasCallback);
183 
setDelegatedScopes(in ComponentName who, in String delegatePackage, in List<String> scopes)184     void setDelegatedScopes(in ComponentName who, in String delegatePackage, in List<String> scopes);
getDelegatedScopes(in ComponentName who, String delegatePackage)185     List<String> getDelegatedScopes(in ComponentName who, String delegatePackage);
getDelegatePackages(in ComponentName who, String scope)186     List<String> getDelegatePackages(in ComponentName who, String scope);
187 
setCertInstallerPackage(in ComponentName who, String installerPackage)188     void setCertInstallerPackage(in ComponentName who, String installerPackage);
getCertInstallerPackage(in ComponentName who)189     String getCertInstallerPackage(in ComponentName who);
190 
setAlwaysOnVpnPackage(in ComponentName who, String vpnPackage, boolean lockdown, in List<String> lockdownWhitelist)191     boolean setAlwaysOnVpnPackage(in ComponentName who, String vpnPackage, boolean lockdown, in List<String> lockdownWhitelist);
getAlwaysOnVpnPackage(in ComponentName who)192     String getAlwaysOnVpnPackage(in ComponentName who);
isAlwaysOnVpnLockdownEnabled(in ComponentName who)193     boolean isAlwaysOnVpnLockdownEnabled(in ComponentName who);
getAlwaysOnVpnLockdownWhitelist(in ComponentName who)194     List<String> getAlwaysOnVpnLockdownWhitelist(in ComponentName who);
195 
addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity)196     void addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity);
clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName)197     void clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName);
198 
setDefaultSmsApplication(in ComponentName admin, String packageName)199     void setDefaultSmsApplication(in ComponentName admin, String packageName);
200 
setApplicationRestrictions(in ComponentName who, in String callerPackage, in String packageName, in Bundle settings)201     void setApplicationRestrictions(in ComponentName who, in String callerPackage, in String packageName, in Bundle settings);
getApplicationRestrictions(in ComponentName who, in String callerPackage, in String packageName)202     Bundle getApplicationRestrictions(in ComponentName who, in String callerPackage, in String packageName);
setApplicationRestrictionsManagingPackage(in ComponentName admin, in String packageName)203     boolean setApplicationRestrictionsManagingPackage(in ComponentName admin, in String packageName);
getApplicationRestrictionsManagingPackage(in ComponentName admin)204     String getApplicationRestrictionsManagingPackage(in ComponentName admin);
isCallerApplicationRestrictionsManagingPackage(in String callerPackage)205     boolean isCallerApplicationRestrictionsManagingPackage(in String callerPackage);
206 
setRestrictionsProvider(in ComponentName who, in ComponentName provider)207     void setRestrictionsProvider(in ComponentName who, in ComponentName provider);
getRestrictionsProvider(int userHandle)208     ComponentName getRestrictionsProvider(int userHandle);
209 
setUserRestriction(in ComponentName who, in String key, boolean enable)210     void setUserRestriction(in ComponentName who, in String key, boolean enable);
getUserRestrictions(in ComponentName who)211     Bundle getUserRestrictions(in ComponentName who);
addCrossProfileIntentFilter(in ComponentName admin, in IntentFilter filter, int flags)212     void addCrossProfileIntentFilter(in ComponentName admin, in IntentFilter filter, int flags);
clearCrossProfileIntentFilters(in ComponentName admin)213     void clearCrossProfileIntentFilters(in ComponentName admin);
214 
setPermittedAccessibilityServices(in ComponentName admin,in List packageList)215     boolean setPermittedAccessibilityServices(in ComponentName admin,in List packageList);
getPermittedAccessibilityServices(in ComponentName admin)216     List getPermittedAccessibilityServices(in ComponentName admin);
getPermittedAccessibilityServicesForUser(int userId)217     List getPermittedAccessibilityServicesForUser(int userId);
isAccessibilityServicePermittedByAdmin(in ComponentName admin, String packageName, int userId)218     boolean isAccessibilityServicePermittedByAdmin(in ComponentName admin, String packageName, int userId);
219 
setPermittedInputMethods(in ComponentName admin,in List packageList)220     boolean setPermittedInputMethods(in ComponentName admin,in List packageList);
getPermittedInputMethods(in ComponentName admin)221     List getPermittedInputMethods(in ComponentName admin);
getPermittedInputMethodsForCurrentUser()222     List getPermittedInputMethodsForCurrentUser();
isInputMethodPermittedByAdmin(in ComponentName admin, String packageName, int userId)223     boolean isInputMethodPermittedByAdmin(in ComponentName admin, String packageName, int userId);
224 
setPermittedCrossProfileNotificationListeners(in ComponentName admin, in List<String> packageList)225     boolean setPermittedCrossProfileNotificationListeners(in ComponentName admin, in List<String> packageList);
getPermittedCrossProfileNotificationListeners(in ComponentName admin)226     List<String> getPermittedCrossProfileNotificationListeners(in ComponentName admin);
isNotificationListenerServicePermitted(in String packageName, int userId)227     boolean isNotificationListenerServicePermitted(in String packageName, int userId);
228 
createAdminSupportIntent(in String restriction)229     Intent createAdminSupportIntent(in String restriction);
setApplicationHidden(in ComponentName admin, in String callerPackage, in String packageName, boolean hidden)230     boolean setApplicationHidden(in ComponentName admin, in String callerPackage, in String packageName, boolean hidden);
isApplicationHidden(in ComponentName admin, in String callerPackage, in String packageName)231     boolean isApplicationHidden(in ComponentName admin, in String callerPackage, in String packageName);
232 
createAndManageUser(in ComponentName who, in String name, in ComponentName profileOwner, in PersistableBundle adminExtras, in int flags)233     UserHandle createAndManageUser(in ComponentName who, in String name, in ComponentName profileOwner, in PersistableBundle adminExtras, in int flags);
removeUser(in ComponentName who, in UserHandle userHandle)234     boolean removeUser(in ComponentName who, in UserHandle userHandle);
switchUser(in ComponentName who, in UserHandle userHandle)235     boolean switchUser(in ComponentName who, in UserHandle userHandle);
startUserInBackground(in ComponentName who, in UserHandle userHandle)236     int startUserInBackground(in ComponentName who, in UserHandle userHandle);
stopUser(in ComponentName who, in UserHandle userHandle)237     int stopUser(in ComponentName who, in UserHandle userHandle);
logoutUser(in ComponentName who)238     int logoutUser(in ComponentName who);
getSecondaryUsers(in ComponentName who)239     List<UserHandle> getSecondaryUsers(in ComponentName who);
240 
enableSystemApp(in ComponentName admin, in String callerPackage, in String packageName)241     void enableSystemApp(in ComponentName admin, in String callerPackage, in String packageName);
enableSystemAppWithIntent(in ComponentName admin, in String callerPackage, in Intent intent)242     int enableSystemAppWithIntent(in ComponentName admin, in String callerPackage, in Intent intent);
installExistingPackage(in ComponentName admin, in String callerPackage, in String packageName)243     boolean installExistingPackage(in ComponentName admin, in String callerPackage, in String packageName);
244 
setAccountManagementDisabled(in ComponentName who, in String accountType, in boolean disabled)245     void setAccountManagementDisabled(in ComponentName who, in String accountType, in boolean disabled);
getAccountTypesWithManagementDisabled()246     String[] getAccountTypesWithManagementDisabled();
getAccountTypesWithManagementDisabledAsUser(int userId)247     String[] getAccountTypesWithManagementDisabledAsUser(int userId);
248 
setLockTaskPackages(in ComponentName who, in String[] packages)249     void setLockTaskPackages(in ComponentName who, in String[] packages);
getLockTaskPackages(in ComponentName who)250     String[] getLockTaskPackages(in ComponentName who);
isLockTaskPermitted(in String pkg)251     boolean isLockTaskPermitted(in String pkg);
252 
setLockTaskFeatures(in ComponentName who, int flags)253     void setLockTaskFeatures(in ComponentName who, int flags);
getLockTaskFeatures(in ComponentName who)254     int getLockTaskFeatures(in ComponentName who);
255 
setGlobalSetting(in ComponentName who, in String setting, in String value)256     void setGlobalSetting(in ComponentName who, in String setting, in String value);
setSystemSetting(in ComponentName who, in String setting, in String value)257     void setSystemSetting(in ComponentName who, in String setting, in String value);
setSecureSetting(in ComponentName who, in String setting, in String value)258     void setSecureSetting(in ComponentName who, in String setting, in String value);
259 
setTime(in ComponentName who, long millis)260     boolean setTime(in ComponentName who, long millis);
setTimeZone(in ComponentName who, String timeZone)261     boolean setTimeZone(in ComponentName who, String timeZone);
262 
setMasterVolumeMuted(in ComponentName admin, boolean on)263     void setMasterVolumeMuted(in ComponentName admin, boolean on);
isMasterVolumeMuted(in ComponentName admin)264     boolean isMasterVolumeMuted(in ComponentName admin);
265 
notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId)266     void notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId);
267 
setUninstallBlocked(in ComponentName admin, in String callerPackage, in String packageName, boolean uninstallBlocked)268     void setUninstallBlocked(in ComponentName admin, in String callerPackage, in String packageName, boolean uninstallBlocked);
isUninstallBlocked(in ComponentName admin, in String packageName)269     boolean isUninstallBlocked(in ComponentName admin, in String packageName);
270 
setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled)271     void setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled);
getCrossProfileCallerIdDisabled(in ComponentName who)272     boolean getCrossProfileCallerIdDisabled(in ComponentName who);
getCrossProfileCallerIdDisabledForUser(int userId)273     boolean getCrossProfileCallerIdDisabledForUser(int userId);
setCrossProfileContactsSearchDisabled(in ComponentName who, boolean disabled)274     void setCrossProfileContactsSearchDisabled(in ComponentName who, boolean disabled);
getCrossProfileContactsSearchDisabled(in ComponentName who)275     boolean getCrossProfileContactsSearchDisabled(in ComponentName who);
getCrossProfileContactsSearchDisabledForUser(int userId)276     boolean getCrossProfileContactsSearchDisabledForUser(int userId);
startManagedQuickContact(String lookupKey, long contactId, boolean isContactIdIgnored, long directoryId, in Intent originalIntent)277     void startManagedQuickContact(String lookupKey, long contactId, boolean isContactIdIgnored, long directoryId, in Intent originalIntent);
278 
setBluetoothContactSharingDisabled(in ComponentName who, boolean disabled)279     void setBluetoothContactSharingDisabled(in ComponentName who, boolean disabled);
getBluetoothContactSharingDisabled(in ComponentName who)280     boolean getBluetoothContactSharingDisabled(in ComponentName who);
getBluetoothContactSharingDisabledForUser(int userId)281     boolean getBluetoothContactSharingDisabledForUser(int userId);
282 
setTrustAgentConfiguration(in ComponentName admin, in ComponentName agent, in PersistableBundle args, boolean parent)283     void setTrustAgentConfiguration(in ComponentName admin, in ComponentName agent,
284             in PersistableBundle args, boolean parent);
getTrustAgentConfiguration(in ComponentName admin, in ComponentName agent, int userId, boolean parent)285     List<PersistableBundle> getTrustAgentConfiguration(in ComponentName admin,
286             in ComponentName agent, int userId, boolean parent);
287 
addCrossProfileWidgetProvider(in ComponentName admin, String packageName)288     boolean addCrossProfileWidgetProvider(in ComponentName admin, String packageName);
removeCrossProfileWidgetProvider(in ComponentName admin, String packageName)289     boolean removeCrossProfileWidgetProvider(in ComponentName admin, String packageName);
getCrossProfileWidgetProviders(in ComponentName admin)290     List<String> getCrossProfileWidgetProviders(in ComponentName admin);
291 
setAutoTimeRequired(in ComponentName who, boolean required)292     void setAutoTimeRequired(in ComponentName who, boolean required);
getAutoTimeRequired()293     boolean getAutoTimeRequired();
294 
setForceEphemeralUsers(in ComponentName who, boolean forceEpehemeralUsers)295     void setForceEphemeralUsers(in ComponentName who, boolean forceEpehemeralUsers);
getForceEphemeralUsers(in ComponentName who)296     boolean getForceEphemeralUsers(in ComponentName who);
297 
isRemovingAdmin(in ComponentName adminReceiver, int userHandle)298     boolean isRemovingAdmin(in ComponentName adminReceiver, int userHandle);
299 
setUserIcon(in ComponentName admin, in Bitmap icon)300     void setUserIcon(in ComponentName admin, in Bitmap icon);
301 
setSystemUpdatePolicy(in ComponentName who, in SystemUpdatePolicy policy)302     void setSystemUpdatePolicy(in ComponentName who, in SystemUpdatePolicy policy);
getSystemUpdatePolicy()303     SystemUpdatePolicy getSystemUpdatePolicy();
clearSystemUpdatePolicyFreezePeriodRecord()304     void clearSystemUpdatePolicyFreezePeriodRecord();
305 
setKeyguardDisabled(in ComponentName admin, boolean disabled)306     boolean setKeyguardDisabled(in ComponentName admin, boolean disabled);
setStatusBarDisabled(in ComponentName who, boolean disabled)307     boolean setStatusBarDisabled(in ComponentName who, boolean disabled);
getDoNotAskCredentialsOnBoot()308     boolean getDoNotAskCredentialsOnBoot();
309 
notifyPendingSystemUpdate(in SystemUpdateInfo info)310     void notifyPendingSystemUpdate(in SystemUpdateInfo info);
getPendingSystemUpdate(in ComponentName admin)311     SystemUpdateInfo getPendingSystemUpdate(in ComponentName admin);
312 
setPermissionPolicy(in ComponentName admin, in String callerPackage, int policy)313     void setPermissionPolicy(in ComponentName admin, in String callerPackage, int policy);
getPermissionPolicy(in ComponentName admin)314     int  getPermissionPolicy(in ComponentName admin);
setPermissionGrantState(in ComponentName admin, in String callerPackage, String packageName, String permission, int grantState, in RemoteCallback resultReceiver)315     void setPermissionGrantState(in ComponentName admin, in String callerPackage, String packageName,
316             String permission, int grantState, in RemoteCallback resultReceiver);
getPermissionGrantState(in ComponentName admin, in String callerPackage, String packageName, String permission)317     int getPermissionGrantState(in ComponentName admin, in String callerPackage, String packageName, String permission);
isProvisioningAllowed(String action, String packageName)318     boolean isProvisioningAllowed(String action, String packageName);
checkProvisioningPreCondition(String action, String packageName)319     int checkProvisioningPreCondition(String action, String packageName);
setKeepUninstalledPackages(in ComponentName admin, in String callerPackage, in List<String> packageList)320     void setKeepUninstalledPackages(in ComponentName admin, in String callerPackage, in List<String> packageList);
getKeepUninstalledPackages(in ComponentName admin, in String callerPackage)321     List<String> getKeepUninstalledPackages(in ComponentName admin, in String callerPackage);
isManagedProfile(in ComponentName admin)322     boolean isManagedProfile(in ComponentName admin);
isSystemOnlyUser(in ComponentName admin)323     boolean isSystemOnlyUser(in ComponentName admin);
getWifiMacAddress(in ComponentName admin)324     String getWifiMacAddress(in ComponentName admin);
reboot(in ComponentName admin)325     void reboot(in ComponentName admin);
326 
setShortSupportMessage(in ComponentName admin, in CharSequence message)327     void setShortSupportMessage(in ComponentName admin, in CharSequence message);
getShortSupportMessage(in ComponentName admin)328     CharSequence getShortSupportMessage(in ComponentName admin);
setLongSupportMessage(in ComponentName admin, in CharSequence message)329     void setLongSupportMessage(in ComponentName admin, in CharSequence message);
getLongSupportMessage(in ComponentName admin)330     CharSequence getLongSupportMessage(in ComponentName admin);
331 
getShortSupportMessageForUser(in ComponentName admin, int userHandle)332     CharSequence getShortSupportMessageForUser(in ComponentName admin, int userHandle);
getLongSupportMessageForUser(in ComponentName admin, int userHandle)333     CharSequence getLongSupportMessageForUser(in ComponentName admin, int userHandle);
334 
isSeparateProfileChallengeAllowed(int userHandle)335     boolean isSeparateProfileChallengeAllowed(int userHandle);
336 
setOrganizationColor(in ComponentName admin, in int color)337     void setOrganizationColor(in ComponentName admin, in int color);
setOrganizationColorForUser(in int color, in int userId)338     void setOrganizationColorForUser(in int color, in int userId);
getOrganizationColor(in ComponentName admin)339     int getOrganizationColor(in ComponentName admin);
getOrganizationColorForUser(int userHandle)340     int getOrganizationColorForUser(int userHandle);
341 
setOrganizationName(in ComponentName admin, in CharSequence title)342     void setOrganizationName(in ComponentName admin, in CharSequence title);
getOrganizationName(in ComponentName admin)343     CharSequence getOrganizationName(in ComponentName admin);
getDeviceOwnerOrganizationName()344     CharSequence getDeviceOwnerOrganizationName();
getOrganizationNameForUser(int userHandle)345     CharSequence getOrganizationNameForUser(int userHandle);
346 
getUserProvisioningState()347     int getUserProvisioningState();
setUserProvisioningState(int state, int userHandle)348     void setUserProvisioningState(int state, int userHandle);
349 
setAffiliationIds(in ComponentName admin, in List<String> ids)350     void setAffiliationIds(in ComponentName admin, in List<String> ids);
getAffiliationIds(in ComponentName admin)351     List<String> getAffiliationIds(in ComponentName admin);
isAffiliatedUser()352     boolean isAffiliatedUser();
353 
setSecurityLoggingEnabled(in ComponentName admin, boolean enabled)354     void setSecurityLoggingEnabled(in ComponentName admin, boolean enabled);
isSecurityLoggingEnabled(in ComponentName admin)355     boolean isSecurityLoggingEnabled(in ComponentName admin);
retrieveSecurityLogs(in ComponentName admin)356     ParceledListSlice retrieveSecurityLogs(in ComponentName admin);
retrievePreRebootSecurityLogs(in ComponentName admin)357     ParceledListSlice retrievePreRebootSecurityLogs(in ComponentName admin);
forceNetworkLogs()358     long forceNetworkLogs();
forceSecurityLogs()359     long forceSecurityLogs();
360 
isUninstallInQueue(String packageName)361     boolean isUninstallInQueue(String packageName);
uninstallPackageWithActiveAdmins(String packageName)362     void uninstallPackageWithActiveAdmins(String packageName);
363 
isDeviceProvisioned()364     boolean isDeviceProvisioned();
isDeviceProvisioningConfigApplied()365     boolean isDeviceProvisioningConfigApplied();
setDeviceProvisioningConfigApplied()366     void setDeviceProvisioningConfigApplied();
367 
forceUpdateUserSetupComplete()368     void forceUpdateUserSetupComplete();
369 
setBackupServiceEnabled(in ComponentName admin, boolean enabled)370     void setBackupServiceEnabled(in ComponentName admin, boolean enabled);
isBackupServiceEnabled(in ComponentName admin)371     boolean isBackupServiceEnabled(in ComponentName admin);
372 
setNetworkLoggingEnabled(in ComponentName admin, in String packageName, boolean enabled)373     void setNetworkLoggingEnabled(in ComponentName admin, in String packageName, boolean enabled);
isNetworkLoggingEnabled(in ComponentName admin, in String packageName)374     boolean isNetworkLoggingEnabled(in ComponentName admin, in String packageName);
retrieveNetworkLogs(in ComponentName admin, in String packageName, long batchToken)375     List<NetworkEvent> retrieveNetworkLogs(in ComponentName admin, in String packageName, long batchToken);
376 
bindDeviceAdminServiceAsUser(in ComponentName admin, IApplicationThread caller, IBinder token, in Intent service, IServiceConnection connection, int flags, int targetUserId)377     boolean bindDeviceAdminServiceAsUser(in ComponentName admin,
378         IApplicationThread caller, IBinder token, in Intent service,
379         IServiceConnection connection, int flags, int targetUserId);
getBindDeviceAdminTargetUsers(in ComponentName admin)380     List<UserHandle> getBindDeviceAdminTargetUsers(in ComponentName admin);
isEphemeralUser(in ComponentName admin)381     boolean isEphemeralUser(in ComponentName admin);
382 
getLastSecurityLogRetrievalTime()383     long getLastSecurityLogRetrievalTime();
getLastBugReportRequestTime()384     long getLastBugReportRequestTime();
getLastNetworkLogRetrievalTime()385     long getLastNetworkLogRetrievalTime();
386 
setResetPasswordToken(in ComponentName admin, in byte[] token)387     boolean setResetPasswordToken(in ComponentName admin, in byte[] token);
clearResetPasswordToken(in ComponentName admin)388     boolean clearResetPasswordToken(in ComponentName admin);
isResetPasswordTokenActive(in ComponentName admin)389     boolean isResetPasswordTokenActive(in ComponentName admin);
resetPasswordWithToken(in ComponentName admin, String password, in byte[] token, int flags)390     boolean resetPasswordWithToken(in ComponentName admin, String password, in byte[] token, int flags);
391 
isCurrentInputMethodSetByOwner()392     boolean isCurrentInputMethodSetByOwner();
getOwnerInstalledCaCerts(in UserHandle user)393     StringParceledListSlice getOwnerInstalledCaCerts(in UserHandle user);
394 
clearApplicationUserData(in ComponentName admin, in String packageName, in IPackageDataObserver callback)395     void clearApplicationUserData(in ComponentName admin, in String packageName, in IPackageDataObserver callback);
396 
setLogoutEnabled(in ComponentName admin, boolean enabled)397     void setLogoutEnabled(in ComponentName admin, boolean enabled);
isLogoutEnabled()398     boolean isLogoutEnabled();
399 
getDisallowedSystemApps(in ComponentName admin, int userId, String provisioningAction)400     List<String> getDisallowedSystemApps(in ComponentName admin, int userId, String provisioningAction);
401 
transferOwnership(in ComponentName admin, in ComponentName target, in PersistableBundle bundle)402     void transferOwnership(in ComponentName admin, in ComponentName target, in PersistableBundle bundle);
getTransferOwnershipBundle()403     PersistableBundle getTransferOwnershipBundle();
404 
setStartUserSessionMessage(in ComponentName admin, in CharSequence startUserSessionMessage)405     void setStartUserSessionMessage(in ComponentName admin, in CharSequence startUserSessionMessage);
setEndUserSessionMessage(in ComponentName admin, in CharSequence endUserSessionMessage)406     void setEndUserSessionMessage(in ComponentName admin, in CharSequence endUserSessionMessage);
getStartUserSessionMessage(in ComponentName admin)407     CharSequence getStartUserSessionMessage(in ComponentName admin);
getEndUserSessionMessage(in ComponentName admin)408     CharSequence getEndUserSessionMessage(in ComponentName admin);
409 
setMeteredDataDisabledPackages(in ComponentName admin, in List<String> packageNames)410     List<String> setMeteredDataDisabledPackages(in ComponentName admin, in List<String> packageNames);
getMeteredDataDisabledPackages(in ComponentName admin)411     List<String> getMeteredDataDisabledPackages(in ComponentName admin);
412 
addOverrideApn(in ComponentName admin, in ApnSetting apnSetting)413     int addOverrideApn(in ComponentName admin, in ApnSetting apnSetting);
updateOverrideApn(in ComponentName admin, int apnId, in ApnSetting apnSetting)414     boolean updateOverrideApn(in ComponentName admin, int apnId, in ApnSetting apnSetting);
removeOverrideApn(in ComponentName admin, int apnId)415     boolean removeOverrideApn(in ComponentName admin, int apnId);
getOverrideApns(in ComponentName admin)416     List<ApnSetting> getOverrideApns(in ComponentName admin);
setOverrideApnsEnabled(in ComponentName admin, boolean enabled)417     void setOverrideApnsEnabled(in ComponentName admin, boolean enabled);
isOverrideApnEnabled(in ComponentName admin)418     boolean isOverrideApnEnabled(in ComponentName admin);
419 
isMeteredDataDisabledPackageForUser(in ComponentName admin, String packageName, int userId)420     boolean isMeteredDataDisabledPackageForUser(in ComponentName admin, String packageName, int userId);
421 
setGlobalPrivateDns(in ComponentName admin, int mode, in String privateDnsHost)422     int setGlobalPrivateDns(in ComponentName admin, int mode, in String privateDnsHost);
getGlobalPrivateDnsMode(in ComponentName admin)423     int getGlobalPrivateDnsMode(in ComponentName admin);
getGlobalPrivateDnsHost(in ComponentName admin)424     String getGlobalPrivateDnsHost(in ComponentName admin);
425 
grantDeviceIdsAccessToProfileOwner(in ComponentName who, int userId)426     void grantDeviceIdsAccessToProfileOwner(in ComponentName who, int userId);
427 
installUpdateFromFile(in ComponentName admin, in ParcelFileDescriptor updateFileDescriptor, in StartInstallingUpdateCallback listener)428     void installUpdateFromFile(in ComponentName admin, in ParcelFileDescriptor updateFileDescriptor, in StartInstallingUpdateCallback listener);
429 
setCrossProfileCalendarPackages(in ComponentName admin, in List<String> packageNames)430     void setCrossProfileCalendarPackages(in ComponentName admin, in List<String> packageNames);
getCrossProfileCalendarPackages(in ComponentName admin)431     List<String> getCrossProfileCalendarPackages(in ComponentName admin);
isPackageAllowedToAccessCalendarForUser(String packageName, int userHandle)432     boolean isPackageAllowedToAccessCalendarForUser(String packageName, int userHandle);
getCrossProfileCalendarPackagesForUser(int userHandle)433     List<String> getCrossProfileCalendarPackagesForUser(int userHandle);
434 
isManagedKiosk()435     boolean isManagedKiosk();
isUnattendedManagedKiosk()436     boolean isUnattendedManagedKiosk();
437 
startViewCalendarEventInManagedProfile(String packageName, long eventId, long start, long end, boolean allDay, int flags)438     boolean startViewCalendarEventInManagedProfile(String packageName, long eventId, long start, long end, boolean allDay, int flags);
439 }
440