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

Commit 04ad7b14 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Fixed issue with not force resizing a task when drag ends.

We were checking mResizing when the drag ends to see if we
should force resize, but it was being set to false just before
the force resize check in endDragLocked.

Also, don't call AM to resize task if bounds isn't going to change.

Change-Id: Ice2c32a0f15f7489a7c80f21bd79c31104ba4487
parent 150c5ae2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3091,7 +3091,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
        Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "am.resizeTask_" + task.taskId);

        final Configuration overrideConfig =  task.updateOverrideConfiguration(bounds);
        // This variable holds information whether the configuration didn't change in a signficant
        // This variable holds information whether the configuration didn't change in a significant
        // way and the activity was kept the way it was. If it's false, it means the activity had
        // to be relaunched due to configuration change.
        boolean kept = true;
+13 −7
Original line number Diff line number Diff line
@@ -146,13 +146,18 @@ class TaskPositioner implements DimLayer.DimLayerUser {
                        }
                        synchronized (mService.mWindowMap) {
                            mDragEnded = notifyMoveLocked(newX, newY);
                            mTask.getBounds(mTmpRect);
                        }
                        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "wm.TaskPositioner.resizeTask");
                        if (!mTmpRect.equals(mWindowDragBounds)) {
                            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER,
                                    "wm.TaskPositioner.resizeTask");
                            try {
                                mService.mActivityManager.resizeTask(
                                        mTask.mTaskId, mWindowDragBounds, RESIZE_MODE_USER);
                        } catch(RemoteException e) {}
                            } catch (RemoteException e) {
                            }
                            Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
                        }
                    } break;

                    case MotionEvent.ACTION_UP: {
@@ -171,11 +176,12 @@ class TaskPositioner implements DimLayer.DimLayerUser {
                }

                if (mDragEnded) {
                    final boolean wasResizing = mResizing;
                    synchronized (mService.mWindowMap) {
                        endDragLocked();
                    }
                    try {
                        if (mResizing) {
                        if (wasResizing) {
                            // We were using fullscreen surface during resizing. Request
                            // resizeTask() one last time to restore surface to window size.
                            mService.mActivityManager.resizeTask(