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

Commit 9622d179 authored by Kholoud Mohamed's avatar Kholoud Mohamed
Browse files

Enable feature flag for financed device APIs

Bug: 273494642
Test: N/A
Change-Id: I8a6a784c44d6a83deca216322a2c79853bab8077
parent 77032dd7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -856,7 +856,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    private static final String ENABLE_DEVICE_POLICY_ENGINE_FOR_FINANCE_FLAG =
    private static final String ENABLE_DEVICE_POLICY_ENGINE_FOR_FINANCE_FLAG =
            "enable_device_policy_engine";
            "enable_device_policy_engine";
    private static final boolean DEFAULT_ENABLE_DEVICE_POLICY_ENGINE_FOR_FINANCE_FLAG = false;
    private static final boolean DEFAULT_ENABLE_DEVICE_POLICY_ENGINE_FOR_FINANCE_FLAG = true;
    // TODO(b/265683382) remove the flag after rollout.
    // TODO(b/265683382) remove the flag after rollout.
    private static final String KEEP_PROFILES_RUNNING_FLAG = "enable_keep_profiles_running";
    private static final String KEEP_PROFILES_RUNNING_FLAG = "enable_keep_profiles_running";
+1 −0
Original line number Original line Diff line number Diff line
@@ -86,6 +86,7 @@ public class DevicePolicyManagerServiceMigrationTest extends DpmTestBase {


    // Test setting default restrictions for managed profile.
    // Test setting default restrictions for managed profile.
    @Test
    @Test
    @Ignore("b/277916462")
    public void testMigration_managedProfileOwner() throws Exception {
    public void testMigration_managedProfileOwner() throws Exception {
        // Create a managed profile user.
        // Create a managed profile user.
        final File user10dir = getServices().addUser(10, 0,
        final File user10dir = getServices().addUser(10, 0,
+14 −0
Original line number Original line Diff line number Diff line
@@ -1368,6 +1368,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testClearDeviceOwner() throws Exception {
    public void testClearDeviceOwner() throws Exception {
        mContext.callerPermissions.add(permission.MANAGE_DEVICE_ADMINS);
        mContext.callerPermissions.add(permission.MANAGE_DEVICE_ADMINS);
        mContext.callerPermissions.add(permission.MANAGE_USERS);
        mContext.callerPermissions.add(permission.MANAGE_USERS);
@@ -1955,6 +1956,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserRestriction_asDo() throws Exception {
    public void testSetUserRestriction_asDo() throws Exception {
        mContext.callerPermissions.add(permission.MANAGE_DEVICE_ADMINS);
        mContext.callerPermissions.add(permission.MANAGE_DEVICE_ADMINS);
        mContext.callerPermissions.add(permission.MANAGE_USERS);
        mContext.callerPermissions.add(permission.MANAGE_USERS);
@@ -2123,6 +2125,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserRestriction_asPo() {
    public void testSetUserRestriction_asPo() {
        setAsProfileOwner(admin1);
        setAsProfileOwner(admin1);


@@ -2259,6 +2262,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
            );
            );


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserRestriction_asPoOfOrgOwnedDevice() throws Exception {
    public void testSetUserRestriction_asPoOfOrgOwnedDevice() throws Exception {
        final int MANAGED_PROFILE_ADMIN_UID =
        final int MANAGED_PROFILE_ADMIN_UID =
                UserHandle.getUid(CALLER_USER_HANDLE, DpmMockContext.SYSTEM_UID);
                UserHandle.getUid(CALLER_USER_HANDLE, DpmMockContext.SYSTEM_UID);
@@ -2334,6 +2338,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testNoDefaultEnabledUserRestrictions() throws Exception {
    public void testNoDefaultEnabledUserRestrictions() throws Exception {
        mContext.callerPermissions.add(permission.MANAGE_DEVICE_ADMINS);
        mContext.callerPermissions.add(permission.MANAGE_DEVICE_ADMINS);
        mContext.callerPermissions.add(permission.MANAGE_USERS);
        mContext.callerPermissions.add(permission.MANAGE_USERS);
@@ -2925,6 +2930,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testCreateAdminSupportIntent() throws Exception {
    public void testCreateAdminSupportIntent() throws Exception {
        // Setup device owner.
        // Setup device owner.
        mContext.binder.callingUid = DpmMockContext.CALLER_SYSTEM_USER_UID;
        mContext.binder.callingUid = DpmMockContext.CALLER_SYSTEM_USER_UID;
@@ -4993,6 +4999,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testWipeDataManagedProfileOnOrganizationOwnedDevice() throws Exception {
    public void testWipeDataManagedProfileOnOrganizationOwnedDevice() throws Exception {
        setupProfileOwner();
        setupProfileOwner();
        configureProfileOwnerOfOrgOwnedDevice(admin1, CALLER_USER_HANDLE);
        configureProfileOwnerOfOrgOwnedDevice(admin1, CALLER_USER_HANDLE);
@@ -7023,6 +7030,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserControlDisabledPackages_asDO() throws Exception {
    public void testSetUserControlDisabledPackages_asDO() throws Exception {
        final List<String> testPackages = new ArrayList<>();
        final List<String> testPackages = new ArrayList<>();
        testPackages.add("package_1");
        testPackages.add("package_1");
@@ -7038,6 +7046,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserControlDisabledPackages_asPO() {
    public void testSetUserControlDisabledPackages_asPO() {
        final List<String> testPackages = new ArrayList<>();
        final List<String> testPackages = new ArrayList<>();
        testPackages.add("package_1");
        testPackages.add("package_1");
@@ -7776,6 +7785,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserRestriction_financeDo_validRestrictions_setsRestriction()
    public void testSetUserRestriction_financeDo_validRestrictions_setsRestriction()
            throws Exception {
            throws Exception {
        setDeviceOwner();
        setDeviceOwner();
@@ -7858,6 +7868,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUninstallBlocked_financeDo_success() throws Exception {
    public void testSetUninstallBlocked_financeDo_success() throws Exception {
        String packageName = "com.android.foo.package";
        String packageName = "com.android.foo.package";
        setDeviceOwner();
        setDeviceOwner();
@@ -7871,6 +7882,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testSetUserControlDisabledPackages_financeDo_success() throws Exception {
    public void testSetUserControlDisabledPackages_financeDo_success() throws Exception {
        List<String> packages = new ArrayList<>();
        List<String> packages = new ArrayList<>();
        packages.add("com.android.foo.package");
        packages.add("com.android.foo.package");
@@ -7960,6 +7972,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testAddPersistentPreferredActivity_financeDo_success() throws Exception {
    public void testAddPersistentPreferredActivity_financeDo_success() throws Exception {
        IntentFilter filter = new IntentFilter();
        IntentFilter filter = new IntentFilter();
        ComponentName target = new ComponentName(admin2.getPackageName(), "test.class");
        ComponentName target = new ComponentName(admin2.getPackageName(), "test.class");
@@ -7975,6 +7988,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    }
    }


    @Test
    @Test
    @Ignore("b/277916462")
    public void testClearPackagePersistentPreferredActvities_financeDo_success() throws Exception {
    public void testClearPackagePersistentPreferredActvities_financeDo_success() throws Exception {
        String packageName = admin2.getPackageName();
        String packageName = admin2.getPackageName();
        setDeviceOwner();
        setDeviceOwner();