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

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

Merge "Change DEVICE_POLICY_RESOURCE_UPDATED broadcast extras" into tm-dev am: c099351d

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

Change-Id: If2adc51ad2dc146a6ea2860d58190d0d374d2941
parents b888f9b1 c099351d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -7704,9 +7704,10 @@ package android.app.admin {
    field public static final String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
    field public static final String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
    field public static final String EXTRA_PROVISIONING_WIFI_USER_CERTIFICATE = "android.app.extra.PROVISIONING_WIFI_USER_CERTIFICATE";
    field public static final String EXTRA_RESOURCE_ID = "android.app.extra.RESOURCE_ID";
    field public static final String EXTRA_RESOURCE_TYPE_DRAWABLE = "android.app.extra.RESOURCE_TYPE_DRAWABLE";
    field public static final String EXTRA_RESOURCE_TYPE_STRING = "android.app.extra.RESOURCE_TYPE_STRING";
    field public static final String EXTRA_RESOURCE_IDS = "android.app.extra.RESOURCE_IDS";
    field public static final String EXTRA_RESOURCE_TYPE = "android.app.extra.RESOURCE_TYPE";
    field public static final int EXTRA_RESOURCE_TYPE_DRAWABLE = 1; // 0x1
    field public static final int EXTRA_RESOURCE_TYPE_STRING = 2; // 0x2
    field public static final String EXTRA_RESULT_LAUNCH_INTENT = "android.app.extra.RESULT_LAUNCH_INTENT";
    field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
    field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
+21 −18
Original line number Diff line number Diff line
@@ -3611,42 +3611,45 @@ public class DevicePolicyManager {
    /**
     * Broadcast action: notify system apps (e.g. settings, SysUI, etc) that the device management
     * resources with IDs {@link #EXTRA_RESOURCE_ID} has been updated, the updated resources can be
     * resources with IDs {@link #EXTRA_RESOURCE_IDS} has been updated, the updated resources can be
     * retrieved using {@link #getDrawable} and {@code #getString}.
     *
     * <p>This broadcast is sent to registered receivers only.
     *
     * <p> The following extras will be included to identify the type of resource being updated:
     * <ul>
     *     <li>{@link #EXTRA_RESOURCE_TYPE_DRAWABLE} for drawable resources</li>
     *     <li>{@link #EXTRA_RESOURCE_TYPE_STRING} for string resources</li>
     * </ul>
     * <p> {@link #EXTRA_RESOURCE_TYPE} will be included to identify the type of resource being
     * updated.
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_DEVICE_POLICY_RESOURCE_UPDATED =
            "android.app.action.DEVICE_POLICY_RESOURCE_UPDATED";
    /**
     * A boolean extra for {@link #ACTION_DEVICE_POLICY_RESOURCE_UPDATED} to indicate that a
     * resource of type {@link Drawable} is being updated.
     * An {@code int} extra for {@link #ACTION_DEVICE_POLICY_RESOURCE_UPDATED} to indicate the type
     * of the resource being updated, the type can be {@link #EXTRA_RESOURCE_TYPE_DRAWABLE} or
     * {@link #EXTRA_RESOURCE_TYPE_STRING}
     */
    public static final String EXTRA_RESOURCE_TYPE =
            "android.app.extra.RESOURCE_TYPE";
    /**
     * A {@code int} value for {@link #EXTRA_RESOURCE_TYPE} to indicate that a resource of type
     * {@link Drawable} is being updated.
     */
    public static final String EXTRA_RESOURCE_TYPE_DRAWABLE =
            "android.app.extra.RESOURCE_TYPE_DRAWABLE";
    public static final int EXTRA_RESOURCE_TYPE_DRAWABLE = 1;
    /**
     * A boolean extra for {@link #ACTION_DEVICE_POLICY_RESOURCE_UPDATED} to indicate that a
     * resource of type {@link String} is being updated.
     * A {@code int} value for {@link #EXTRA_RESOURCE_TYPE} to indicate that a resource of type
     * {@link String} is being updated.
     */
    public static final String EXTRA_RESOURCE_TYPE_STRING =
            "android.app.extra.RESOURCE_TYPE_STRING";
    public static final int EXTRA_RESOURCE_TYPE_STRING = 2;
    /**
     * An integer array extra for {@link #ACTION_DEVICE_POLICY_RESOURCE_UPDATED} to indicate which
     * resource IDs (see {@link DevicePolicyResources.UpdatableDrawableId} and
     * {@link DevicePolicyResources.UpdatableStringId}) have been updated.
     * resource IDs (see {@link DevicePolicyResources.Drawables} and
     * {@link DevicePolicyResources.Strings}) have been updated.
     */
    public static final String EXTRA_RESOURCE_ID =
            "android.app.extra.RESOURCE_ID";
    public static final String EXTRA_RESOURCE_IDS =
            "android.app.extra.RESOURCE_IDS";
    /** @hide */
    @NonNull
+3 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURCE_UPDATED;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_TYPE;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_TYPE_DRAWABLE;
import static android.app.admin.DevicePolicyResources.Drawables.Source.PROFILE_SWITCH_ANIMATION;
import static android.app.admin.DevicePolicyResources.Drawables.Style.OUTLINE;
@@ -156,9 +157,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
    private BroadcastReceiver mEnterpriseResourceUpdatedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            boolean isDrawable = intent.getBooleanExtra(
                    EXTRA_RESOURCE_TYPE_DRAWABLE, /* default= */ false);
            if (!isDrawable) {
            if (intent.getIntExtra(EXTRA_RESOURCE_TYPE, /* default= */ -1)
                    != EXTRA_RESOURCE_TYPE_DRAWABLE) {
                return;
            }
            updateEnterpriseThumbnailDrawable();
+5 −4
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@ import static android.app.admin.DevicePolicyManager.DELEGATION_SECURITY_LOGGING;
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_DEFAULT;
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_FINANCED;
import static android.app.admin.DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_ID;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_IDS;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_TYPE;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_TYPE_DRAWABLE;
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_TYPE_STRING;
import static android.app.admin.DevicePolicyManager.ID_TYPE_BASE_INFO;
@@ -18692,10 +18693,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        sendResourceUpdatedBroadcast(EXTRA_RESOURCE_TYPE_STRING, stringIds);
    }
    private void sendResourceUpdatedBroadcast(String resourceType, String[] resourceIds) {
    private void sendResourceUpdatedBroadcast(int resourceType, String[] resourceIds) {
        final Intent intent = new Intent(ACTION_DEVICE_POLICY_RESOURCE_UPDATED);
        intent.putExtra(EXTRA_RESOURCE_ID, resourceIds);
        intent.putExtra(resourceType, /* value= */ true);
        intent.putExtra(EXTRA_RESOURCE_IDS, resourceIds);
        intent.putExtra(EXTRA_RESOURCE_TYPE, resourceType);
        intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);