Fix NPE when calculateTransitionInfo

mParent can only be organized window.

Bug: 194112093
Test: cts/framework/gce-presubmit-wm-cloud-tf-1-shelltransit
Change-Id: Iabe7e7998326defb7c58d31c943f2fc2531a82fe
This commit is contained in:
Chris Li
2022-01-27 14:49:13 +08:00
parent 077c836e99
commit 9e93fa7aff
2 changed files with 7 additions and 0 deletions

View File

@@ -1080,6 +1080,10 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
for (WindowContainer<?> p = wc.getParent(); p != null; p = p.getParent()) {
final ChangeInfo parentChange = changes.get(p);
if (parentChange == null || !parentChange.hasChanged(p)) break;
if (p.mRemoteToken == null) {
// Intermediate parents must be those that has window to be managed by Shell.
continue;
}
if (parentChange.mParent != null && !skipIntermediateReports) {
changes.get(wc).mParent = p;
// The chain above the parent was processed.

View File

@@ -739,6 +739,9 @@ public class TransitionTests extends WindowTestsBase {
}
from = from.getParent();
}
if (end.asDisplayArea() != null) {
end.asDisplayArea().mOrganizer = organizer;
}
}
/** Fill the change map with all the parents of top. Change maps are usually fully populated */