Fix crash when trying to load SystemShortcut drawable.
Bug: 127807969
Change-Id: I9d7e8bf5b6b45fe6ad61984ab2c0326926076d75
(cherry picked from commit 93e0594b3dc27cccc2251af40ecc2f3ab60c1eec)
(cherry picked from commit 95f821ac246e76b8c0be96c6c8b1b30e17f3c7df)
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index ec0462b..5163e5f 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -34,6 +34,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
+import android.widget.ImageView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.InsettableFrameLayout.LayoutParams;
@@ -48,6 +49,7 @@
import com.android.launcher3.folder.FolderShape;
import com.android.launcher3.graphics.ShiftedBitmapDrawable;
import com.android.launcher3.icons.LauncherIcons;
+import com.android.launcher3.popup.SystemShortcut;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
@@ -196,6 +198,9 @@
// Similar to DragView, we simply use the BubbleTextView icon here.
mDrawable = ((BubbleTextView) v).getIcon();
}
+ if (v instanceof ImageView && info instanceof SystemShortcut) {
+ mDrawable = ((ImageView) v).getDrawable();
+ }
if (mDrawable == null) {
mDrawable = Utilities.getFullDrawable(launcher, info, lp.width, lp.height,
useDrawableAsIs, new Object[1]);