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

Commit 352849cc authored by Kholoud Mohamed's avatar Kholoud Mohamed Committed by kholoud mohamed
Browse files

Remove no longer needed broadcasts

Removed broadcasts that were sent from the framework
to Managed Provisioning during DPM#createAndProvisionManagedProfile
and DPM#provisionFullyManagedDevice to handle system apps
snapshotting. This is no loger needed as Managed
Provisioning is directly applying that logic after calling the APIs.

Bug: 178478031
Test: N/A
Change-Id: Ic78828f3be05f154414f53c9c78915cf92341765
parent 11512218
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -392,8 +392,6 @@ package android.app.admin {
    method @RequiresPermission("android.permission.MANAGE_DEVICE_ADMINS") public void setNextOperationSafety(int, int);
    method @NonNull public static String unsafeOperationReasonToString(int);
    field public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED = "android.app.action.DATA_SHARING_RESTRICTION_APPLIED";
    field public static final String ACTION_MANAGED_PROFILE_CREATED = "android.app.action.MANAGED_PROFILE_CREATED";
    field public static final String ACTION_PROVISIONED_MANAGED_DEVICE = "android.app.action.PROVISIONED_MANAGED_DEVICE";
    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
+0 −20
Original line number Diff line number Diff line
@@ -5468,26 +5468,6 @@ public class DevicePolicyManager {
    public static final String ACTION_SHOW_NEW_USER_DISCLAIMER =
            "android.app.action.ACTION_SHOW_NEW_USER_DISCLAIMER";
    /**
     * Broadcast action: notify managed provisioning that the device has been provisioned.
     *
     * @hide
     */
    @TestApi
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_PROVISIONED_MANAGED_DEVICE =
            "android.app.action.PROVISIONED_MANAGED_DEVICE";
    /**
     * Broadcast action: notify managed provisioning that a new managed profile is created.
     *
     * @hide
     */
    @TestApi
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_MANAGED_PROFILE_CREATED =
            "android.app.action.MANAGED_PROFILE_CREATED";
    /**
     * Widgets are enabled in keyguard
     */
+0 −4
Original line number Diff line number Diff line
@@ -689,10 +689,6 @@
    <!-- Made protected in S (was added in R) -->
    <protected-broadcast android:name="com.android.internal.intent.action.BUGREPORT_REQUESTED" />

    <!-- Added in S -->
    <protected-broadcast android:name="android.app.action.MANAGED_PROFILE_CREATED" />
    <protected-broadcast android:name="android.app.action.PROVISIONED_MANAGED_DEVICE" />

    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
    <!-- ====================================================================== -->
+0 −18
Original line number Diff line number Diff line
@@ -16012,15 +16012,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                restrictRemovalOfManagedProfile(admin, userInfo.id);
            }
            final Intent intent = new Intent(DevicePolicyManager.ACTION_MANAGED_PROFILE_CREATED)
                    .putExtra(Intent.EXTRA_USER_HANDLE, userInfo.id)
                    .putExtra(
                            DevicePolicyManager.EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED,
                            provisioningParams.isLeaveAllSystemAppsEnabled())
                    .setPackage(getManagedProvisioningPackage(mContext))
                    .addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
            mContext.sendBroadcastAsUser(intent, UserHandle.SYSTEM);
            return userInfo.getUserHandle();
        } catch (Exception e) {
            DevicePolicyEventLogger
@@ -16313,15 +16304,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            }
            disallowAddUser();
            final Intent intent = new Intent(DevicePolicyManager.ACTION_PROVISIONED_MANAGED_DEVICE)
                    .putExtra(Intent.EXTRA_USER_HANDLE, caller.getUserId())
                    .putExtra(
                            DevicePolicyManager.EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED,
                            provisioningParams.isLeaveAllSystemAppsEnabled())
                    .setPackage(getManagedProvisioningPackage(mContext))
                    .addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
            mContext.sendBroadcastAsUser(intent, UserHandle.SYSTEM);
        } catch (Exception e) {
            DevicePolicyEventLogger
                    .createEvent(DevicePolicyEnums.PLATFORM_PROVISIONING_ERROR)