Don't allow custom recents icon from Facebook and Twitter
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package app.lawnchair.util
|
||||
|
||||
import com.android.quickstep.TaskUtils
|
||||
import com.android.systemui.shared.recents.model.Task
|
||||
|
||||
object TaskIconUtils {
|
||||
|
||||
private val customIconBlacklist = setOf(
|
||||
"com.facebook.katana",
|
||||
"com.twitter.android",
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
fun allowCustomIcon(task: Task): Boolean {
|
||||
val componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key)
|
||||
val packageName = componentKey.componentName.packageName
|
||||
return packageName !in customIconBlacklist
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,8 @@ import com.android.systemui.shared.system.TaskDescriptionCompat;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import app.lawnchair.util.TaskIconUtils;
|
||||
|
||||
/**
|
||||
* Manages the caching of task icons and related data.
|
||||
*/
|
||||
@@ -142,7 +144,7 @@ public class TaskIconCache {
|
||||
// Load icon
|
||||
// TODO: Load icon resource (b/143363444)
|
||||
Bitmap icon = TaskDescriptionCompat.getIcon(desc, key.userId);
|
||||
if (icon != null) {
|
||||
if (icon != null && TaskIconUtils.allowCustomIcon(task)) {
|
||||
entry.icon = new FastBitmapDrawable(getBitmapInfo(
|
||||
new BitmapDrawable(mContext.getResources(), icon),
|
||||
key.userId,
|
||||
|
||||
Reference in New Issue
Block a user