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.content.ComponentName;
21 import android.content.Intent;
22 import android.content.IntentFilter;
23 import android.net.ProxyInfo;
24 import android.os.Bundle;
25 import android.os.PersistableBundle;
26 import android.os.RemoteCallback;
27 import android.os.UserHandle;
28 import java.util.List;
29 
30 /**
31  * Internal IPC interface to the device policy service.
32  * {@hide}
33  */
34 interface IDevicePolicyManager {
setPasswordQuality(in ComponentName who, int quality, int userHandle)35     void setPasswordQuality(in ComponentName who, int quality, int userHandle);
getPasswordQuality(in ComponentName who, int userHandle)36     int getPasswordQuality(in ComponentName who, int userHandle);
37 
setPasswordMinimumLength(in ComponentName who, int length, int userHandle)38     void setPasswordMinimumLength(in ComponentName who, int length, int userHandle);
getPasswordMinimumLength(in ComponentName who, int userHandle)39     int getPasswordMinimumLength(in ComponentName who, int userHandle);
40 
setPasswordMinimumUpperCase(in ComponentName who, int length, int userHandle)41     void setPasswordMinimumUpperCase(in ComponentName who, int length, int userHandle);
getPasswordMinimumUpperCase(in ComponentName who, int userHandle)42     int getPasswordMinimumUpperCase(in ComponentName who, int userHandle);
43 
setPasswordMinimumLowerCase(in ComponentName who, int length, int userHandle)44     void setPasswordMinimumLowerCase(in ComponentName who, int length, int userHandle);
getPasswordMinimumLowerCase(in ComponentName who, int userHandle)45     int getPasswordMinimumLowerCase(in ComponentName who, int userHandle);
46 
setPasswordMinimumLetters(in ComponentName who, int length, int userHandle)47     void setPasswordMinimumLetters(in ComponentName who, int length, int userHandle);
getPasswordMinimumLetters(in ComponentName who, int userHandle)48     int getPasswordMinimumLetters(in ComponentName who, int userHandle);
49 
setPasswordMinimumNumeric(in ComponentName who, int length, int userHandle)50     void setPasswordMinimumNumeric(in ComponentName who, int length, int userHandle);
getPasswordMinimumNumeric(in ComponentName who, int userHandle)51     int getPasswordMinimumNumeric(in ComponentName who, int userHandle);
52 
setPasswordMinimumSymbols(in ComponentName who, int length, int userHandle)53     void setPasswordMinimumSymbols(in ComponentName who, int length, int userHandle);
getPasswordMinimumSymbols(in ComponentName who, int userHandle)54     int getPasswordMinimumSymbols(in ComponentName who, int userHandle);
55 
setPasswordMinimumNonLetter(in ComponentName who, int length, int userHandle)56     void setPasswordMinimumNonLetter(in ComponentName who, int length, int userHandle);
getPasswordMinimumNonLetter(in ComponentName who, int userHandle)57     int getPasswordMinimumNonLetter(in ComponentName who, int userHandle);
58 
setPasswordHistoryLength(in ComponentName who, int length, int userHandle)59     void setPasswordHistoryLength(in ComponentName who, int length, int userHandle);
getPasswordHistoryLength(in ComponentName who, int userHandle)60     int getPasswordHistoryLength(in ComponentName who, int userHandle);
61 
setPasswordExpirationTimeout(in ComponentName who, long expiration, int userHandle)62     void setPasswordExpirationTimeout(in ComponentName who, long expiration, int userHandle);
getPasswordExpirationTimeout(in ComponentName who, int userHandle)63     long getPasswordExpirationTimeout(in ComponentName who, int userHandle);
64 
getPasswordExpiration(in ComponentName who, int userHandle)65     long getPasswordExpiration(in ComponentName who, int userHandle);
66 
isActivePasswordSufficient(int userHandle)67     boolean isActivePasswordSufficient(int userHandle);
getCurrentFailedPasswordAttempts(int userHandle)68     int getCurrentFailedPasswordAttempts(int userHandle);
getProfileWithMinimumFailedPasswordsForWipe(int userHandle)69     int getProfileWithMinimumFailedPasswordsForWipe(int userHandle);
70 
setMaximumFailedPasswordsForWipe(in ComponentName admin, int num, int userHandle)71     void setMaximumFailedPasswordsForWipe(in ComponentName admin, int num, int userHandle);
getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle)72     int getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle);
73 
resetPassword(String password, int flags, int userHandle)74     boolean resetPassword(String password, int flags, int userHandle);
75 
setMaximumTimeToLock(in ComponentName who, long timeMs, int userHandle)76     void setMaximumTimeToLock(in ComponentName who, long timeMs, int userHandle);
getMaximumTimeToLock(in ComponentName who, int userHandle)77     long getMaximumTimeToLock(in ComponentName who, int userHandle);
78 
lockNow()79     void lockNow();
80 
wipeData(int flags, int userHandle)81     void wipeData(int flags, int userHandle);
82 
setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList, int userHandle)83     ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList, int userHandle);
getGlobalProxyAdmin(int userHandle)84     ComponentName getGlobalProxyAdmin(int userHandle);
setRecommendedGlobalProxy(in ComponentName admin, in ProxyInfo proxyInfo)85     void setRecommendedGlobalProxy(in ComponentName admin, in ProxyInfo proxyInfo);
86 
setStorageEncryption(in ComponentName who, boolean encrypt, int userHandle)87     int setStorageEncryption(in ComponentName who, boolean encrypt, int userHandle);
getStorageEncryption(in ComponentName who, int userHandle)88     boolean getStorageEncryption(in ComponentName who, int userHandle);
getStorageEncryptionStatus(int userHandle)89     int getStorageEncryptionStatus(int userHandle);
90 
setCameraDisabled(in ComponentName who, boolean disabled, int userHandle)91     void setCameraDisabled(in ComponentName who, boolean disabled, int userHandle);
getCameraDisabled(in ComponentName who, int userHandle)92     boolean getCameraDisabled(in ComponentName who, int userHandle);
93 
setScreenCaptureDisabled(in ComponentName who, int userHandle, boolean disabled)94     void setScreenCaptureDisabled(in ComponentName who, int userHandle, boolean disabled);
getScreenCaptureDisabled(in ComponentName who, int userHandle)95     boolean getScreenCaptureDisabled(in ComponentName who, int userHandle);
96 
setKeyguardDisabledFeatures(in ComponentName who, int which, int userHandle)97     void setKeyguardDisabledFeatures(in ComponentName who, int which, int userHandle);
getKeyguardDisabledFeatures(in ComponentName who, int userHandle)98     int getKeyguardDisabledFeatures(in ComponentName who, int userHandle);
99 
setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle)100     void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle);
isAdminActive(in ComponentName policyReceiver, int userHandle)101     boolean isAdminActive(in ComponentName policyReceiver, int userHandle);
getActiveAdmins(int userHandle)102     List<ComponentName> getActiveAdmins(int userHandle);
packageHasActiveAdmins(String packageName, int userHandle)103     boolean packageHasActiveAdmins(String packageName, int userHandle);
getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle)104     void getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle);
removeActiveAdmin(in ComponentName policyReceiver, int userHandle)105     void removeActiveAdmin(in ComponentName policyReceiver, int userHandle);
hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle)106     boolean hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle);
107 
setActivePasswordState(int quality, int length, int letters, int uppercase, int lowercase, int numbers, int symbols, int nonletter, int userHandle)108     void setActivePasswordState(int quality, int length, int letters, int uppercase, int lowercase,
109         int numbers, int symbols, int nonletter, int userHandle);
reportFailedPasswordAttempt(int userHandle)110     void reportFailedPasswordAttempt(int userHandle);
reportSuccessfulPasswordAttempt(int userHandle)111     void reportSuccessfulPasswordAttempt(int userHandle);
112 
setDeviceOwner(String packageName, String ownerName)113     boolean setDeviceOwner(String packageName, String ownerName);
isDeviceOwner(String packageName)114     boolean isDeviceOwner(String packageName);
getDeviceOwner()115     String getDeviceOwner();
getDeviceOwnerName()116     String getDeviceOwnerName();
clearDeviceOwner(String packageName)117     void clearDeviceOwner(String packageName);
118 
setProfileOwner(in ComponentName who, String ownerName, int userHandle)119     boolean setProfileOwner(in ComponentName who, String ownerName, int userHandle);
getProfileOwner(int userHandle)120     ComponentName getProfileOwner(int userHandle);
getProfileOwnerName(int userHandle)121     String getProfileOwnerName(int userHandle);
setProfileEnabled(in ComponentName who)122     void setProfileEnabled(in ComponentName who);
setProfileName(in ComponentName who, String profileName)123     void setProfileName(in ComponentName who, String profileName);
clearProfileOwner(in ComponentName who)124     void clearProfileOwner(in ComponentName who);
hasUserSetupCompleted()125     boolean hasUserSetupCompleted();
126 
installCaCert(in ComponentName admin, in byte[] certBuffer)127     boolean installCaCert(in ComponentName admin, in byte[] certBuffer);
uninstallCaCert(in ComponentName admin, in String alias)128     void uninstallCaCert(in ComponentName admin, in String alias);
enforceCanManageCaCerts(in ComponentName admin)129     void enforceCanManageCaCerts(in ComponentName admin);
130 
installKeyPair(in ComponentName who, in byte[] privKeyBuffer, in byte[] certBuffer, String alias)131     boolean installKeyPair(in ComponentName who, in byte[] privKeyBuffer, in byte[] certBuffer, String alias);
132 
addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity)133     void addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity);
clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName)134     void clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName);
135 
setApplicationRestrictions(in ComponentName who, in String packageName, in Bundle settings)136     void setApplicationRestrictions(in ComponentName who, in String packageName, in Bundle settings);
getApplicationRestrictions(in ComponentName who, in String packageName)137     Bundle getApplicationRestrictions(in ComponentName who, in String packageName);
138 
setRestrictionsProvider(in ComponentName who, in ComponentName provider)139     void setRestrictionsProvider(in ComponentName who, in ComponentName provider);
getRestrictionsProvider(int userHandle)140     ComponentName getRestrictionsProvider(int userHandle);
141 
setUserRestriction(in ComponentName who, in String key, boolean enable)142     void setUserRestriction(in ComponentName who, in String key, boolean enable);
addCrossProfileIntentFilter(in ComponentName admin, in IntentFilter filter, int flags)143     void addCrossProfileIntentFilter(in ComponentName admin, in IntentFilter filter, int flags);
clearCrossProfileIntentFilters(in ComponentName admin)144     void clearCrossProfileIntentFilters(in ComponentName admin);
145 
setPermittedAccessibilityServices(in ComponentName admin,in List packageList)146     boolean setPermittedAccessibilityServices(in ComponentName admin,in List packageList);
getPermittedAccessibilityServices(in ComponentName admin)147     List getPermittedAccessibilityServices(in ComponentName admin);
getPermittedAccessibilityServicesForUser(int userId)148     List getPermittedAccessibilityServicesForUser(int userId);
149 
setPermittedInputMethods(in ComponentName admin,in List packageList)150     boolean setPermittedInputMethods(in ComponentName admin,in List packageList);
getPermittedInputMethods(in ComponentName admin)151     List getPermittedInputMethods(in ComponentName admin);
getPermittedInputMethodsForCurrentUser()152     List getPermittedInputMethodsForCurrentUser();
153 
setApplicationHidden(in ComponentName admin, in String packageName, boolean hidden)154     boolean setApplicationHidden(in ComponentName admin, in String packageName, boolean hidden);
isApplicationHidden(in ComponentName admin, in String packageName)155     boolean isApplicationHidden(in ComponentName admin, in String packageName);
156 
createUser(in ComponentName who, in String name)157     UserHandle createUser(in ComponentName who, in String name);
createAndInitializeUser(in ComponentName who, in String name, in String profileOwnerName, in ComponentName profileOwnerComponent, in Bundle adminExtras)158     UserHandle createAndInitializeUser(in ComponentName who, in String name, in String profileOwnerName, in ComponentName profileOwnerComponent, in Bundle adminExtras);
removeUser(in ComponentName who, in UserHandle userHandle)159     boolean removeUser(in ComponentName who, in UserHandle userHandle);
switchUser(in ComponentName who, in UserHandle userHandle)160     boolean switchUser(in ComponentName who, in UserHandle userHandle);
161 
enableSystemApp(in ComponentName admin, in String packageName)162     void enableSystemApp(in ComponentName admin, in String packageName);
enableSystemAppWithIntent(in ComponentName admin, in Intent intent)163     int enableSystemAppWithIntent(in ComponentName admin, in Intent intent);
164 
setAccountManagementDisabled(in ComponentName who, in String accountType, in boolean disabled)165     void setAccountManagementDisabled(in ComponentName who, in String accountType, in boolean disabled);
getAccountTypesWithManagementDisabled()166     String[] getAccountTypesWithManagementDisabled();
getAccountTypesWithManagementDisabledAsUser(int userId)167     String[] getAccountTypesWithManagementDisabledAsUser(int userId);
168 
setLockTaskPackages(in ComponentName who, in String[] packages)169     void setLockTaskPackages(in ComponentName who, in String[] packages);
getLockTaskPackages(in ComponentName who)170     String[] getLockTaskPackages(in ComponentName who);
isLockTaskPermitted(in String pkg)171     boolean isLockTaskPermitted(in String pkg);
172 
setGlobalSetting(in ComponentName who, in String setting, in String value)173     void setGlobalSetting(in ComponentName who, in String setting, in String value);
setSecureSetting(in ComponentName who, in String setting, in String value)174     void setSecureSetting(in ComponentName who, in String setting, in String value);
175 
setMasterVolumeMuted(in ComponentName admin, boolean on)176     void setMasterVolumeMuted(in ComponentName admin, boolean on);
isMasterVolumeMuted(in ComponentName admin)177     boolean isMasterVolumeMuted(in ComponentName admin);
178 
notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId)179     void notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId);
180 
setUninstallBlocked(in ComponentName admin, in String packageName, boolean uninstallBlocked)181     void setUninstallBlocked(in ComponentName admin, in String packageName, boolean uninstallBlocked);
isUninstallBlocked(in ComponentName admin, in String packageName)182     boolean isUninstallBlocked(in ComponentName admin, in String packageName);
183 
setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled)184     void setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled);
getCrossProfileCallerIdDisabled(in ComponentName who)185     boolean getCrossProfileCallerIdDisabled(in ComponentName who);
getCrossProfileCallerIdDisabledForUser(int userId)186     boolean getCrossProfileCallerIdDisabledForUser(int userId);
187 
setTrustAgentConfiguration(in ComponentName admin, in ComponentName agent, in PersistableBundle args, int userId)188     void setTrustAgentConfiguration(in ComponentName admin, in ComponentName agent,
189             in PersistableBundle args, int userId);
getTrustAgentConfiguration(in ComponentName admin, in ComponentName agent, int userId)190     List<PersistableBundle> getTrustAgentConfiguration(in ComponentName admin,
191             in ComponentName agent, int userId);
192 
addCrossProfileWidgetProvider(in ComponentName admin, String packageName)193     boolean addCrossProfileWidgetProvider(in ComponentName admin, String packageName);
removeCrossProfileWidgetProvider(in ComponentName admin, String packageName)194     boolean removeCrossProfileWidgetProvider(in ComponentName admin, String packageName);
getCrossProfileWidgetProviders(in ComponentName admin)195     List<String> getCrossProfileWidgetProviders(in ComponentName admin);
196 
setAutoTimeRequired(in ComponentName who, int userHandle, boolean required)197     void setAutoTimeRequired(in ComponentName who, int userHandle, boolean required);
getAutoTimeRequired()198     boolean getAutoTimeRequired();
199 
isRemovingAdmin(in ComponentName adminReceiver, int userHandle)200     boolean isRemovingAdmin(in ComponentName adminReceiver, int userHandle);
201 }
202