Don't pre-scale vector drawables in settings
The idea of scaling down icons to prevent the system from dealing with large images seems to be catching some VectorDrawables and rescaling them. I don't think VectorDrawables are likely to create a memory issue, and the protection code seemed to be added to protect against large pngs, not vector graphics. Bug: 70562945 Test: Visually verified that all icons in the Accessibility Shortcut list are now the same size with maximum display and font sizes. Change-Id: I9f177d11a614c122d333d4625bf6fa756d1bf4af
This commit is contained in:
@@ -48,6 +48,7 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.VectorDrawable;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.LinkProperties;
|
||||
@@ -929,7 +930,7 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
*/
|
||||
public static void setSafeIcon(Preference pref, Drawable icon) {
|
||||
Drawable safeIcon = icon;
|
||||
if (icon != null) {
|
||||
if ((icon != null) && !(icon instanceof VectorDrawable)) {
|
||||
safeIcon = getSafeDrawable(icon, 500, 500);
|
||||
}
|
||||
pref.setIcon(safeIcon);
|
||||
|
Reference in New Issue
Block a user