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

Commit 68532621 authored by Himanshu Gupta's avatar Himanshu Gupta Committed by Android (Google) Code Review
Browse files

Merge "Disable Saving App Pairs for Private Space Apps" into main

parents 21393f46 e7b86b22
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
import com.android.launcher3.model.WellbeingModel;
import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.popup.SystemShortcut.AppInfo;
import com.android.launcher3.util.InstantAppResolver;
@@ -61,6 +62,7 @@ import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecsFutur
import com.android.systemui.shared.recents.view.RecentsTransition;
import com.android.systemui.shared.system.ActivityManagerWrapper;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
@@ -319,13 +321,18 @@ public interface TaskShortcutFactory {
                    recentsView.isTaskInExpectedScrollPosition(recentsView.indexOfChild(taskView));
            boolean shouldShowActionsButtonInstead =
                    isLargeTileFocusedTask && isInExpectedScrollPosition;
            boolean hasUnpinnableApp = Arrays.stream(taskView.getTaskIdAttributeContainers())
                    .anyMatch(att -> att != null && att.getItemInfo() != null
                            && ((att.getItemInfo().runtimeStatusFlags
                                & ItemInfoWithIcon.FLAG_NOT_PINNABLE) != 0));

            // No "save app pair" menu item if:
            // - app pairs feature is not enabled
            // - the task in question is a single task
            // - at least one app in app pair is unpinnable
            // - the Overview Actions Button should be visible
            if (!FeatureFlags.enableAppPairs() || !taskView.containsMultipleTasks()
                    || shouldShowActionsButtonInstead) {
                    || hasUnpinnableApp || shouldShowActionsButtonInstead) {
                return null;
            }

+7 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_NOT_PINNABLE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
@@ -83,6 +84,7 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestLogging;
@@ -501,6 +503,11 @@ public class TaskView extends FrameLayout implements Reusable {
        if (getRecentsView() != null) {
            stubInfo.screenId = getRecentsView().indexOfChild(this);
        }
        if (Flags.privateSpaceRestrictAccessibilityDrag()) {
            if (UserCache.getInstance(getContext()).getUserInfo(componentKey.user).isPrivate()) {
                stubInfo.runtimeStatusFlags |= FLAG_NOT_PINNABLE;
            }
        }
        return stubInfo;
    }