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