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

Commit 024b5703 authored by Paul Scovanner's avatar Paul Scovanner Committed by android-build-team Robot
Browse files

Revert "Limit maximum allowed size for a status bar icon"

This reverts commit 3a62e9ff.

Reason for revert: Regression (eg: b/183696500) caused by security fix. Revert needed to respin May MPR build.

Change-Id: If9e34a0120121ed851b911c8a8bd2bbe0e0f9e34
(cherry picked from commit 2455fc526470713c22b3a0a8d7f4a3ec910fa61c)
parent 192fb026
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -83,9 +83,6 @@ 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;

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

        if (drawable.getIntrinsicWidth() > MAX_IMAGE_SIZE
                || drawable.getIntrinsicHeight() > MAX_IMAGE_SIZE) {
            Log.w(TAG, "Drawable is too large " + mIcon);
            return false;
        }

        if (withClear) {
            setImageDrawable(null);
        }
+0 −10
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.content.ContextWrapper;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Icon;
import android.os.UserHandle;
@@ -124,13 +123,4 @@ public class StatusBarIconViewTest extends SysuiTestCase {
        assertEquals("Transparent backgrounds should fallback to drawable color",
                color, mIconView.getStaticDrawableColor());
    }

    @Test
    public void testGiantImageNotAllowed() {
        Bitmap largeBitmap = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
        Icon icon = Icon.createWithBitmap(largeBitmap);
        StatusBarIcon largeIcon = new StatusBarIcon(UserHandle.ALL, "mockPackage",
                icon, 0, 0, "");
        assertFalse(mIconView.set(largeIcon));
    }
}
 No newline at end of file