blob: 811958550ededd5f1324a834633833035d27ac9d [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;
Sander Alewijnsef475ca32014-02-17 15:13:58 +000021import android.content.IntentFilter;
Dianne Hackborn8ea138c2010-01-26 18:01:04 -080022import android.os.RemoteCallback;
Dianne Hackbornd6847842010-01-12 18:14:19 -080023
24/**
25 * Internal IPC interface to the device policy service.
26 * {@hide}
27 */
28interface IDevicePolicyManager {
Amith Yamasani599dd7c2012-09-14 23:20:08 -070029 void setPasswordQuality(in ComponentName who, int quality, int userHandle);
30 int getPasswordQuality(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070031
Amith Yamasani599dd7c2012-09-14 23:20:08 -070032 void setPasswordMinimumLength(in ComponentName who, int length, int userHandle);
33 int getPasswordMinimumLength(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070034
Amith Yamasani599dd7c2012-09-14 23:20:08 -070035 void setPasswordMinimumUpperCase(in ComponentName who, int length, int userHandle);
36 int getPasswordMinimumUpperCase(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070037
Amith Yamasani599dd7c2012-09-14 23:20:08 -070038 void setPasswordMinimumLowerCase(in ComponentName who, int length, int userHandle);
39 int getPasswordMinimumLowerCase(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070040
Amith Yamasani599dd7c2012-09-14 23:20:08 -070041 void setPasswordMinimumLetters(in ComponentName who, int length, int userHandle);
42 int getPasswordMinimumLetters(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070043
Amith Yamasani599dd7c2012-09-14 23:20:08 -070044 void setPasswordMinimumNumeric(in ComponentName who, int length, int userHandle);
45 int getPasswordMinimumNumeric(in ComponentName who, int userHandle);
Konstantin Lopyreva15dcfa2010-05-24 17:10:56 -070046
Amith Yamasani599dd7c2012-09-14 23:20:08 -070047 void setPasswordMinimumSymbols(in ComponentName who, int length, int userHandle);
48 int getPasswordMinimumSymbols(in ComponentName who, int userHandle);
Konstantin Lopyrevc8577402010-06-04 17:15:02 -070049
Amith Yamasani599dd7c2012-09-14 23:20:08 -070050 void setPasswordMinimumNonLetter(in ComponentName who, int length, int userHandle);
51 int getPasswordMinimumNonLetter(in ComponentName who, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070052
Amith Yamasani599dd7c2012-09-14 23:20:08 -070053 void setPasswordHistoryLength(in ComponentName who, int length, int userHandle);
54 int getPasswordHistoryLength(in ComponentName who, int userHandle);
Konstantin Lopyrev32558232010-05-20 16:18:05 -070055
Amith Yamasani599dd7c2012-09-14 23:20:08 -070056 void setPasswordExpirationTimeout(in ComponentName who, long expiration, int userHandle);
57 long getPasswordExpirationTimeout(in ComponentName who, int userHandle);
Jim Millera4e28d12010-11-08 16:15:47 -080058
Amith Yamasani599dd7c2012-09-14 23:20:08 -070059 long getPasswordExpiration(in ComponentName who, int userHandle);
Jim Millera4e28d12010-11-08 16:15:47 -080060
Amith Yamasani599dd7c2012-09-14 23:20:08 -070061 boolean isActivePasswordSufficient(int userHandle);
62 int getCurrentFailedPasswordAttempts(int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070063
Amith Yamasani599dd7c2012-09-14 23:20:08 -070064 void setMaximumFailedPasswordsForWipe(in ComponentName admin, int num, int userHandle);
65 int getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070066
Amith Yamasani599dd7c2012-09-14 23:20:08 -070067 boolean resetPassword(String password, int flags, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070068
Amith Yamasani599dd7c2012-09-14 23:20:08 -070069 void setMaximumTimeToLock(in ComponentName who, long timeMs, int userHandle);
70 long getMaximumTimeToLock(in ComponentName who, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070071
Dianne Hackborndf83afa2010-01-20 13:37:26 -080072 void lockNow();
Jim Millerb8ec4702012-08-31 17:19:10 -070073
Amith Yamasani599dd7c2012-09-14 23:20:08 -070074 void wipeData(int flags, int userHandle);
Oscar Montemayor69238c62010-08-03 10:51:06 -070075
Amith Yamasani599dd7c2012-09-14 23:20:08 -070076 ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList, int userHandle);
77 ComponentName getGlobalProxyAdmin(int userHandle);
Andy Stadler7b0f8f02011-01-12 14:59:52 -080078
Amith Yamasani599dd7c2012-09-14 23:20:08 -070079 int setStorageEncryption(in ComponentName who, boolean encrypt, int userHandle);
80 boolean getStorageEncryption(in ComponentName who, int userHandle);
81 int getStorageEncryptionStatus(int userHandle);
Andy Stadler7b0f8f02011-01-12 14:59:52 -080082
Amith Yamasani599dd7c2012-09-14 23:20:08 -070083 void setCameraDisabled(in ComponentName who, boolean disabled, int userHandle);
84 boolean getCameraDisabled(in ComponentName who, int userHandle);
Ben Komalo2447edd2011-05-09 16:05:33 -070085
Jim Miller48b9b0d2012-09-19 23:16:50 -070086 void setKeyguardDisabledFeatures(in ComponentName who, int which, int userHandle);
87 int getKeyguardDisabledFeatures(in ComponentName who, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070088
Amith Yamasani599dd7c2012-09-14 23:20:08 -070089 void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle);
90 boolean isAdminActive(in ComponentName policyReceiver, int userHandle);
91 List<ComponentName> getActiveAdmins(int userHandle);
92 boolean packageHasActiveAdmins(String packageName, int userHandle);
93 void getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle);
94 void removeActiveAdmin(in ComponentName policyReceiver, int userHandle);
95 boolean hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle);
Jim Millerb8ec4702012-08-31 17:19:10 -070096
Konstantin Lopyrevc8577402010-06-04 17:15:02 -070097 void setActivePasswordState(int quality, int length, int letters, int uppercase, int lowercase,
Amith Yamasani599dd7c2012-09-14 23:20:08 -070098 int numbers, int symbols, int nonletter, int userHandle);
99 void reportFailedPasswordAttempt(int userHandle);
100 void reportSuccessfulPasswordAttempt(int userHandle);
Amith Yamasani71e6c692013-03-24 17:39:28 -0700101
Geoffrey Borggaard334c7e32013-08-08 14:31:36 -0400102 boolean setDeviceOwner(String packageName, String ownerName);
Amith Yamasani71e6c692013-03-24 17:39:28 -0700103 boolean isDeviceOwner(String packageName);
104 String getDeviceOwner();
Geoffrey Borggaard334c7e32013-08-08 14:31:36 -0400105 String getDeviceOwnerName();
Maggie Benthallda51e682013-08-08 22:35:44 -0400106
Adam Connors776c5552014-01-09 10:42:56 +0000107 boolean setProfileOwner(String packageName, String ownerName, int userHandle);
108 String getProfileOwner(int userHandle);
109 String getProfileOwnerName(int userHandle);
110
Maggie Benthallda51e682013-08-08 22:35:44 -0400111 boolean installCaCert(in byte[] certBuffer);
112 void uninstallCaCert(in byte[] certBuffer);
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000113
114 void addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity);
115 void clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName);
Dianne Hackbornd6847842010-01-12 18:14:19 -0800116}