summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinit Nayak <peanutbutter@google.com>2022-01-06 13:26:11 -0800
committerVinit Nayak <peanutbutter@google.com>2022-01-06 13:37:46 -0800
commitc09012766b7a0b04931876df09e62655c3eff87f (patch)
tree2f53b3b6fa0b90478c5d065b8a71b861b7a14391
parentb57235563c925ca9097e2d4a466b45dd0766d536 (diff)
downloadLauncher3-c09012766b7a0b04931876df09e62655c3eff87f.tar.gz
Don't show split option if device in "Lock task mode"
fixes: 199342537 Change-Id: Id212cce20b792fb8b16e9fa8eca4635773ae5ea7
-rw-r--r--quickstep/src/com/android/quickstep/TaskOverlayFactory.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index 02468497bb..276e1c2a6f 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -23,6 +23,7 @@ import static com.android.quickstep.views.OverviewActionsView.DISABLED_NO_THUMBN
import static com.android.quickstep.views.OverviewActionsView.DISABLED_ROTATED;
import android.annotation.SuppressLint;
+import android.app.ActivityManager;
import android.content.Context;
import android.graphics.Insets;
import android.graphics.Matrix;
@@ -54,6 +55,7 @@ import com.android.quickstep.views.TaskView;
import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
+import com.android.systemui.shared.system.ActivityManagerWrapper;
import java.util.ArrayList;
import java.util.List;
@@ -115,8 +117,9 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
* Does NOT add split options in the following scenarios:
* * The taskView to add split options is already showing split screen tasks
* * There aren't at least 2 tasks in overview to show split options for
+ * * Device is in "Lock task mode"
* * The taskView to show split options for is the focused task AND we haven't started
- * scrolling in overview (if we haven't scrolled, there's a split overview action so
+ * scrolling in overview (if we haven't scrolled, there's a split overview action button so
* we don't need this menu option)
*/
private static void addSplitOptions(List<SystemShortcut> outShortcuts,
@@ -130,7 +133,11 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
boolean isFocusedTask = deviceProfile.overviewShowAsGrid && taskView.isFocusedTask();
boolean isTaskInExpectedScrollPosition =
recentsView.isTaskInExpectedScrollPosition(recentsView.indexOfChild(taskView));
- if (taskViewHasMultipleTasks || notEnoughTasksToSplit ||
+ ActivityManager activityManager =
+ (ActivityManager) taskView.getContext().getSystemService(Context.ACTIVITY_SERVICE);
+ boolean isLockTaskMode = activityManager.isInLockTaskMode();
+
+ if (taskViewHasMultipleTasks || notEnoughTasksToSplit || isLockTaskMode ||
(isFocusedTask && isTaskInExpectedScrollPosition)) {
return;
}