Preventing DragAndDrop for PS apps.

This Cl restricts item dragging for PS apps from
all launcher surfaces such as AllApps, AppPredictionRow, etc.

Video: https://photos.app.goo.gl/PKGw8n23hJVJMyUk7

Flag: ACONFIG com.android.launcher3.Flags.private_space_restrict_item_drag DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I2c5dbaa325095ec63aedf39b6b2c269f745d58ca
This commit is contained in:
Himanshu Gupta
2024-01-30 09:00:12 +00:00
parent ea73bf5d77
commit 3ec66fb333
6 changed files with 38 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE_SPACE_SYS_APPS_DIVIDER;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_NOTHING;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_NOT_PINNABLE;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_PRIVATE_SPACE_INSTALL_APP;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
@@ -109,7 +110,7 @@ public class PrivateProfileManager extends UserProfileManager {
itemInfo.bitmap = bitmapInfo;
itemInfo.contentDescription = context.getResources().getString(
com.android.launcher3.R.string.ps_add_button_content_description);
itemInfo.runtimeStatusFlags |= FLAG_PRIVATE_SPACE_INSTALL_APP;
itemInfo.runtimeStatusFlags |= FLAG_PRIVATE_SPACE_INSTALL_APP | FLAG_NOT_PINNABLE;
BaseAllAppsAdapter.AdapterItem item = new BaseAllAppsAdapter.AdapterItem(VIEW_TYPE_ICON);
item.itemInfo = itemInfo;