Forwards onConfigurationChanged for PiP on reparenting

This fixes a regression caused by ag/5656236

PiP saves its last position on screen within
AppWindowToken.onConfigurationChanged callback, which is triggered by
Task.reparent before the task leaves pinned stack.

With ag/5656236, Task.reparent no longer triggers
AppWindowToken.onConfigurationChanged and instead, the latter will be
called when the task is added back to its original stack while the
pinned stack no longer exists.

Bug: 142504739
Test: atest PinnedStackTests#testEnterPictureInPictureSavePosition
Change-Id: I247a9da3113077031b442740445d836b0c176986
This commit is contained in:
Hongwei Wang
2019-10-11 11:37:34 -07:00
parent 98bfc27549
commit cd11aaaf2e

View File

@@ -121,8 +121,11 @@ class Task extends WindowContainer<AppWindowToken> implements ConfigurationConta
// TODO: Remove after unification.
@Override
public void onConfigurationChanged(Configuration newParentConfig) {
// Only forward configuration changes in cases where children won't get it from TaskRecord.
onConfigurationChanged(newParentConfig, mTaskRecord == null /*forwardToChildren*/);
// Forward configuration changes in cases
// - children won't get it from TaskRecord
// - it's a pinned task
onConfigurationChanged(newParentConfig,
(mTaskRecord == null) || inPinnedWindowingMode() /*forwardToChildren*/);
}
Task(int taskId, TaskStack stack, int userId, WindowManagerService service, int resizeMode,