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

Commit 067e8175 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Only treat "null" bounds as fullscreen

When long pressing on the recents button, we made it one pixel smaller
than fullscreen so we don't dismiss the stack immediately again.
However, this is a huge hack, and lead to problems with navigation bar
background because there we actually rely on the fact whether
the window is fullscreen or not to determine whether to draw the
navigation bar background, which lead to flickering.

Bug: 26777526
Change-Id: Ifdfcf3ad4138bc88c5164177cd20f1ff1635085f
parent 0a932141
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ public class WindowManagerProxy {
        @Override
        public void run() {
            try {
                ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true, false,
                ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true, true,
                        false);
            } catch (RemoteException e) {
                Log.w(TAG, "Failed to resize stack: " + e);
+1 −10
Original line number Diff line number Diff line
@@ -1115,16 +1115,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                Point realSize = new Point();
                mContext.getSystemService(DisplayManager.class).getDisplay(Display.DEFAULT_DISPLAY)
                        .getRealSize(realSize);
                Rect initialBounds;

                // Hack level over 9000: Make it one pixel smaller so activity manager doesn't
                // dismiss it immediately again. Remove once b/26777526 is fixed.
                if (mContext.getResources().getConfiguration().orientation
                        == Configuration.ORIENTATION_LANDSCAPE) {
                    initialBounds = new Rect(0, 0, realSize.x - 1, realSize.y);
                } else {
                    initialBounds = new Rect(0, 0, realSize.x, realSize.y - 1);
                }
                Rect initialBounds= new Rect(0, 0, realSize.x, realSize.y);
                boolean docked = mRecents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE,
                        ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT,
                        initialBounds);
+18 −0
Original line number Diff line number Diff line
@@ -252,10 +252,12 @@ import static android.Manifest.permission.START_TASKS_FROM_RECENTS;
import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT;
import static android.app.ActivityManager.RESIZE_MODE_PRESERVE_WINDOW;
import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FIRST_STATIC_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManager.StackId.LAST_STATIC_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.content.pm.PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT;
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
@@ -17632,6 +17634,22 @@ public final class ActivityManagerService extends ActivityManagerNative
            final long origId = Binder.clearCallingIdentity();
            final ActivityStack stack = mStackSupervisor.getStack(fromStackId);
            if (stack != null) {
                if (fromStackId == DOCKED_STACK_ID) {
                    // We are moving all tasks from the docked stack to the fullscreen stack, which
                    // is dismissing the docked stack, so resize all other stacks to fullscreen here
                    // already so we don't end up with resize trashing.
                    for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) {
                        if (StackId.isResizeableByDockedStack(i)) {
                            ActivityStack otherStack = mStackSupervisor.getStack(i);
                            if (otherStack != null) {
                                mStackSupervisor.resizeStackLocked(i,
                                        null, null, null, PRESERVE_WINDOWS,
                                        true /* allowResizeInDockedMode */);
                            }
                        }
                    }
                }
                final ArrayList<TaskRecord> tasks = stack.getAllTasks();
                final int size = tasks.size();
                if (onTop) {
+0 −6
Original line number Diff line number Diff line
@@ -1889,12 +1889,6 @@ public final class ActivityStackSupervisor implements DisplayListener {

    private void resizeStackUncheckedLocked(ActivityStack stack, Rect bounds, Rect tempTaskBounds,
            Rect tempTaskInsetBounds) {
        if (bounds != null && mWindowManager.isFullscreenBounds(stack.mStackId, bounds)) {
            // The bounds passed in corresponds to the fullscreen bounds which we normally
            // represent with null. Go ahead and set it to null so that all tasks configuration
            // can have the right fullscreen state.
            bounds = null;
        }
        bounds = TaskRecord.validateBounds(bounds);

        mTmpBounds.clear();
+2 −4
Original line number Diff line number Diff line
@@ -289,11 +289,9 @@ class Task implements DimLayer.DimLayerUser {
        if (displayContent != null) {
            displayContent.getLogicalDisplayRect(mTmpRect);
            rotation = displayContent.getDisplayInfo().rotation;
            if (bounds == null) {
            mFullscreen = bounds == null;
            if (mFullscreen) {
                bounds = mTmpRect;
                mFullscreen = true;
            } else {
                mFullscreen = mTmpRect.equals(bounds);
            }
        }

Loading