Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 934ff6e2 authored by Jonathan Miranda's avatar Jonathan Miranda
Browse files

[automerger] Fix bug where Launcher crashes when pinned shortcut has no icon. am: 01521b52

Change-Id: I6c3ec09a3133d7daa20dba69b1256acbf85d38ed
parents ab1c684a 01521b52
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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