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

Commit 6d36b60b authored by Jessica Hummel's avatar Jessica Hummel
Browse files

Allow setting the active admin across users.

This is required so that provisioning can call it from the primary user when it sets up the mdm on the managed profile.

Change-Id: I185af168754aa4aeae61f1d4522c1794681cb400
parent f1e27b58
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1534,16 +1534,23 @@ public class DevicePolicyManager {
    /**
     * @hide
     */
    public void setActiveAdmin(ComponentName policyReceiver, boolean refreshing) {
    public void setActiveAdmin(ComponentName policyReceiver, boolean refreshing, int userHandle) {
        if (mService != null) {
            try {
                mService.setActiveAdmin(policyReceiver, refreshing, UserHandle.myUserId());
                mService.setActiveAdmin(policyReceiver, refreshing, userHandle);
            } catch (RemoteException e) {
                Log.w(TAG, "Failed talking with device policy service", e);
            }
        }
    }

    /**
     * @hide
     */
    public void setActiveAdmin(ComponentName policyReceiver, boolean refreshing) {
        setActiveAdmin(policyReceiver, refreshing, UserHandle.myUserId());
    }

    /**
     * Returns the DeviceAdminInfo as defined by the administrator's package info & meta-data
     * @hide