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

Commit e8f29730 authored by Kholoud Mohamed's avatar Kholoud Mohamed Committed by Automerger Merge Worker
Browse files

Merge "Add a new broadcast to notify when dpm constants change" into sc-dev am: b9f9e6fb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13614953

Change-Id: I9c67ebef11d90179df2d0e7874703daf51e2a480
parents 091a463c b9f9e6fb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -429,6 +429,7 @@ package android.app.admin {
    method @RequiresPermission("android.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS") public boolean setDeviceOwner(@NonNull android.content.ComponentName, @Nullable String, int);
    method @RequiresPermission("android.permission.MANAGE_DEVICE_ADMINS") public void setNextOperationSafety(int, int);
    field public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED = "android.app.action.DATA_SHARING_RESTRICTION_APPLIED";
    field public static final String ACTION_DEVICE_POLICY_CONSTANTS_CHANGED = "android.app.action.DEVICE_POLICY_CONSTANTS_CHANGED";
    field public static final int CODE_ACCOUNTS_NOT_EMPTY = 6; // 0x6
    field public static final int CODE_CANNOT_ADD_MANAGED_PROFILE = 11; // 0xb
    field public static final int CODE_DEVICE_ADMIN_NOT_SUPPORTED = 13; // 0xd
+10 −0
Original line number Diff line number Diff line
@@ -1765,6 +1765,16 @@ public class DevicePolicyManager {
    public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED =
            "android.app.action.DATA_SHARING_RESTRICTION_APPLIED";
    /**
     * Broadcast action: notify that a value of {@link Settings.Global#DEVICE_POLICY_CONSTANTS}
     * has been changed.
     * @hide
     */
    @TestApi
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_DEVICE_POLICY_CONSTANTS_CHANGED =
            "android.app.action.DEVICE_POLICY_CONSTANTS_CHANGED";
    /**
     * Permission policy to prompt user for new permission requests for runtime permissions.
     * Already granted or denied permissions are not affected by this.
+1 −0
Original line number Diff line number Diff line
@@ -694,6 +694,7 @@

    <!-- Added in S -->
    <protected-broadcast android:name="android.intent.action.REBOOT_READY" />
    <protected-broadcast android:name="android.app.action.DEVICE_POLICY_CONSTANTS_CHANGED" />

    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
+10 −0
Original line number Diff line number Diff line
@@ -12135,6 +12135,16 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        @Override
        public void onChange(boolean selfChange, Uri uri, int userId) {
            mConstants = loadConstants();
            mInjector.binderWithCleanCallingIdentity(() -> {
                final Intent intent = new Intent(
                        DevicePolicyManager.ACTION_DEVICE_POLICY_CONSTANTS_CHANGED);
                intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
                final List<UserInfo> users = mUserManager.getAliveUsers();
                for (int i = 0; i < users.size(); i++) {
                    mContext.sendBroadcastAsUser(intent, UserHandle.of(users.get(i).id));
                }
            });
        }
    }