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

Commit c33fdd05 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [14129459, 14130267, 14129460, 14130198, 14130202,...

Merge cherrypicks of [14129459, 14130267, 14129460, 14130198, 14130202, 14130204, 14130305, 14130306, 14130307, 14129440, 14129442, 14129443, 14129735, 14129736, 14129737, 14129738, 14129739, 14129444, 14130346, 14129741, 14130347, 14130348, 14129742, 14130349, 14130350, 14130351, 14130352, 14130244, 14129743, 14129744, 14130365, 14130037, 14130321, 14130322, 14130323, 14130324, 14130405] into security-aosp-rvc-release

Change-Id: I8786a91b48d55bcb8c3db013f1c0ffa37ad23c49
parents 914a284e 9b67d754
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -377,6 +377,21 @@ public abstract class ActivityManagerInternal {
     */
    public abstract boolean hasRunningForegroundService(int uid, int foregroundServiceType);

    /**
     * Returns {@code true} if the given notification channel currently has a
     * notification associated with a foreground service.  This is an AMS check
     * because that is the source of truth for the FGS state.
     */
    public abstract boolean hasForegroundServiceNotification(String pkg, @UserIdInt int userId,
            String channelId);

    /**
     * If the given app has any FGSs whose notifications are in the given channel,
     * stop them.
     */
    public abstract void stopForegroundServicesForChannel(String pkg, @UserIdInt int userId,
            String channelId);

    /**
     * Registers the specified {@code processObserver} to be notified of future changes to
     * process state.
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,9 @@ public final class DisplayManager {
     * {@link #EXTRA_WIFI_DISPLAY_STATUS} extra.
     * </p><p>
     * This broadcast is only sent to registered receivers and can only be sent by the system.
     * </p><p>
     * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission is required to
     * receive this broadcast.
     * </p>
     * @hide
     */
+6 −0
Original line number Diff line number Diff line
@@ -202,6 +202,12 @@ public class Process {
     */
    public static final int SE_UID = 1068;

    /**
     * Defines the UID/GID for the iorapd.
     * @hide
     */
    public static final int IORAPD_UID = 1071;

    /**
     * Defines the UID/GID for the NetworkStack app.
     * @hide
+13 −7
Original line number Diff line number Diff line
@@ -283,8 +283,10 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
                        .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

        // cancel current pending intent (if any) since clipData isn't used for matching
        PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context, 0,
                sharingChooserIntent, PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT);
        PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
                context, 0, sharingChooserIntent,
                PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
                null, UserHandle.CURRENT);

        // Create a share action for the notification
        PendingIntent shareAction = PendingIntent.getBroadcastAsUser(context, requestCode,
@@ -296,7 +298,8 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
                                mSmartActionsEnabled)
                        .setAction(Intent.ACTION_SEND)
                        .addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
                PendingIntent.FLAG_CANCEL_CURRENT, UserHandle.SYSTEM);
                PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
                UserHandle.SYSTEM);

        Notification.Action.Builder shareActionBuilder = new Notification.Action.Builder(
                Icon.createWithResource(r, R.drawable.ic_screenshot_share),
@@ -325,7 +328,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
        editIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);

        PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context, 0,
                editIntent, 0, null, UserHandle.CURRENT);
                editIntent, PendingIntent.FLAG_IMMUTABLE, null, UserHandle.CURRENT);

        // Make sure pending intents for the system user are still unique across users
        // by setting the (otherwise unused) request code to the current user id.
@@ -342,7 +345,8 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
                                mSmartActionsEnabled)
                        .setAction(Intent.ACTION_EDIT)
                        .addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
                PendingIntent.FLAG_CANCEL_CURRENT, UserHandle.SYSTEM);
                PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
                UserHandle.SYSTEM);
        Notification.Action.Builder editActionBuilder = new Notification.Action.Builder(
                Icon.createWithResource(r, R.drawable.ic_screenshot_edit),
                r.getString(com.android.internal.R.string.screenshot_edit), editAction);
@@ -364,7 +368,9 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
                        .putExtra(GlobalScreenshot.EXTRA_SMART_ACTIONS_ENABLED,
                                mSmartActionsEnabled)
                        .addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
                PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
                PendingIntent.FLAG_CANCEL_CURRENT
                        | PendingIntent.FLAG_ONE_SHOT
                        | PendingIntent.FLAG_IMMUTABLE);
        Notification.Action.Builder deleteActionBuilder = new Notification.Action.Builder(
                Icon.createWithResource(r, R.drawable.ic_screenshot_delete),
                r.getString(com.android.internal.R.string.delete), deleteAction);
@@ -405,7 +411,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
            PendingIntent broadcastIntent = PendingIntent.getBroadcast(context,
                    mRandom.nextInt(),
                    intent,
                    PendingIntent.FLAG_CANCEL_CURRENT);
                    PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
            broadcastActions.add(new Notification.Action.Builder(action.getIcon(), action.title,
                    broadcastIntent).setContextual(true).addExtras(extras).build());
        }
+27 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.graphics.Color;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.Parcelable;
@@ -83,6 +84,16 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
    public static final int STATE_DOT = 1;
    public static final int STATE_HIDDEN = 2;

    /**
     * Maximum allowed byte count for an icon bitmap
     * @see android.graphics.RecordingCanvas.MAX_BITMAP_SIZE
     */
    private static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB
    /**
     * Maximum allowed width or height for an icon drawable, if we can't get byte count
     */
    private static final int MAX_IMAGE_SIZE = 5000;

    private static final String TAG = "StatusBarIconView";
    private static final Property<StatusBarIconView, Float> ICON_APPEAR_AMOUNT
            = new FloatProperty<StatusBarIconView>("iconAppearAmount") {
@@ -378,6 +389,22 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
            Log.w(TAG, "No icon for slot " + mSlot + "; " + mIcon.icon);
            return false;
        }

        if (drawable instanceof BitmapDrawable && ((BitmapDrawable) drawable).getBitmap() != null) {
            // If it's a bitmap we can check the size directly
            int byteCount = ((BitmapDrawable) drawable).getBitmap().getByteCount();
            if (byteCount > MAX_BITMAP_SIZE) {
                Log.w(TAG, "Drawable is too large (" + byteCount + " bytes) " + mIcon);
                return false;
            }
        } else if (drawable.getIntrinsicWidth() > MAX_IMAGE_SIZE
                || drawable.getIntrinsicHeight() > MAX_IMAGE_SIZE) {
            // Otherwise, check dimensions
            Log.w(TAG, "Drawable is too large (" + drawable.getIntrinsicWidth() + "x"
                    + drawable.getIntrinsicHeight() + ") " + mIcon);
            return false;
        }

        if (withClear) {
            setImageDrawable(null);
        }
Loading