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

Commit 44bc4daf authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Only request resize for tasks on the freeform stack.

This fixes a crash during orientation changes, where window manager
requests a resize for a docked task, but activity manager throws an
exception since dock tasks can only be resized when their stack is
being resized.

Bug: 24575031

Change-Id: I954c4e6ae60931b30200b10c8a4834b0a5757606
parent 0fe8ea20
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1368,6 +1368,7 @@ public final class ActivityThread {
                    Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
                } break;
                case RELAUNCH_ACTIVITY: {
                    Log.d(TAG, "handleRelaunchActivity: " + msg.obj);
                    Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityRestart");
                    ActivityClientRecord r = (ActivityClientRecord)msg.obj;
                    handleRelaunchActivity(r);
@@ -3227,6 +3228,10 @@ public final class ActivityThread {

        if (r != null) {
            final Activity a = r.activity;
            if (a.toString().contains("Recents")) {
                Log.d(TAG, "handleResumeActivity ativity=" + a + ", windowAdded=" + a.mWindowAdded
                        + " " + Log.getStackTraceString(new Throwable()));
            }

            if (localLOGV) Slog.v(
                TAG, "Resume " + r + " started activity: " +
@@ -3969,6 +3974,10 @@ public final class ActivityThread {
                            r.window.clearContentView();
                        }
                    } else {
                        if (r.activity.toString().contains("Recents")) {
                            Log.d(TAG, "removeViewImmediate activity=" + r.activity + " "
                                    + Log.getStackTraceString(new Throwable()));
                        }
                        wm.removeViewImmediate(v);
                    }
                }
+6 −3
Original line number Diff line number Diff line
@@ -294,11 +294,14 @@ class Task implements DimLayer.DimLayerUser {
        if (setBounds(mTmpRect2, mOverrideConfig) != BOUNDS_CHANGE_NONE) {
            // Post message to inform activity manager of the bounds change simulating
            // a one-way call. We do this to prevent a deadlock between window manager
            // lock and activity manager lock been held.
            // lock and activity manager lock been held. Only tasks within the freeform stack
            // are resizeable independently of their stack resizing.
            if (mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID) {
                mService.mH.sendMessage(mService.mH.obtainMessage(
                        RESIZE_TASK, mTaskId, RESIZE_MODE_SYSTEM_SCREEN_ROTATION, mBounds));
            }
        }
    }

    void resizeWindows() {
        final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;