Merge changes from topic "p-shortcut-impl" into main

* changes:
  Widget Picker: Update the launcher integration to support shortcuts
  Widget Picker: Update UI layer to support shortcuts
  Widget Picker: Update data layer to support shortcuts
This commit is contained in:
Shamali Patwa
2025-06-09 11:02:42 -07:00
committed by Android (Google) Code Review
21 changed files with 660 additions and 527 deletions

View File

@@ -21,6 +21,7 @@ import static android.view.View.MeasureSpec.makeMeasureSpec;
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.launcher3.icons.FastBitmapDrawable.getDisabledColorFilter;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -635,7 +636,8 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
// When widgets are dropped from another window, we don't want to remove the
// dragView on resume of launcher.
if (Flags.enableWidgetPickerRefactor()
&& ((DragView<?>) child).mItemType != ITEM_TYPE_APPWIDGET) {
&& ((DragView<?>) child).mItemType != ITEM_TYPE_APPWIDGET
&& ((DragView<?>) child).mItemType != ITEM_TYPE_DEEP_SHORTCUT) {
dragLayer.removeView(child);
}
}

View File

@@ -134,7 +134,7 @@ public abstract class ShortcutConfigActivityInfo implements CachedObject {
@TargetApi(26)
public static class ShortcutConfigActivityInfoVO extends ShortcutConfigActivityInfo {
private final LauncherActivityInfo mInfo;
public final LauncherActivityInfo mInfo;
public ShortcutConfigActivityInfoVO(LauncherActivityInfo info) {
super(info.getComponentName(), info.getUser(),

View File

@@ -51,7 +51,6 @@ import com.android.launcher3.pm.ShortcutConfigActivityInfo;
import com.android.launcher3.util.CancellableTask;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.util.WidgetSizes;
import java.util.concurrent.ExecutionException;
@@ -272,8 +271,7 @@ public class DatabaseWidgetPreviewLoader {
private Bitmap generateShortcutPreview(
ShortcutConfigActivityInfo info, int maxWidth, int maxHeight) {
int iconSize = ActivityContext.lookupContext(
mContext).getDeviceProfile().getAllAppsProfile().getIconSizePx();
int iconSize = mDeviceProfile.getAllAppsProfile().getIconSizePx();
int padding = mContext.getResources()
.getDimensionPixelSize(R.dimen.widget_preview_shortcut_padding);