blob: 4ad0f2e796c0d034e812e35d170cecc3907a6ee6 [file] [log] [blame]
Bartosz Fabianowski05061fc2016-11-14 12:04:49 +01001/*
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
17package com.android.settings.enterprise;
18
Bartosz Fabianowski2e0b6082016-11-28 21:13:30 +010019import java.util.Date;
20
Bartosz Fabianowski05061fc2016-11-14 12:04:49 +010021public interface EnterprisePrivacyFeatureProvider {
Bartosz Fabianowski2e0b6082016-11-28 21:13:30 +010022
23 /**
24 * Returns whether the device is managed by a Device Owner app.
25 */
Bartosz Fabianowski05061fc2016-11-14 12:04:49 +010026 boolean hasDeviceOwner();
Bartosz Fabianowski2e0b6082016-11-28 21:13:30 +010027
28 /**
Bartosz Fabianowskifc018e42017-01-09 12:05:59 +010029 * 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 Fabianowskiba66a0e2017-03-10 15:47:14 +010035 * 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 Fabianowskiccd4fa8e2017-01-17 12:42:35 +010042 * 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 Fabianowskiccd4fa8e2017-01-17 12:42:35 +010045 */
Bartosz Fabianowski2700cdb2017-02-17 13:30:32 +010046 CharSequence getDeviceOwnerDisclosure();
Bartosz Fabianowskiccd4fa8e2017-01-17 12:42:35 +010047
48 /**
Bartosz Fabianowski2e0b6082016-11-28 21:13:30 +010049 * 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 Fabianowskifc018e42017-01-09 12:05:59 +010065
66 /**
Bartosz Fabianowski92901842017-03-24 11:28:09 +010067 * 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 Fabianowskifc018e42017-01-09 12:05:59 +010077 * 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 Fabianowski0d226802017-01-11 13:22:52 +010085
86 /**
87 * Returns whether the Device Owner set a recommended global HTTP proxy.
88 */
89 boolean isGlobalHttpProxySet();
Bartosz Fabianowski8903f662017-02-14 11:45:20 +010090
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 Fabianowski2700cdb2017-02-17 13:30:32 +0100102
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 Fabianowski732d6952017-03-06 18:42:25 +0100108
109 /**
110 * Returns the number of CA certificates that the Device Owner or Profile Owner installed in
Bartosz Fabianowski4a196252017-03-21 13:57:27 +0100111 * the current user and the user's managed profile (if any).
Bartosz Fabianowski732d6952017-03-06 18:42:25 +0100112 */
Bartosz Fabianowski4a196252017-03-21 13:57:27 +0100113 int getNumberOfOwnerInstalledCaCertsForCurrentUserAndManagedProfile();
Bartosz Fabianowskiba66a0e2017-03-10 15:47:14 +0100114
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 Fabianowski05061fc2016-11-14 12:04:49 +0100120}