diff options
| author | 2021-12-08 19:05:06 +0800 | |
|---|---|---|
| committer | 2021-12-09 07:16:10 +0000 | |
| commit | 571c1f9bf000a31b4e089871ff35218821229038 (patch) | |
| tree | d8a9ef6a935d65ec07b05250d013ea04a0622804 | |
| parent | 20e71a637f90179ded4eb333a31f1983cec88454 (diff) | |
Override the fillsParent() on TaskFragment
The default implementation of fillsParent() on TaskFragment which
results in the system can not get the specified orientation from the
activity in TaskFragment when traversing the windowContainers with
getOrientation().
Move the implementation of fillsParent() from Task to TaskFragment.
Report the taskFragment fills the parent in a full screen window
or matches the parents' bounds. So, we can get the orientation from
activity successfully.
Bug: 207605841
Test: Launch wallpaper picker and check the orientation when rotate
Change-Id: Ieb7e7e009fcfb337b2c7def1b892831d09d98951
| -rw-r--r-- | services/core/java/com/android/server/wm/Task.java | 8 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskFragment.java | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index a53a8cdea0a7..dd253ea213f6 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -3141,14 +3141,6 @@ class Task extends TaskFragment { } @Override - boolean fillsParent() { - // From the perspective of policy, we still want to report that this task fills parent - // in fullscreen windowing mode even it doesn't match parent bounds because there will be - // letterbox around its real content. - return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds(); - } - - @Override void forAllLeafTasks(Consumer<Task> callback, boolean traverseTopToBottom) { final int count = mChildren.size(); boolean isLeafTask = true; diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index 510ca7775263..25790cb035df 100644 --- a/services/core/java/com/android/server/wm/TaskFragment.java +++ b/services/core/java/com/android/server/wm/TaskFragment.java @@ -2346,6 +2346,14 @@ class TaskFragment extends WindowContainer<WindowContainer> { return true; } + @Override + boolean fillsParent() { + // From the perspective of policy, we still want to report that this task fills parent + // in fullscreen windowing mode even it doesn't match parent bounds because there will be + // letterbox around its real content. + return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds(); + } + boolean dump(String prefix, FileDescriptor fd, PrintWriter pw, boolean dumpAll, boolean dumpClient, String dumpPackage, final boolean needSep, Runnable header) { boolean printed = false; |