blob: 7502e1d56fe04f5859c5bf159a01399ee66a1af6 [file] [log] [blame]
Dianne Hackbornd6847842010-01-12 18:14:19 -08001/*
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
Dianne Hackborn87bba1e2010-02-26 17:25:54 -080018package android.app.admin;
Dianne Hackbornd6847842010-01-12 18:14:19 -080019
20import android.content.ComponentName;
Adam Connors010cfd42014-04-16 12:48:13 +010021import android.content.Intent;
Sander Alewijnsef475ca32014-02-17 15:13:58 +000022import android.content.IntentFilter;
Julia Reynoldsfca04ca2015-02-17 13:39:12 -050023import android.graphics.Bitmap;
Jason Monk03bc9912014-05-13 09:44:57 -040024import android.net.ProxyInfo;
Robin Lee66e5d962014-04-09 16:44:21 +010025import android.os.Bundle;
Jim Millere303bf42014-08-26 17:12:29 -070026import android.os.PersistableBundle;
Dianne Hackborn8ea138c2010-01-26 18:01:04 -080027import android.os.RemoteCallback;
Julia Reynolds1e958392014-05-16 14:25:21 -040028import android.os.UserHandle;
Kenny Guyfa80a4f2014-08-20 19:40:59 +010029import java.util.List;
Dianne Hackbornd6847842010-01-12 18:14:19 -080030
31/**
32 * Internal IPC interface to the device policy service.
33 * {@hide}
34 */
35interface IDevicePolicyManager {
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080036 void setPasswordQuality(in ComponentName who, int quality);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070037 int getPasswordQuality(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070038
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080039 void setPasswordMinimumLength(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070040 int getPasswordMinimumLength(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070041
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080042 void setPasswordMinimumUpperCase(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070043 int getPasswordMinimumUpperCase(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070044
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080045 void setPasswordMinimumLowerCase(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070046 int getPasswordMinimumLowerCase(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070047
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080048 void setPasswordMinimumLetters(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070049 int getPasswordMinimumLetters(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070050
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080051 void setPasswordMinimumNumeric(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070052 int getPasswordMinimumNumeric(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070053
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080054 void setPasswordMinimumSymbols(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070055 int getPasswordMinimumSymbols(in ComponentName who, int userHandle);
Konstantin Lopyrevc8577402010-06-04 17:15:02 -070056
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080057 void setPasswordMinimumNonLetter(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070058 int getPasswordMinimumNonLetter(in ComponentName who, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070059
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080060 void setPasswordHistoryLength(in ComponentName who, int length);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070061 int getPasswordHistoryLength(in ComponentName who, int userHandle);
Konstantin Lopyrev32558232010-05-20 16:18:05 -070062
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080063 void setPasswordExpirationTimeout(in ComponentName who, long expiration);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070064 long getPasswordExpirationTimeout(in ComponentName who, int userHandle);
Jim Millera4e28d12010-11-08 16:15:47 -080065
Amith Yamasani599dd7c2012-09-14 23:20:08 -070066 long getPasswordExpiration(in ComponentName who, int userHandle);
Jim Millera4e28d12010-11-08 16:15:47 -080067
Amith Yamasani599dd7c2012-09-14 23:20:08 -070068 boolean isActivePasswordSufficient(int userHandle);
69 int getCurrentFailedPasswordAttempts(int userHandle);
Amith Yamasani3a3d2122014-10-29 11:41:31 -070070 int getProfileWithMinimumFailedPasswordsForWipe(int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070071
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080072 void setMaximumFailedPasswordsForWipe(in ComponentName admin, int num);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070073 int getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070074
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080075 boolean resetPassword(String password, int flags);
Jim Millerb8ec4702012-08-31 17:19:10 -070076
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080077 void setMaximumTimeToLock(in ComponentName who, long timeMs);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070078 long getMaximumTimeToLock(in ComponentName who, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070079
Dianne Hackborndf83afa2010-01-20 13:37:26 -080080 void lockNow();
Jim Millerb8ec4702012-08-31 17:19:10 -070081
Amith Yamasani599dd7c2012-09-14 23:20:08 -070082 void wipeData(int flags, int userHandle);
Oscar Montemayor69238c62010-08-03 10:51:06 -070083
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080084 ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070085 ComponentName getGlobalProxyAdmin(int userHandle);
Jason Monk03bc9912014-05-13 09:44:57 -040086 void setRecommendedGlobalProxy(in ComponentName admin, in ProxyInfo proxyInfo);
Andy Stadler7b0f8f02011-01-12 14:59:52 -080087
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080088 int setStorageEncryption(in ComponentName who, boolean encrypt);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070089 boolean getStorageEncryption(in ComponentName who, int userHandle);
90 int getStorageEncryptionStatus(int userHandle);
Andy Stadler7b0f8f02011-01-12 14:59:52 -080091
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080092 void setCameraDisabled(in ComponentName who, boolean disabled);
Amith Yamasani599dd7c2012-09-14 23:20:08 -070093 boolean getCameraDisabled(in ComponentName who, int userHandle);
Ben Komalo2447edd2011-05-09 16:05:33 -070094
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080095 void setScreenCaptureDisabled(in ComponentName who, boolean disabled);
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +010096 boolean getScreenCaptureDisabled(in ComponentName who, int userHandle);
97
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -080098 void setKeyguardDisabledFeatures(in ComponentName who, int which);
Jim Miller48b9b0d2012-09-19 23:16:50 -070099 int getKeyguardDisabledFeatures(in ComponentName who, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -0700100
Amith Yamasani599dd7c2012-09-14 23:20:08 -0700101 void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle);
102 boolean isAdminActive(in ComponentName policyReceiver, int userHandle);
103 List<ComponentName> getActiveAdmins(int userHandle);
104 boolean packageHasActiveAdmins(String packageName, int userHandle);
105 void getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle);
106 void removeActiveAdmin(in ComponentName policyReceiver, int userHandle);
107 boolean hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -0700108
Konstantin Lopyrevc8577402010-06-04 17:15:02 -0700109 void setActivePasswordState(int quality, int length, int letters, int uppercase, int lowercase,
Amith Yamasani599dd7c2012-09-14 23:20:08 -0700110 int numbers, int symbols, int nonletter, int userHandle);
111 void reportFailedPasswordAttempt(int userHandle);
112 void reportSuccessfulPasswordAttempt(int userHandle);
Amith Yamasani71e6c692013-03-24 17:39:28 -0700113
Geoffrey Borggaard334c7e32013-08-08 14:31:36 -0400114 boolean setDeviceOwner(String packageName, String ownerName);
Amith Yamasani71e6c692013-03-24 17:39:28 -0700115 boolean isDeviceOwner(String packageName);
116 String getDeviceOwner();
Geoffrey Borggaard334c7e32013-08-08 14:31:36 -0400117 String getDeviceOwnerName();
Jason Monkb0dced82014-06-06 14:36:20 -0400118 void clearDeviceOwner(String packageName);
Maggie Benthallda51e682013-08-08 22:35:44 -0400119
Amith Yamasanibf3a9462014-07-28 14:26:42 -0700120 boolean setProfileOwner(in ComponentName who, String ownerName, int userHandle);
121 ComponentName getProfileOwner(int userHandle);
Adam Connors776c5552014-01-09 10:42:56 +0000122 String getProfileOwnerName(int userHandle);
Alexandra Gherghina512675b2014-04-02 11:23:54 +0100123 void setProfileEnabled(in ComponentName who);
Jessica Hummel1333ea12014-06-23 11:20:10 +0100124 void setProfileName(in ComponentName who, String profileName);
Amith Yamasanibf3a9462014-07-28 14:26:42 -0700125 void clearProfileOwner(in ComponentName who);
126 boolean hasUserSetupCompleted();
Adam Connors776c5552014-01-09 10:42:56 +0000127
Robin Lee306fe082014-06-19 14:04:24 +0000128 boolean installCaCert(in ComponentName admin, in byte[] certBuffer);
129 void uninstallCaCert(in ComponentName admin, in String alias);
Esteban Talavera808f6ef2014-08-28 17:15:54 +0100130 void enforceCanManageCaCerts(in ComponentName admin);
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000131
Bernhard Bauer26408cc2014-09-08 14:07:31 +0100132 boolean installKeyPair(in ComponentName who, in byte[] privKeyBuffer, in byte[] certBuffer, String alias);
Robin Leeabf35702015-02-17 14:12:48 +0000133 void choosePrivateKeyAlias(int uid, in String host, int port, in String url, in String alias, IBinder aliasCallback);
Bernhard Bauer26408cc2014-09-08 14:07:31 +0100134
Rubin Xuec32b562015-03-03 17:34:05 +0000135 void setCertInstallerPackage(in ComponentName who, String installerPackage);
136 String getCertInstallerPackage(in ComponentName who);
137
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000138 void addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity);
139 void clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName);
Robin Lee66e5d962014-04-09 16:44:21 +0100140
141 void setApplicationRestrictions(in ComponentName who, in String packageName, in Bundle settings);
142 Bundle getApplicationRestrictions(in ComponentName who, in String packageName);
Amith Yamasanibe465322014-04-24 13:45:17 -0700143
Amith Yamasanif20d6402014-05-24 15:34:37 -0700144 void setRestrictionsProvider(in ComponentName who, in ComponentName provider);
145 ComponentName getRestrictionsProvider(int userHandle);
146
Amith Yamasanibe465322014-04-24 13:45:17 -0700147 void setUserRestriction(in ComponentName who, in String key, boolean enable);
Nicolas Prevot81948992014-05-16 18:25:26 +0100148 void addCrossProfileIntentFilter(in ComponentName admin, in IntentFilter filter, int flags);
149 void clearCrossProfileIntentFilters(in ComponentName admin);
Adam Connors010cfd42014-04-16 12:48:13 +0100150
Kenny Guyfa80a4f2014-08-20 19:40:59 +0100151 boolean setPermittedAccessibilityServices(in ComponentName admin,in List packageList);
152 List getPermittedAccessibilityServices(in ComponentName admin);
153 List getPermittedAccessibilityServicesForUser(int userId);
154
155 boolean setPermittedInputMethods(in ComponentName admin,in List packageList);
156 List getPermittedInputMethods(in ComponentName admin);
157 List getPermittedInputMethodsForCurrentUser();
158
Amith Yamasanie5bcff62014-07-19 15:44:09 -0700159 boolean setApplicationHidden(in ComponentName admin, in String packageName, boolean hidden);
Amith Yamasanie5bcff62014-07-19 15:44:09 -0700160 boolean isApplicationHidden(in ComponentName admin, in String packageName);
Julia Reynolds966881e2014-05-14 12:23:08 -0400161
Julia Reynolds1e958392014-05-16 14:25:21 -0400162 UserHandle createUser(in ComponentName who, in String name);
Jason Monk03978a42014-06-10 15:05:30 -0400163 UserHandle createAndInitializeUser(in ComponentName who, in String name, in String profileOwnerName, in ComponentName profileOwnerComponent, in Bundle adminExtras);
Julia Reynolds1e958392014-05-16 14:25:21 -0400164 boolean removeUser(in ComponentName who, in UserHandle userHandle);
Jason Monk582d9112014-07-09 19:57:08 -0400165 boolean switchUser(in ComponentName who, in UserHandle userHandle);
Julia Reynolds1e958392014-05-16 14:25:21 -0400166
Adam Connors655be2a2014-07-14 09:01:25 +0000167 void enableSystemApp(in ComponentName admin, in String packageName);
168 int enableSystemAppWithIntent(in ComponentName admin, in Intent intent);
169
Sander Alewijnse5c02db62014-05-07 10:46:57 +0100170 void setAccountManagementDisabled(in ComponentName who, in String accountType, in boolean disabled);
171 String[] getAccountTypesWithManagementDisabled();
Alexandra Gherghina999d3942014-07-03 11:40:08 +0100172 String[] getAccountTypesWithManagementDisabledAsUser(int userId);
justinzhang511e0d82014-03-24 16:09:24 -0400173
Jason Monk48aacba2014-08-13 16:29:08 -0400174 void setLockTaskPackages(in ComponentName who, in String[] packages);
175 String[] getLockTaskPackages(in ComponentName who);
Jason Monkd7b86212014-06-16 13:15:38 -0400176 boolean isLockTaskPermitted(in String pkg);
Julia Reynoldsda551652014-05-14 17:15:16 -0400177
178 void setGlobalSetting(in ComponentName who, in String setting, in String value);
179 void setSecureSetting(in ComponentName who, in String setting, in String value);
Julia Reynolds4a21b252014-06-04 11:11:43 -0400180
181 void setMasterVolumeMuted(in ComponentName admin, boolean on);
182 boolean isMasterVolumeMuted(in ComponentName admin);
Jason Monk35c62a42014-06-17 10:24:47 -0400183
184 void notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId);
Kenny Guyc13053b2014-05-29 14:17:17 +0100185
Esteban Talaverad5c5c132014-08-20 11:35:57 +0100186 void setUninstallBlocked(in ComponentName admin, in String packageName, boolean uninstallBlocked);
Esteban Talavera729b2a62014-08-27 18:01:58 +0100187 boolean isUninstallBlocked(in ComponentName admin, in String packageName);
Adam Connors210fe212014-07-17 15:41:43 +0100188
189 void setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled);
190 boolean getCrossProfileCallerIdDisabled(in ComponentName who);
191 boolean getCrossProfileCallerIdDisabledForUser(int userId);
Makoto Onuki1040da12015-03-19 11:24:00 -0700192 void startManagedQuickContact(String lookupKey, long contactId, in Intent originalIntent);
Jim Miller604e7552014-07-18 19:00:02 -0700193
Ricky Wai778ba132015-03-31 14:21:22 +0100194 void setBluetoothContactSharingDisabled(in ComponentName who, boolean disabled);
195 boolean getBluetoothContactSharingDisabled(in ComponentName who);
196 boolean getBluetoothContactSharingDisabledForUser(int userId);
197
Jim Millere303bf42014-08-26 17:12:29 -0700198 void setTrustAgentConfiguration(in ComponentName admin, in ComponentName agent,
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -0800199 in PersistableBundle args);
Jim Millere303bf42014-08-26 17:12:29 -0700200 List<PersistableBundle> getTrustAgentConfiguration(in ComponentName admin,
201 in ComponentName agent, int userId);
Jim Miller604e7552014-07-18 19:00:02 -0700202
Svetoslav976e8bd2014-07-16 15:12:03 -0700203 boolean addCrossProfileWidgetProvider(in ComponentName admin, String packageName);
204 boolean removeCrossProfileWidgetProvider(in ComponentName admin, String packageName);
205 List<String> getCrossProfileWidgetProviders(in ComponentName admin);
Sander Alewijnse0ced6272014-08-26 11:18:26 +0100206
Fyodor Kupolovbdc58c62015-01-29 13:24:03 -0800207 void setAutoTimeRequired(in ComponentName who, boolean required);
Sander Alewijnse0ced6272014-08-26 11:18:26 +0100208 boolean getAutoTimeRequired();
Fyodor Kupolov96fb9322014-12-01 15:08:09 -0800209
210 boolean isRemovingAdmin(in ComponentName adminReceiver, int userHandle);
Julia Reynolds20118f12015-02-11 12:34:08 -0500211
212 boolean setUserEnabled(in ComponentName who);
213 boolean isDeviceInitializer(String packageName);
Julia Reynolds1c3754a2015-03-05 10:06:41 -0500214 void clearDeviceInitializer(in ComponentName who);
Julia Reynolds20118f12015-02-11 12:34:08 -0500215 boolean setDeviceInitializer(in ComponentName who, in ComponentName initializer, String initializerName);
216 String getDeviceInitializer();
Julia Reynoldseaafdf722015-04-02 08:49:47 -0400217 ComponentName getDeviceInitializerComponent();
Julia Reynoldsfca04ca2015-02-17 13:39:12 -0500218
219 void setUserIcon(in ComponentName admin, in Bitmap icon);
Craig Lafayettedbe31a62015-04-02 13:14:39 -0400220
221 void sendDeviceInitializerStatus(int statusCode, String description);
Rubin Xu8027a4f2015-03-10 17:52:37 +0000222 void setOtaPolicy(in ComponentName who, in PersistableBundle policy);
223 PersistableBundle getOtaPolicy();
Benjamin Franze36087e2015-04-07 16:40:34 +0100224
225 boolean setKeyguardEnabledState(in ComponentName admin, boolean enabled);
Benjamin Franzea2ec972015-03-16 17:18:09 +0000226 void setStatusBarEnabledState(in ComponentName who, boolean enabled);
Dianne Hackbornd6847842010-01-12 18:14:19 -0800227}