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 the number of failed login attempts that the Device Owner or Profile Owner allows 89 * before the current user is wiped, or zero if no such limit is set. 90 */ getMaximumFailedPasswordsBeforeWipeInCurrentUser()91 int getMaximumFailedPasswordsBeforeWipeInCurrentUser(); 92 93 /** 94 * Returns the number of failed login attempts that the Profile Owner allows before the current 95 * user's managed profile (if any) is wiped, or zero if no such limit is set. 96 */ getMaximumFailedPasswordsBeforeWipeInManagedProfile()97 int getMaximumFailedPasswordsBeforeWipeInManagedProfile(); 98 99 /** 100 * Returns the label of the current user's input method if that input method was set by a Device 101 * Owner or Profile Owner in that user. Otherwise, returns {@code null}. 102 */ getImeLabelIfOwnerSet()103 String getImeLabelIfOwnerSet(); 104 105 /** 106 * Returns the number of CA certificates that the Device Owner or Profile Owner installed in 107 * current user. 108 */ getNumberOfOwnerInstalledCaCertsForCurrentUser()109 int getNumberOfOwnerInstalledCaCertsForCurrentUser(); 110 111 /** 112 * Returns the number of CA certificates that the Device Owner or Profile Owner installed in 113 * the current user's managed profile (if any). 114 */ getNumberOfOwnerInstalledCaCertsForManagedProfile()115 int getNumberOfOwnerInstalledCaCertsForManagedProfile(); 116 117 /** 118 * Returns the number of Device Admin apps active in the current user and the user's managed 119 * profile (if any). 120 */ getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile()121 int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile(); 122 123 /** 124 * Returns {@code true} if it is possilbe to resolve an Intent to launch the "Your work policy 125 * info" page provided by the active Device Owner or Profile Owner app if it exists, {@code 126 * false} otherwise. 127 */ hasWorkPolicyInfo()128 boolean hasWorkPolicyInfo(); 129 130 /** 131 * Launches the Device Owner or Profile Owner's activity that displays the "Your work policy 132 * info" page. Returns {@code true} if the activity has indeed been launched. 133 */ showWorkPolicyInfo()134 boolean showWorkPolicyInfo(); 135 136 /** 137 * Launches the parental controls settings page. Returns {@code true} if the activity has 138 * been launched. 139 */ showParentalControls()140 boolean showParentalControls(); 141 } 142