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 app should use branded VPN iconography. */ isVpnBranded()52 boolean isVpnBranded(); getPrimaryVpnName()53 String getPrimaryVpnName(); getWorkProfileVpnName()54 String getWorkProfileVpnName(); hasCACertInCurrentUser()55 boolean hasCACertInCurrentUser(); hasCACertInWorkProfile()56 boolean hasCACertInWorkProfile(); onUserSwitched(int newUserId)57 void onUserSwitched(int newUserId); 58 /** Whether or not parental controls is enabled */ isParentalControlsEnabled()59 boolean isParentalControlsEnabled(); 60 /** DeviceAdminInfo for active admin */ getDeviceAdminInfo()61 DeviceAdminInfo getDeviceAdminInfo(); 62 /** Icon for admin */ getIcon(DeviceAdminInfo info)63 Drawable getIcon(DeviceAdminInfo info); 64 /** Label for admin */ getLabel(DeviceAdminInfo info)65 CharSequence getLabel(DeviceAdminInfo info); 66 67 public interface SecurityControllerCallback { onStateChanged()68 void onStateChanged(); 69 } 70 71 } 72