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 
19 import java.util.Date;
20 
21 public interface EnterprisePrivacyFeatureProvider {
22 
23     /**
24      * Returns whether the device is managed by a Device Owner app.
25      */
hasDeviceOwner()26     boolean hasDeviceOwner();
27 
28     /**
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      */
isInCompMode()32     boolean isInCompMode();
33 
34     /**
35      * Returns the name of the organization managing the device via a Device Owner app. If the
36      * device is not managed by a Device Owner app or the name of the managing organization was not
37      * set, returns {@code null}.
38      */
getDeviceOwnerOrganizationName()39     String getDeviceOwnerOrganizationName();
40 
41     /**
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}.
45      */
getDeviceOwnerDisclosure()46     CharSequence getDeviceOwnerDisclosure();
47 
48     /**
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      */
getLastSecurityLogRetrievalTime()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      */
getLastBugReportRequestTime()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      */
getLastNetworkLogRetrievalTime()64     Date getLastNetworkLogRetrievalTime();
65 
66     /**
67      * Returns whether security logging is currently enabled.
68      */
isSecurityLoggingEnabled()69     boolean isSecurityLoggingEnabled();
70 
71     /**
72      * Returns whether network logging is currently enabled.
73      */
isNetworkLoggingEnabled()74     boolean isNetworkLoggingEnabled();
75 
76     /**
77      * Returns whether the Device Owner or Profile Owner in the current user set an always-on VPN.
78      */
isAlwaysOnVpnSetInCurrentUser()79     boolean isAlwaysOnVpnSetInCurrentUser();
80 
81     /**
82      * Returns whether the Profile Owner in the current user's managed profile (if any) set an
83      * always-on VPN.
84      */
isAlwaysOnVpnSetInManagedProfile()85     boolean isAlwaysOnVpnSetInManagedProfile();
86 
87     /**
88      * Returns whether the Device Owner set a recommended global HTTP proxy.
89      */
isGlobalHttpProxySet()90     boolean isGlobalHttpProxySet();
91 
92     /**
93      * Returns the number of failed login attempts that the Device Owner or Profile Owner allows
94      * before the current user is wiped, or zero if no such limit is set.
95      */
getMaximumFailedPasswordsBeforeWipeInCurrentUser()96     int getMaximumFailedPasswordsBeforeWipeInCurrentUser();
97 
98     /**
99      * Returns the number of failed login attempts that the Profile Owner allows before the current
100      * user's managed profile (if any) is wiped, or zero if no such limit is set.
101      */
getMaximumFailedPasswordsBeforeWipeInManagedProfile()102     int getMaximumFailedPasswordsBeforeWipeInManagedProfile();
103 
104     /**
105      * Returns the label of the current user's input method if that input method was set by a Device
106      * Owner or Profile Owner in that user. Otherwise, returns {@code null}.
107      */
getImeLabelIfOwnerSet()108     String getImeLabelIfOwnerSet();
109 
110     /**
111      * Returns the number of CA certificates that the Device Owner or Profile Owner installed in
112      * the current user and the user's managed profile (if any).
113      */
getNumberOfOwnerInstalledCaCertsForCurrentUserAndManagedProfile()114     int getNumberOfOwnerInstalledCaCertsForCurrentUserAndManagedProfile();
115 
116     /**
117      * Returns the number of Device Admin apps active in the current user and the user's managed
118      * profile (if any).
119      */
getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile()120     int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile();
121 }
122