summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-08-30 21:47:41 (GMT)
committerJon Miranda <jonmiranda@google.com>2017-08-30 21:47:41 (GMT)
commit01521b52a89500ed824f8aaa0a1f5d12fe45a75e (patch)
treef99000e0959e74c7a6c94b9dcc42cbfcaa840fdc
parent8f3285c1c56913031782a414f05df591593ea0ec (diff)
downloadandroid_packages_apps_Trebuchet-01521b52a89500ed824f8aaa0a1f5d12fe45a75e.zip
android_packages_apps_Trebuchet-01521b52a89500ed824f8aaa0a1f5d12fe45a75e.tar.gz
android_packages_apps_Trebuchet-01521b52a89500ed824f8aaa0a1f5d12fe45a75e.tar.bz2
Fix bug where Launcher crashes when pinned shortcut has no icon.
Bug: 65187090 Change-Id: Ica5b10e640cf4ab752055da2f4e352680ab26391
-rw-r--r--src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java b/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java
index 52abbc7..a70a9bb 100644
--- a/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java
+++ b/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java
@@ -25,7 +25,9 @@ import android.content.pm.LauncherApps.PinItemRequest;
import android.content.pm.ShortcutInfo;
import android.graphics.drawable.Drawable;
import android.os.Build;
+import android.os.Process;
+import com.android.launcher3.FastBitmapDrawable;
import com.android.launcher3.IconCache;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
@@ -69,8 +71,12 @@ class PinShortcutRequestActivityInfo extends ShortcutConfigActivityInfo {
@Override
public Drawable getFullResIcon(IconCache cache) {
- return mContext.getSystemService(LauncherApps.class)
+ Drawable d = mContext.getSystemService(LauncherApps.class)
.getShortcutIconDrawable(mInfo, LauncherAppState.getIDP(mContext).fillResIconDpi);
+ if (d == null) {
+ d = new FastBitmapDrawable(cache.getDefaultIcon(Process.myUserHandle()));
+ }
+ return d;
}
@Override