1 /*
2  * Copyright (C) 2014 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 package com.android.systemui.statusbar.policy;
17 
18 import android.app.admin.DeviceAdminInfo;
19 import android.content.ComponentName;
20 import android.graphics.drawable.Drawable;
21 
22 import com.android.systemui.Dumpable;
23 import com.android.systemui.statusbar.policy.SecurityController.SecurityControllerCallback;
24 
25 public interface SecurityController extends CallbackController<SecurityControllerCallback>,
26         Dumpable {
27     /** Whether the device has device owner, even if not on this user. */
isDeviceManaged()28     boolean isDeviceManaged();
hasProfileOwner()29     boolean hasProfileOwner();
hasWorkProfile()30     boolean hasWorkProfile();
31     /** Whether the work profile is turned on. */
isWorkProfileOn()32     boolean isWorkProfileOn();
33     /** Whether this device is organization-owned with a work profile **/
isProfileOwnerOfOrganizationOwnedDevice()34     boolean isProfileOwnerOfOrganizationOwnedDevice();
getDeviceOwnerName()35     String getDeviceOwnerName();
getProfileOwnerName()36     String getProfileOwnerName();
getDeviceOwnerOrganizationName()37     CharSequence getDeviceOwnerOrganizationName();
getWorkProfileOrganizationName()38     CharSequence getWorkProfileOrganizationName();
39 
isFinancedDevice()40     boolean isFinancedDevice();
41 
42     /** Device owner component even if not on this user. **/
getDeviceOwnerComponentOnAnyUser()43     ComponentName getDeviceOwnerComponentOnAnyUser();
44     // TODO(b/259908270): remove
45     /** Device owner type for a device owner. **/
46     @Deprecated
getDeviceOwnerType(ComponentName admin)47     int getDeviceOwnerType(ComponentName admin);
isNetworkLoggingEnabled()48     boolean isNetworkLoggingEnabled();
isVpnEnabled()49     boolean isVpnEnabled();
isVpnRestricted()50     boolean isVpnRestricted();
51     /** Whether the VPN network is validated. */
isVpnValidated()52     boolean isVpnValidated();
53     /** Whether the VPN app should use branded VPN iconography.  */
isVpnBranded()54     boolean isVpnBranded();
getPrimaryVpnName()55     String getPrimaryVpnName();
getWorkProfileVpnName()56     String getWorkProfileVpnName();
hasCACertInCurrentUser()57     boolean hasCACertInCurrentUser();
hasCACertInWorkProfile()58     boolean hasCACertInWorkProfile();
onUserSwitched(int newUserId)59     void onUserSwitched(int newUserId);
60     /** Whether or not parental controls is enabled */
isParentalControlsEnabled()61     boolean isParentalControlsEnabled();
62     /** DeviceAdminInfo for active admin */
getDeviceAdminInfo()63     DeviceAdminInfo getDeviceAdminInfo();
64     /** Icon for admin */
getIcon(DeviceAdminInfo info)65     Drawable getIcon(DeviceAdminInfo info);
66     /** Label for admin */
getLabel(DeviceAdminInfo info)67     CharSequence getLabel(DeviceAdminInfo info);
68 
69     public interface SecurityControllerCallback {
onStateChanged()70         void onStateChanged();
71     }
72 
73 }
74