Use system-api lib to get badged, shadowed icons

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
Change-Id: Ie148890fbbbf71f42863a8fe727a90615158b8c1
Fix: 33646131
This commit is contained in:
Tsung-Mao Fang
2020-02-06 13:46:05 +08:00
parent bc5e1646d5
commit 323347afcc
3 changed files with 6 additions and 5 deletions

View File

@@ -366,6 +366,7 @@ public class ManageApplicationsTest {
appEntry.extraInfo = mock(AppFilterItem.class);
appList.add(appEntry);
ReflectionHelpers.setField(adapter, "mEntries", appList);
ReflectionHelpers.setField(adapter, "mContext", mContext);
adapter.onBindViewHolder(holder, 0);
// no crash? yay!
@@ -387,6 +388,7 @@ public class ManageApplicationsTest {
appEntry.info = mock(ApplicationInfo.class);
appList.add(appEntry);
ReflectionHelpers.setField(adapter, "mEntries", appList);
ReflectionHelpers.setField(adapter, "mContext", mContext);
adapter.onBindViewHolder(holder, 0);
verify(holder).updateSwitch(any(), anyBoolean(), anyBoolean());
@@ -406,6 +408,7 @@ public class ManageApplicationsTest {
appEntry.info = mock(ApplicationInfo.class);
appList.add(appEntry);
ReflectionHelpers.setField(adapter, "mEntries", appList);
ReflectionHelpers.setField(adapter, "mContext", mContext);
adapter.onBindViewHolder(holder, 0);
verify(holder, never()).updateSwitch(any(), anyBoolean(), anyBoolean());