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

This commit is contained in:
Shawn Lin
2022-08-26 01:56:55 +00:00
committed by Android (Google) Code Review

View File

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