Remove Pin Prediction shortcut from private space app.

Before: https://screenshot.googleplex.com/68S4y4efJWQkyYk.png
After: https://screenshot.googleplex.com/8XdwUFGsYvHkEQ4.png

Bug: 319250810
Test: Manual
Flag: aconfig com.android.launcher.enable_delete_private_space_pin_shortcut DEVELOPMENT

Change-Id: I33ef2cc35c31f86101197405502d84ad98b36bdc
This commit is contained in:
Anushree Ganjam
2024-01-12 10:54:14 -08:00
parent 1cc90d802d
commit 245402984d

View File

@@ -41,6 +41,7 @@ import androidx.annotation.VisibleForTesting;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget;
import com.android.launcher3.Flags;
import com.android.launcher3.Hotseat;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.LauncherSettings;
@@ -55,6 +56,7 @@ import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -417,6 +419,10 @@ public class HotseatPredictionController implements DragController.DragListener,
if (itemInfo.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) {
return null;
}
if (Flags.enablePrivateSpace() && UserCache.getInstance(
activity.getApplicationContext()).getUserInfo(itemInfo.user).isPrivate()) {
return null;
}
return new PinPrediction(activity, itemInfo, originalView);
}