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

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

Snap for 7255997 from 1568caed to rvc-qpr3-release

Change-Id: I29d11383e42fed8c4ec053fe54d9e76289d17716
parents ce6bc5e4 1568caed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@
            android:layout_width="@dimen/keyguard_security_width"
            android:layout_height="@dimen/pin_entry_height"
            android:gravity="center"
            android:focusedByDefault="true"
            app:scaledTextSize="@integer/password_text_view_scale"
            android:contentDescription="@string/keyguard_accessibility_pin_area" />

+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
                android:layout_width="@dimen/keyguard_security_width"
                android:layout_height="@dimen/pin_entry_height"
                android:gravity="center"
                android:focusedByDefault="true"
                app:scaledTextSize="@integer/password_text_view_scale"
                android:contentDescription="@string/keyguard_accessibility_pin_area" />

+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.media;

import static android.app.Notification.safeCharSequence;
import static android.provider.Settings.ACTION_MEDIA_CONTROLS_SETTINGS;

import android.app.PendingIntent;
@@ -261,7 +262,7 @@ public class MediaControlPanel {

        // Song name
        TextView titleText = mViewHolder.getTitleText();
        titleText.setText(data.getSong());
        titleText.setText(safeCharSequence(data.getSong()));

        // App title
        TextView appName = mViewHolder.getAppName();
@@ -269,7 +270,7 @@ public class MediaControlPanel {

        // Artist name
        TextView artistText = mViewHolder.getArtistText();
        artistText.setText(data.getArtist());
        artistText.setText(safeCharSequence(data.getArtist()));

        // Transfer chip
        mViewHolder.getSeamless().setVisibility(View.VISIBLE);
+21 −4
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,8 +84,15 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
    public static final int STATE_DOT = 1;
    public static final int STATE_HIDDEN = 2;

    /** Maximum allowed width or height for an icon drawable */
    private static final int MAX_IMAGE_SIZE = 500;
    /**
     * 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
@@ -382,9 +390,18 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
            return false;
        }

        if (drawable.getIntrinsicWidth() > MAX_IMAGE_SIZE
        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) {
            Log.w(TAG, "Drawable is too large " + mIcon);
            // Otherwise, check dimensions
            Log.w(TAG, "Drawable is too large (" + drawable.getIntrinsicWidth() + "x"
                    + drawable.getIntrinsicHeight() + ") " + mIcon);
            return false;
        }

+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ public class StatusBarIconViewTest extends SysuiTestCase {

    @Test
    public void testGiantImageNotAllowed() {
        Bitmap largeBitmap = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
        Bitmap largeBitmap = Bitmap.createBitmap(6000, 6000, Bitmap.Config.ARGB_8888);
        Icon icon = Icon.createWithBitmap(largeBitmap);
        StatusBarIcon largeIcon = new StatusBarIcon(UserHandle.ALL, "mockPackage",
                icon, 0, 0, "");
Loading