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

Commit 8193fbf4 authored by Muhammad Hasan Khan's avatar Muhammad Hasan Khan
Browse files

arc: Update installCaCert for upstreaming

Instead of checking for Build.IS_ARC use an injector property.

Bug: 301629133
Test: m
Change-Id: Ie847107bd48244182096198a834fc840480c6c69
parent 3c144386
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2011,6 +2011,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        DeviceManagementResourcesProvider getDeviceManagementResourcesProvider() {
            return new DeviceManagementResourcesProvider();
        }
        boolean isAdminInstalledCaCertAutoApproved() {
            return false;
        }
    }
    /**
@@ -6145,6 +6149,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                    .setAdmin(caller.getPackageName())
                    .setBoolean(/* isDelegate */ admin == null)
                    .write();
            if (mInjector.isAdminInstalledCaCertAutoApproved()
                    && installedAlias != null
                    && admin != null) {
                // If device admin called this, approve cert to avoid notifications
                Slogf.i(LOG_TAG, "Approving admin installed cert");
                approveCaCert(
                        installedAlias,
                        caller.getUserId(),
                        /* approved */ true);
            }
            return installedAlias;
        });