Dianne Hackborn | d684784 | 2010-01-12 18:14:19 -0800 | [diff] [blame] | 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 | |
Dianne Hackborn | 87bba1e | 2010-02-26 17:25:54 -0800 | [diff] [blame] | 18 | package android.app.admin; |
Dianne Hackborn | d684784 | 2010-01-12 18:14:19 -0800 | [diff] [blame] | 19 | |
| 20 | import android.content.ComponentName; |
Sander Alewijnse | f475ca3 | 2014-02-17 15:13:58 +0000 | [diff] [blame] | 21 | import android.content.IntentFilter; |
Robin Lee | 66e5d96 | 2014-04-09 16:44:21 +0100 | [diff] [blame] | 22 | import android.os.Bundle; |
Dianne Hackborn | 8ea138c | 2010-01-26 18:01:04 -0800 | [diff] [blame] | 23 | import android.os.RemoteCallback; |
Dianne Hackborn | d684784 | 2010-01-12 18:14:19 -0800 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Internal IPC interface to the device policy service. |
| 27 | * {@hide} |
| 28 | */ |
| 29 | interface IDevicePolicyManager { |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 30 | void setPasswordQuality(in ComponentName who, int quality, int userHandle); |
| 31 | int getPasswordQuality(in ComponentName who, int userHandle); |
Konstantin Lopyrev | a15dcfa | 2010-05-24 17:10:56 -0700 | [diff] [blame] | 32 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 33 | void setPasswordMinimumLength(in ComponentName who, int length, int userHandle); |
| 34 | int getPasswordMinimumLength(in ComponentName who, int userHandle); |
Konstantin Lopyrev | a15dcfa | 2010-05-24 17:10:56 -0700 | [diff] [blame] | 35 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 36 | void setPasswordMinimumUpperCase(in ComponentName who, int length, int userHandle); |
| 37 | int getPasswordMinimumUpperCase(in ComponentName who, int userHandle); |
Konstantin Lopyrev | a15dcfa | 2010-05-24 17:10:56 -0700 | [diff] [blame] | 38 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 39 | void setPasswordMinimumLowerCase(in ComponentName who, int length, int userHandle); |
| 40 | int getPasswordMinimumLowerCase(in ComponentName who, int userHandle); |
Konstantin Lopyrev | a15dcfa | 2010-05-24 17:10:56 -0700 | [diff] [blame] | 41 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 42 | void setPasswordMinimumLetters(in ComponentName who, int length, int userHandle); |
| 43 | int getPasswordMinimumLetters(in ComponentName who, int userHandle); |
Konstantin Lopyrev | a15dcfa | 2010-05-24 17:10:56 -0700 | [diff] [blame] | 44 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 45 | void setPasswordMinimumNumeric(in ComponentName who, int length, int userHandle); |
| 46 | int getPasswordMinimumNumeric(in ComponentName who, int userHandle); |
Konstantin Lopyrev | a15dcfa | 2010-05-24 17:10:56 -0700 | [diff] [blame] | 47 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 48 | void setPasswordMinimumSymbols(in ComponentName who, int length, int userHandle); |
| 49 | int getPasswordMinimumSymbols(in ComponentName who, int userHandle); |
Konstantin Lopyrev | c857740 | 2010-06-04 17:15:02 -0700 | [diff] [blame] | 50 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 51 | void setPasswordMinimumNonLetter(in ComponentName who, int length, int userHandle); |
| 52 | int getPasswordMinimumNonLetter(in ComponentName who, int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 53 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 54 | void setPasswordHistoryLength(in ComponentName who, int length, int userHandle); |
| 55 | int getPasswordHistoryLength(in ComponentName who, int userHandle); |
Konstantin Lopyrev | 3255823 | 2010-05-20 16:18:05 -0700 | [diff] [blame] | 56 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 57 | void setPasswordExpirationTimeout(in ComponentName who, long expiration, int userHandle); |
| 58 | long getPasswordExpirationTimeout(in ComponentName who, int userHandle); |
Jim Miller | a4e28d1 | 2010-11-08 16:15:47 -0800 | [diff] [blame] | 59 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 60 | long getPasswordExpiration(in ComponentName who, int userHandle); |
Jim Miller | a4e28d1 | 2010-11-08 16:15:47 -0800 | [diff] [blame] | 61 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 62 | boolean isActivePasswordSufficient(int userHandle); |
| 63 | int getCurrentFailedPasswordAttempts(int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 64 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 65 | void setMaximumFailedPasswordsForWipe(in ComponentName admin, int num, int userHandle); |
| 66 | int getMaximumFailedPasswordsForWipe(in ComponentName admin, int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 67 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 68 | boolean resetPassword(String password, int flags, int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 69 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 70 | void setMaximumTimeToLock(in ComponentName who, long timeMs, int userHandle); |
| 71 | long getMaximumTimeToLock(in ComponentName who, int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 72 | |
Dianne Hackborn | df83afa | 2010-01-20 13:37:26 -0800 | [diff] [blame] | 73 | void lockNow(); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 74 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 75 | void wipeData(int flags, int userHandle); |
Oscar Montemayor | 69238c6 | 2010-08-03 10:51:06 -0700 | [diff] [blame] | 76 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 77 | ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList, int userHandle); |
| 78 | ComponentName getGlobalProxyAdmin(int userHandle); |
Andy Stadler | 7b0f8f0 | 2011-01-12 14:59:52 -0800 | [diff] [blame] | 79 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 80 | int setStorageEncryption(in ComponentName who, boolean encrypt, int userHandle); |
| 81 | boolean getStorageEncryption(in ComponentName who, int userHandle); |
| 82 | int getStorageEncryptionStatus(int userHandle); |
Andy Stadler | 7b0f8f0 | 2011-01-12 14:59:52 -0800 | [diff] [blame] | 83 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 84 | void setCameraDisabled(in ComponentName who, boolean disabled, int userHandle); |
| 85 | boolean getCameraDisabled(in ComponentName who, int userHandle); |
Ben Komalo | 2447edd | 2011-05-09 16:05:33 -0700 | [diff] [blame] | 86 | |
Jim Miller | 48b9b0d | 2012-09-19 23:16:50 -0700 | [diff] [blame] | 87 | void setKeyguardDisabledFeatures(in ComponentName who, int which, int userHandle); |
| 88 | int getKeyguardDisabledFeatures(in ComponentName who, int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 89 | |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 90 | void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle); |
| 91 | boolean isAdminActive(in ComponentName policyReceiver, int userHandle); |
| 92 | List<ComponentName> getActiveAdmins(int userHandle); |
| 93 | boolean packageHasActiveAdmins(String packageName, int userHandle); |
| 94 | void getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle); |
| 95 | void removeActiveAdmin(in ComponentName policyReceiver, int userHandle); |
| 96 | boolean hasGrantedPolicy(in ComponentName policyReceiver, int usesPolicy, int userHandle); |
Jim Miller | b8ec470 | 2012-08-31 17:19:10 -0700 | [diff] [blame] | 97 | |
Konstantin Lopyrev | c857740 | 2010-06-04 17:15:02 -0700 | [diff] [blame] | 98 | void setActivePasswordState(int quality, int length, int letters, int uppercase, int lowercase, |
Amith Yamasani | 599dd7c | 2012-09-14 23:20:08 -0700 | [diff] [blame] | 99 | int numbers, int symbols, int nonletter, int userHandle); |
| 100 | void reportFailedPasswordAttempt(int userHandle); |
| 101 | void reportSuccessfulPasswordAttempt(int userHandle); |
Amith Yamasani | 71e6c69 | 2013-03-24 17:39:28 -0700 | [diff] [blame] | 102 | |
Geoffrey Borggaard | 334c7e3 | 2013-08-08 14:31:36 -0400 | [diff] [blame] | 103 | boolean setDeviceOwner(String packageName, String ownerName); |
Amith Yamasani | 71e6c69 | 2013-03-24 17:39:28 -0700 | [diff] [blame] | 104 | boolean isDeviceOwner(String packageName); |
| 105 | String getDeviceOwner(); |
Geoffrey Borggaard | 334c7e3 | 2013-08-08 14:31:36 -0400 | [diff] [blame] | 106 | String getDeviceOwnerName(); |
Maggie Benthall | da51e68 | 2013-08-08 22:35:44 -0400 | [diff] [blame] | 107 | |
Adam Connors | 776c555 | 2014-01-09 10:42:56 +0000 | [diff] [blame] | 108 | boolean setProfileOwner(String packageName, String ownerName, int userHandle); |
| 109 | String getProfileOwner(int userHandle); |
| 110 | String getProfileOwnerName(int userHandle); |
Alexandra Gherghina | 512675b | 2014-04-02 11:23:54 +0100 | [diff] [blame] | 111 | void setProfileEnabled(in ComponentName who); |
Alexandra Gherghina | 385124d | 2014-04-03 13:37:39 +0100 | [diff] [blame] | 112 | boolean isProfileEnabled(int userHandle); |
Adam Connors | 776c555 | 2014-01-09 10:42:56 +0000 | [diff] [blame] | 113 | |
Maggie Benthall | da51e68 | 2013-08-08 22:35:44 -0400 | [diff] [blame] | 114 | boolean installCaCert(in byte[] certBuffer); |
| 115 | void uninstallCaCert(in byte[] certBuffer); |
Sander Alewijnse | f475ca3 | 2014-02-17 15:13:58 +0000 | [diff] [blame] | 116 | |
| 117 | void addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity); |
| 118 | void clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName); |
Robin Lee | 66e5d96 | 2014-04-09 16:44:21 +0100 | [diff] [blame] | 119 | |
| 120 | void setApplicationRestrictions(in ComponentName who, in String packageName, in Bundle settings); |
| 121 | Bundle getApplicationRestrictions(in ComponentName who, in String packageName); |
Dianne Hackborn | d684784 | 2010-01-12 18:14:19 -0800 | [diff] [blame] | 122 | } |