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

Commit 64be82e0 authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix bubbles appearing in recent task list

Test: atest RecentTasksTest
Test: add bubble, expand it, collapse it, check the activity
      for it is not in recents.
Fixes: 182581373
Change-Id: Iafd1c5204da0858dce44449c3cb208f6c0df16c1
parent 94424ac4
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -58,8 +58,6 @@ import android.content.pm.ParceledListSlice;
import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Environment;
import android.os.IBinder;
import android.os.RemoteException;
@@ -1345,6 +1343,7 @@ class RecentTasks {
                    + " inactiveDuration=" + task.getInactiveDuration()
                    + " activityType=" + task.getActivityType()
                    + " windowingMode=" + task.getWindowingMode()
                    + " isAlwaysOnTopWhenVisible=" + task.isAlwaysOnTopWhenVisible()
                    + " intentFlags=" + task.getBaseIntent().getFlags());
        }

@@ -1380,7 +1379,7 @@ class RecentTasks {
                break;
            case WINDOWING_MODE_MULTI_WINDOW:
                // Ignore tasks that are always on top
                if (task.isAlwaysOnTop()) {
                if (task.isAlwaysOnTopWhenVisible()) {
                    return false;
                }
                break;
+7 −0
Original line number Diff line number Diff line
@@ -5276,6 +5276,13 @@ class Task extends WindowContainer<WindowContainer> {
        return !isForceHidden() && super.isAlwaysOnTop();
    }

    /**
     * @return whether this task is always on top without taking visibility into account.
     */
    public boolean isAlwaysOnTopWhenVisible() {
        return super.isAlwaysOnTop();
    }

    /**
     * Returns whether this task is currently forced to be hidden for any reason.
     */
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_TASK_ORG;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
@@ -754,6 +755,7 @@ public class RecentTasksTest extends WindowTestsBase {
        final Task alwaysOnTopTask = taskDisplayArea.createRootTask(WINDOWING_MODE_MULTI_WINDOW,
                ACTIVITY_TYPE_STANDARD, true /* onTop */);
        alwaysOnTopTask.setAlwaysOnTop(true);
        alwaysOnTopTask.setForceHidden(FLAG_FORCE_HIDDEN_FOR_TASK_ORG, true);

        assertFalse("Always on top tasks should not be visible recents",
                mRecentTasks.isVisibleRecentTask(alwaysOnTopTask));