mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Ignore pinned tasks for purposes of gesture nav" into tm-dev am: 238f380853
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18638308 Change-Id: I81ecdda6bdc41f52ef4cb4be6344b519b742190a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -15,12 +15,13 @@
|
||||
*/
|
||||
package com.android.quickstep;
|
||||
|
||||
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.content.Intent.ACTION_CHOOSER;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
|
||||
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
||||
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_ASSISTANT;
|
||||
|
||||
import android.app.ActivityManager.RunningTaskInfo;
|
||||
import android.content.Context;
|
||||
@@ -64,6 +65,7 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
|
||||
private final StagedSplitTaskPosition mMainStagePosition = new StagedSplitTaskPosition();
|
||||
private final StagedSplitTaskPosition mSideStagePosition = new StagedSplitTaskPosition();
|
||||
private int mPinnedTaskId = INVALID_TASK_ID;
|
||||
|
||||
private TopTaskTracker(Context context) {
|
||||
mMainStagePosition.stageType = SplitConfigurationOptions.STAGE_TYPE_MAIN;
|
||||
@@ -132,8 +134,18 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPinned(String packageName, int userId, int taskId, int stackId) {
|
||||
mPinnedTaskId = taskId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityUnpinned() {
|
||||
mPinnedTaskId = INVALID_TASK_ID;
|
||||
}
|
||||
|
||||
private void resetTaskId(StagedSplitTaskPosition taskPosition) {
|
||||
taskPosition.taskId = -1;
|
||||
taskPosition.taskId = INVALID_TASK_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +153,8 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
* Will return empty array if device is not in staged split
|
||||
*/
|
||||
public int[] getRunningSplitTaskIds() {
|
||||
if (mMainStagePosition.taskId == -1 || mSideStagePosition.taskId == -1) {
|
||||
if (mMainStagePosition.taskId == INVALID_TASK_ID
|
||||
|| mSideStagePosition.taskId == INVALID_TASK_ID) {
|
||||
return new int[]{};
|
||||
}
|
||||
int[] out = new int[2];
|
||||
@@ -175,7 +188,11 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
false /* filterOnlyVisibleRecents */));
|
||||
Collections.addAll(mOrderedTaskList, tasks);
|
||||
}
|
||||
return new CachedTaskInfo(new ArrayList<>(mOrderedTaskList));
|
||||
|
||||
// Strip the pinned task
|
||||
ArrayList<RunningTaskInfo> tasks = new ArrayList<>(mOrderedTaskList);
|
||||
tasks.removeIf(t -> t.taskId == mPinnedTaskId);
|
||||
return new CachedTaskInfo(tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +211,7 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
}
|
||||
|
||||
public int getTaskId() {
|
||||
return mTopTask == null ? -1 : mTopTask.taskId;
|
||||
return mTopTask == null ? INVALID_TASK_ID : mTopTask.taskId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user