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
This commit is contained in:
Filip Gruszczynski
2015-10-03 13:59:49 -07:00
parent 0fe8ea2096
commit 44bc4daff3
2 changed files with 15 additions and 3 deletions

View File

@@ -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);
}
}

View File

@@ -294,9 +294,12 @@ 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.
mService.mH.sendMessage(mService.mH.obtainMessage(
RESIZE_TASK, mTaskId, RESIZE_MODE_SYSTEM_SCREEN_ROTATION, mBounds));
// 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));
}
}
}