Merge "Fix NPE when leaving kids mode" into tm-qpr-dev am: ef35f3a638

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19693479

Change-Id: I74772f3f52059d8c0e876a0be29f531e49252ad3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shawn Lin
2022-08-26 02:02:52 +00:00
committed by Automerger Merge Worker

View File

@@ -316,11 +316,13 @@ public class KidsModeTaskOrganizer extends ShellTaskOrganizer {
true /* onTop */);
wct.reorder(rootToken, mEnabled /* onTop */);
mSyncQueue.queue(wct);
final SurfaceControl rootLeash = mLaunchRootLeash;
mSyncQueue.runInSync(t -> {
t.setPosition(rootLeash, taskBounds.left, taskBounds.top);
t.setWindowCrop(rootLeash, taskBounds.width(), taskBounds.height());
});
if (mEnabled) {
final SurfaceControl rootLeash = mLaunchRootLeash;
mSyncQueue.runInSync(t -> {
t.setPosition(rootLeash, taskBounds.left, taskBounds.top);
t.setWindowCrop(rootLeash, taskBounds.width(), taskBounds.height());
});
}
}
private Rect calculateBounds() {