Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 834e3b38 authored by Eric Biggers's avatar Eric Biggers Committed by Android (Google) Code Review
Browse files

Merge "SystemUI: Remove unused method SecurityController#getDeviceOwnerType()" into main

parents c1e7d870 cbdb04b8
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -14,9 +14,6 @@

package com.android.systemui.qs;

import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_DEFAULT;
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_FINANCED;

import static com.google.common.truth.Truth.assertThat;

import static junit.framework.Assert.assertEquals;
@@ -132,9 +129,6 @@ public class QSSecurityFooterTest extends SysuiTestCase {
        when(mSecurityController.getDeviceOwnerComponentOnAnyUser())
                .thenReturn(DEVICE_OWNER_COMPONENT);
        when(mSecurityController.isFinancedDevice()).thenReturn(false);
        // TODO(b/259908270): remove
        when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_DEFAULT);
    }

    @Nullable
@@ -201,9 +195,6 @@ public class QSSecurityFooterTest extends SysuiTestCase {
        when(mSecurityController.getDeviceOwnerOrganizationName())
                .thenReturn(MANAGING_ORGANIZATION);
        when(mSecurityController.isFinancedDevice()).thenReturn(true);
        // TODO(b/259908270): remove
        when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_FINANCED);

        SecurityButtonConfig buttonConfig = getButtonConfig();
        assertNotNull(buttonConfig);
@@ -514,9 +505,6 @@ public class QSSecurityFooterTest extends SysuiTestCase {
    public void testGetManagementTitleForFinancedDevice() {
        when(mSecurityController.isDeviceManaged()).thenReturn(true);
        when(mSecurityController.isFinancedDevice()).thenReturn(true);
        // TODO(b/259908270): remove
        when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_FINANCED);

        assertEquals(mContext.getString(R.string.monitoring_title_financed_device,
                MANAGING_ORGANIZATION),
@@ -545,9 +533,6 @@ public class QSSecurityFooterTest extends SysuiTestCase {
    public void testGetManagementMessage_deviceOwner_asFinancedDevice() {
        when(mSecurityController.isDeviceManaged()).thenReturn(true);
        when(mSecurityController.isFinancedDevice()).thenReturn(true);
        // TODO(b/259908270): remove
        when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_FINANCED);

        assertEquals(mContext.getString(R.string.monitoring_financed_description_named_management,
                MANAGING_ORGANIZATION, MANAGING_ORGANIZATION),
@@ -855,9 +840,6 @@ public class QSSecurityFooterTest extends SysuiTestCase {
        when(mSecurityController.getDeviceOwnerOrganizationName())
                .thenReturn(MANAGING_ORGANIZATION);
        when(mSecurityController.isFinancedDevice()).thenReturn(true);
        // TODO(b/259908270): remove
        when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_FINANCED);

        View view = mFooterUtils.createDialogView(getContext());

@@ -879,9 +861,6 @@ public class QSSecurityFooterTest extends SysuiTestCase {
        when(mSecurityController.getDeviceOwnerOrganizationName())
                .thenReturn(MANAGING_ORGANIZATION);
        when(mSecurityController.isFinancedDevice()).thenReturn(true);
        // TODO(b/259908270): remove
        when(mSecurityController.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_FINANCED);

        Expandable expandable = mock(Expandable.class);
        when(expandable.dialogTransitionController(any())).thenReturn(
+2 −8
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.systemui.statusbar;

import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_DEFAULT;

import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRANSIENT;
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;

@@ -105,9 +103,8 @@ import org.mockito.MockitoAnnotations;
public class KeyguardIndicationControllerBaseTest extends SysuiTestCase {
    protected static final String ORGANIZATION_NAME = "organization";

    protected static final ComponentName DEVICE_OWNER_COMPONENT = new ComponentName(
            "com.android.foo",
            "bar");
    private static final ComponentName DEVICE_OWNER_COMPONENT =
            new ComponentName("com.android.foo", "bar");

    protected static final int TEST_STRING_RES = R.string.keyguard_indication_trust_unlocked;

@@ -243,9 +240,6 @@ public class KeyguardIndicationControllerBaseTest extends SysuiTestCase {
        when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser())
                .thenReturn(DEVICE_OWNER_COMPONENT);
        when(mDevicePolicyManager.isFinancedDevice()).thenReturn(false);
        // TODO(b/259908270): remove
        when(mDevicePolicyManager.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_DEFAULT);

        when(mDevicePolicyResourcesManager.getString(anyString(), any()))
                .thenReturn(mDisclosureGeneric);
+0 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.systemui.statusbar;

import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_FINANCED;
import static android.content.pm.UserInfo.FLAG_MANAGED_PROFILE;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DARK;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT;
@@ -311,9 +310,6 @@ public class KeyguardIndicationControllerTest extends KeyguardIndicationControll
        when(mDevicePolicyManager.isDeviceManaged()).thenReturn(true);
        when(mDevicePolicyManager.getDeviceOwnerOrganizationName()).thenReturn(ORGANIZATION_NAME);
        when(mDevicePolicyManager.isFinancedDevice()).thenReturn(true);
        // TODO(b/259908270): remove
        when(mDevicePolicyManager.getDeviceOwnerType(DEVICE_OWNER_COMPONENT))
                .thenReturn(DEVICE_OWNER_TYPE_FINANCED);
        sendUpdateDisclosureBroadcast();
        mExecutor.runAllReady();
        mController.setVisible(true);
+0 −4
Original line number Diff line number Diff line
@@ -44,10 +44,6 @@ public interface SecurityController extends CallbackController<SecurityControlle

    /** Device owner component even if not on this user. **/
    ComponentName getDeviceOwnerComponentOnAnyUser();
    // TODO(b/259908270): remove
    /** Device owner type for a device owner. **/
    @Deprecated
    int getDeviceOwnerType(ComponentName admin);
    boolean isNetworkLoggingEnabled();
    /** @deprecated Use {@link VpnRepository#getVpnState()} instead. */
    @Deprecated
+0 −8
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.admin.DeviceAdminInfo;
import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManager.DeviceOwnerType;
import android.app.supervision.SupervisionManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -293,13 +292,6 @@ public class SecurityControllerImpl implements SecurityController {
        return mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser();
    }

    // TODO(b/259908270): remove
    @Override
    @DeviceOwnerType
    public int getDeviceOwnerType(@NonNull ComponentName admin) {
        return mDevicePolicyManager.getDeviceOwnerType(admin);
    }

    @Override
    public boolean isFinancedDevice() {
        return mDevicePolicyManager.isFinancedDevice();
Loading