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

@@ -29,7 +29,6 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.IconDrawableFactory;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -147,7 +146,7 @@ public class EntityHeaderController {
* accessibility purposes.
*/
public EntityHeaderController setIcon(ApplicationsState.AppEntry appEntry) {
mIcon = IconDrawableFactory.newInstance(mAppContext).getBadgedIcon(appEntry.info);
mIcon = Utils.getBadgedIcon(mAppContext, appEntry.info);
return this;
}