public static @Nullable Bitmap createLargeIconBitmap(final Context context, final Drawable drawable, final String pkg) {
		final int icon_size = Objects.requireNonNull((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getLauncherLargeIconSize();
		final Drawable icon = new IconResizer(icon_size).createIconThumbnail(drawable);	// Resize the app icon in case it's too large. (also avoid TransactionTooLargeException)
		icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
		final Bitmap bitmap = drawableToBitmap(icon);
		if (bitmap == null) Analytics.$().event("invalid_app_icon").with(ITEM_ID, pkg).with(ITEM_CATEGORY, drawable.getClass().getName()).send();
		return bitmap;
	}
Helper for shortcut icon.

Created by Oasis on 2017/9/18.
shared/src/main/java/com/oasisfeng/island/shortcut/ShortcutIcons.java