mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Exclude home and recents activity types when overriding recents-excluded tasks
These tasks could point to overview itself, causing a very confusing screenshot. By excluding these tasks, we will default to using the task preview
Flag: NONE bug fix
Fixes: 336334715
Test: used circle to search from home, swiped to home, then pressed "select" overview action button. also checked temp logs
Change-Id: I0b0ca50585413b479e4830f06b57b8b5e19670a8
(cherry picked from commit 3eb4efac95)
This commit is contained in:
@@ -233,7 +233,7 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
* If the given task holds an activity that is excluded from recents, and there
|
||||
* is another running task that is not excluded from recents, returns that underlying task.
|
||||
*/
|
||||
public @Nullable CachedTaskInfo otherVisibleTaskThisIsExcludedOver() {
|
||||
public @Nullable CachedTaskInfo getVisibleNonExcludedTask() {
|
||||
if (mTopTask == null
|
||||
|| (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0) {
|
||||
// Not an excluded task.
|
||||
@@ -241,7 +241,9 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
||||
}
|
||||
List<RunningTaskInfo> visibleNonExcludedTasks = mAllCachedTasks.stream()
|
||||
.filter(t -> t.isVisible
|
||||
&& (t.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0)
|
||||
&& (t.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0
|
||||
&& t.getActivityType() != ACTIVITY_TYPE_HOME
|
||||
&& t.getActivityType() != ACTIVITY_TYPE_RECENTS)
|
||||
.toList();
|
||||
return visibleNonExcludedTasks.isEmpty() ? null
|
||||
: new CachedTaskInfo(visibleNonExcludedTasks);
|
||||
|
||||
@@ -1162,7 +1162,7 @@ public class TouchInteractionService extends Service {
|
||||
// running activity as the task behind the overlay.
|
||||
TopTaskTracker.CachedTaskInfo otherVisibleTask = runningTask == null
|
||||
? null
|
||||
: runningTask.otherVisibleTaskThisIsExcludedOver();
|
||||
: runningTask.getVisibleNonExcludedTask();
|
||||
if (otherVisibleTask != null) {
|
||||
ActiveGestureLog.INSTANCE.addLog(new CompoundString("Changing active task to ")
|
||||
.append(otherVisibleTask.getPackageName())
|
||||
|
||||
Reference in New Issue
Block a user