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

Commit 55a75f48 authored by Muhammad Hasan Khan's avatar Muhammad Hasan Khan Committed by Android (Google) Code Review
Browse files

Merge "arc: Update installCaCert for upstreaming" into main

parents bff574d1 8193fbf4
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2008,6 +2008,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        DeviceManagementResourcesProvider getDeviceManagementResourcesProvider() {
            return new DeviceManagementResourcesProvider();
        }
        boolean isAdminInstalledCaCertAutoApproved() {
            return false;
        }
    }
    /**
@@ -6158,6 +6162,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;
        });