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

Commit f70489f2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Proper fix for setDeviceOwner() permission check." into sc-v2-dev

parents 8e50f978 ab0a45f0
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -10632,6 +10632,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            }
        }
        final String adminPkg = admin.getPackageName();
        mInjector.binderWithCleanCallingIdentity(() -> {
            try {
                // Install the profile owner if not present.
                if (!mIPackageManager.isPackageAvailable(adminPkg, userId)) {
@@ -10645,6 +10646,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                Slogf.wtf(LOG_TAG, e, "Failed to install admin package %s for user %d",
                        adminPkg, userId);
            }
        });
        // Set admin.
        setActiveAdmin(profileOwner, /* refreshing= */ true, userId);