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

Commit 95c26295 authored by Nicolas Prévot's avatar Nicolas Prévot Committed by Android Git Automerger
Browse files

am 2b0cd2c7: am 64ac302f: Merge "Send a public broadcast when the device owner...

am 2b0cd2c7: am 64ac302f: Merge "Send a public broadcast when the device owner is set." into mnc-dev

* commit '2b0cd2c7':
  Send a public broadcast when the device owner is set.
parents baafac4a 2b0cd2c7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5697,6 +5697,7 @@ package android.app.admin {
    method public void uninstallCaCert(android.content.ComponentName, byte[]);
    method public void wipeData(int);
    field public static final java.lang.String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN";
    field public static final java.lang.String ACTION_DEVICE_OWNER_CHANGED = "android.app.action.DEVICE_OWNER_CHANGED";
    field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE";
+1 −0
Original line number Diff line number Diff line
@@ -5829,6 +5829,7 @@ package android.app.admin {
    method public void uninstallCaCert(android.content.ComponentName, byte[]);
    method public void wipeData(int);
    field public static final java.lang.String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN";
    field public static final java.lang.String ACTION_DEVICE_OWNER_CHANGED = "android.app.action.DEVICE_OWNER_CHANGED";
    field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE";
+11 −1
Original line number Diff line number Diff line
@@ -690,7 +690,7 @@ public class DevicePolicyManager {
            = "android.app.extra.PROFILE_OWNER_NAME";

    /**
     * Activity action: send when any policy admin changes a policy.
     * Broadcast action: send when any policy admin changes a policy.
     * This is generally used to find out when a new policy is in effect.
     *
     * @hide
@@ -698,6 +698,16 @@ public class DevicePolicyManager {
    public static final String ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED
            = "android.app.action.DEVICE_POLICY_MANAGER_STATE_CHANGED";

    /**
     * Broadcast action: sent when the device owner is set or changed.
     *
     * This broadcast is sent only to the primary user.
     * @see #ACTION_PROVISION_MANAGED_DEVICE
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_DEVICE_OWNER_CHANGED
            = "android.app.action.DEVICE_OWNER_CHANGED";

    /**
     * The ComponentName of the administrator component.
     *
+1 −0
Original line number Diff line number Diff line
@@ -319,6 +319,7 @@

    <protected-broadcast android:name="android.internal.policy.action.BURN_IN_PROTECTION" />
    <protected-broadcast android:name="android.app.action.SYSTEM_UPDATE_POLICY_CHANGED" />
    <protected-broadcast android:name="android.app.action.DEVICE_OWNER_CHANGED" />
    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
    <!-- ====================================================================== -->
+8 −0
Original line number Diff line number Diff line
@@ -4140,6 +4140,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            }
            mDeviceOwner.writeOwnerFile();
            updateDeviceOwnerLocked();
            Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED);

            ident = Binder.clearCallingIdentity();
            try {
                mContext.sendBroadcastAsUser(intent, UserHandle.OWNER);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
            return true;
        }
    }