From 16045060c35639aea85afc572bea768d16e6c9f9 Mon Sep 17 00:00:00 2001 From: Hilary Huo Date: Thu, 8 Oct 2020 10:18:41 -0700 Subject: [PATCH] [pixel-search] add escape hatch Change-Id: I33ffea1fc0859564955380d7d1db317293d1a2cb --- .../android/launcher3/model/data/RemoteActionItemInfo.java | 4 ++++ src/com/android/launcher3/views/SearchResultIconRow.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/model/data/RemoteActionItemInfo.java b/src/com/android/launcher3/model/data/RemoteActionItemInfo.java index 81f7f3a0a2..d988bf9641 100644 --- a/src/com/android/launcher3/model/data/RemoteActionItemInfo.java +++ b/src/com/android/launcher3/model/data/RemoteActionItemInfo.java @@ -61,4 +61,8 @@ public class RemoteActionItemInfo extends ItemInfoWithIcon { public boolean shouldStartInLauncher() { return mShouldStart; } + + public boolean isEscapeHatch() { + return mToken.contains("item_type:[ESCAPE_HATCH]"); + } } diff --git a/src/com/android/launcher3/views/SearchResultIconRow.java b/src/com/android/launcher3/views/SearchResultIconRow.java index c73eeaefdf..6d9c86a9a7 100644 --- a/src/com/android/launcher3/views/SearchResultIconRow.java +++ b/src/com/android/launcher3/views/SearchResultIconRow.java @@ -140,7 +140,7 @@ public class SearchResultIconRow extends DoubleShadowBubbleTextView implements RemoteActionItemInfo itemInfo = new RemoteActionItemInfo(remoteAction, token, start); applyFromRemoteActionInfo(itemInfo); - if (!loadIconFromResource()) { + if (itemInfo.isEscapeHatch() || !loadIconFromResource()) { UI_HELPER_EXECUTOR.post(() -> { // If the Drawable from the remote action is not AdaptiveBitmap, styling will not // work.