Use system-api lib to get badged, shadowed icons(2/n)

In order to prevent DoS attack from icon size, we're using
a system lib to help convert any loaded drawable into a flattened
bitmap with an appropriate size.

Test: Open recent app screen and then no crash
Bug: 33646131
Change-Id: Ib7eae56e19cd86667bd63b6061000c6a92deaf3b
This commit is contained in:
Tsung-Mao Fang
2020-02-06 18:30:13 +08:00
parent 203b9e974f
commit dbecbe6f61
7 changed files with 18 additions and 26 deletions

View File

@@ -18,7 +18,10 @@ package com.android.settings.testutils.shadow;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.hardware.fingerprint.FingerprintManager;
import android.os.UserHandle;
import android.os.UserManager;
@@ -144,6 +147,11 @@ public class ShadowUtils {
return sResultLinks;
}
@Implementation
protected static Drawable getBadgedIcon(Context context, ApplicationInfo appInfo) {
return new ColorDrawable(0);
}
public static void setHandledDomains(ArraySet<String> links) {
sResultLinks = links;
}