Bartosz Fabianowski | 05061fc | 2016-11-14 12:04:49 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.settings.enterprise; |
| 18 | |
Bartosz Fabianowski | 2e0b608 | 2016-11-28 21:13:30 +0100 | [diff] [blame] | 19 | import java.util.Date; |
| 20 | |
Bartosz Fabianowski | 05061fc | 2016-11-14 12:04:49 +0100 | [diff] [blame] | 21 | public interface EnterprisePrivacyFeatureProvider { |
Bartosz Fabianowski | 2e0b608 | 2016-11-28 21:13:30 +0100 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Returns whether the device is managed by a Device Owner app. |
| 25 | */ |
Bartosz Fabianowski | 05061fc | 2016-11-14 12:04:49 +0100 | [diff] [blame] | 26 | boolean hasDeviceOwner(); |
Bartosz Fabianowski | 2e0b608 | 2016-11-28 21:13:30 +0100 | [diff] [blame] | 27 | |
| 28 | /** |
Bartosz Fabianowski | fc018e4 | 2017-01-09 12:05:59 +0100 | [diff] [blame] | 29 | * Returns whether the device is in COMP mode (primary user managed by a Device Owner app and |
| 30 | * work profile managed by a Profile Owner app). |
| 31 | */ |
| 32 | boolean isInCompMode(); |
| 33 | |
| 34 | /** |
Bartosz Fabianowski | ba66a0e | 2017-03-10 15:47:14 +0100 | [diff] [blame] | 35 | * Returns the name of the organization managing the device via a Device Owner app. If the device |
| 36 | * is not managed by a Device Owner app or the name of the managing organization was not set, |
| 37 | * returns {@code null}. |
| 38 | */ |
| 39 | String getDeviceOwnerOrganizationName(); |
| 40 | |
| 41 | /** |
Bartosz Fabianowski | ccd4fa8e | 2017-01-17 12:42:35 +0100 | [diff] [blame] | 42 | * Returns a message informing the user that the device is managed by a Device Owner app. The |
| 43 | * message includes a Learn More link that takes the user to the enterprise privacy section of |
| 44 | * Settings. If the device is not managed by a Device Owner app, returns {@code null}. |
Bartosz Fabianowski | ccd4fa8e | 2017-01-17 12:42:35 +0100 | [diff] [blame] | 45 | */ |
Bartosz Fabianowski | 2700cdb | 2017-02-17 13:30:32 +0100 | [diff] [blame] | 46 | CharSequence getDeviceOwnerDisclosure(); |
Bartosz Fabianowski | ccd4fa8e | 2017-01-17 12:42:35 +0100 | [diff] [blame] | 47 | |
| 48 | /** |
Bartosz Fabianowski | 2e0b608 | 2016-11-28 21:13:30 +0100 | [diff] [blame] | 49 | * Returns the time at which the Device Owner last retrieved security logs, or {@code null} if |
| 50 | * logs were never retrieved by the Device Owner on this device. |
| 51 | */ |
| 52 | Date getLastSecurityLogRetrievalTime(); |
| 53 | |
| 54 | /** |
| 55 | * Returns the time at which the Device Owner last requested a bug report, or {@code null} if no |
| 56 | * bug report was ever requested by the Device Owner on this device. |
| 57 | */ |
| 58 | Date getLastBugReportRequestTime(); |
| 59 | |
| 60 | /** |
| 61 | * Returns the time at which the Device Owner last retrieved network logs, or {@code null} if |
| 62 | * logs were never retrieved by the Device Owner on this device. |
| 63 | */ |
| 64 | Date getLastNetworkLogRetrievalTime(); |
Bartosz Fabianowski | fc018e4 | 2017-01-09 12:05:59 +0100 | [diff] [blame] | 65 | |
| 66 | /** |
Bartosz Fabianowski | 9290184 | 2017-03-24 11:28:09 +0100 | [diff] [blame] | 67 | * Returns whether security logging is currently enabled. |
| 68 | */ |
| 69 | boolean isSecurityLoggingEnabled(); |
| 70 | |
| 71 | /** |
| 72 | * Returns whether network logging is currently enabled. |
| 73 | */ |
| 74 | boolean isNetworkLoggingEnabled(); |
| 75 | |
| 76 | /** |
Bartosz Fabianowski | fc018e4 | 2017-01-09 12:05:59 +0100 | [diff] [blame] | 77 | * Returns whether the Device Owner in the primary user set an always-on VPN. |
| 78 | */ |
| 79 | boolean isAlwaysOnVpnSetInPrimaryUser(); |
| 80 | |
| 81 | /** |
| 82 | * Returns whether the Profile Owner in the managed profile (if any) set an always-on VPN. |
| 83 | */ |
| 84 | boolean isAlwaysOnVpnSetInManagedProfile(); |
Bartosz Fabianowski | 0d22680 | 2017-01-11 13:22:52 +0100 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Returns whether the Device Owner set a recommended global HTTP proxy. |
| 88 | */ |
| 89 | boolean isGlobalHttpProxySet(); |
Bartosz Fabianowski | 8903f66 | 2017-02-14 11:45:20 +0100 | [diff] [blame] | 90 | |
| 91 | /** |
| 92 | * Returns the number of failed login attempts that the Device Owner allows before the entire |
| 93 | * device is wiped, or zero if no such limit is set. |
| 94 | */ |
| 95 | int getMaximumFailedPasswordsBeforeWipeInPrimaryUser(); |
| 96 | |
| 97 | /** |
| 98 | * Returns the number of failed login attempts that the Profile Owner allows before the current |
| 99 | * user's managed profile (if any) is wiped, or zero if no such limit is set. |
| 100 | */ |
| 101 | int getMaximumFailedPasswordsBeforeWipeInManagedProfile(); |
Bartosz Fabianowski | 2700cdb | 2017-02-17 13:30:32 +0100 | [diff] [blame] | 102 | |
| 103 | /** |
| 104 | * Returns the label of the current user's input method if that input method was set by a Device |
| 105 | * Owner or Profile Owner in that user. Otherwise, returns {@code null}. |
| 106 | */ |
| 107 | String getImeLabelIfOwnerSet(); |
Bartosz Fabianowski | 732d695 | 2017-03-06 18:42:25 +0100 | [diff] [blame] | 108 | |
| 109 | /** |
| 110 | * Returns the number of CA certificates that the Device Owner or Profile Owner installed in |
Bartosz Fabianowski | 4a19625 | 2017-03-21 13:57:27 +0100 | [diff] [blame] | 111 | * the current user and the user's managed profile (if any). |
Bartosz Fabianowski | 732d695 | 2017-03-06 18:42:25 +0100 | [diff] [blame] | 112 | */ |
Bartosz Fabianowski | 4a19625 | 2017-03-21 13:57:27 +0100 | [diff] [blame] | 113 | int getNumberOfOwnerInstalledCaCertsForCurrentUserAndManagedProfile(); |
Bartosz Fabianowski | ba66a0e | 2017-03-10 15:47:14 +0100 | [diff] [blame] | 114 | |
| 115 | /** |
| 116 | * Returns the number of Device Admin apps active in the current user and the user's managed |
| 117 | * profile (if any). |
| 118 | */ |
| 119 | int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile(); |
Bartosz Fabianowski | 05061fc | 2016-11-14 12:04:49 +0100 | [diff] [blame] | 120 | } |