Update Home task bounds when display size changed in kids mode

Otherwise the Home task would show incorrect size on different
orientation.

Bug: 266507175
Test: Enter Kids mode launcher and rotate device
Change-Id: Icf258a1bc7b3399f56983ea2670316824bfafe68
This commit is contained in:
Shawn Lin
2023-02-26 08:50:50 +00:00
parent 9fb9f4cf62
commit b42ed1c2d4

View File

@@ -247,6 +247,11 @@ public class KidsModeTaskOrganizer extends ShellTaskOrganizer {
mLaunchRootTask = taskInfo;
}
if (mHomeTask != null && mHomeTask.taskId == taskInfo.taskId
&& !taskInfo.equals(mHomeTask)) {
mHomeTask = taskInfo;
}
super.onTaskInfoChanged(taskInfo);
}
@@ -364,6 +369,7 @@ public class KidsModeTaskOrganizer extends ShellTaskOrganizer {
final WindowContainerTransaction wct = getWindowContainerTransaction();
final Rect taskBounds = calculateBounds();
wct.setBounds(mLaunchRootTask.token, taskBounds);
wct.setBounds(mHomeTask.token, new Rect(0, 0, mDisplayWidth, mDisplayHeight));
mSyncQueue.queue(wct);
final SurfaceControl finalLeash = mLaunchRootLeash;
mSyncQueue.runInSync(t -> {