Merge "Attemp to fix an NPE while transferStartingWindow."

This commit is contained in:
Wei Sheng Shih
2021-12-27 01:27:15 +00:00
committed by Android (Google) Code Review

View File

@@ -4007,6 +4007,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
private boolean transferStartingWindow(@NonNull ActivityRecord fromActivity) {
final WindowState tStartingWindow = fromActivity.mStartingWindow;
if (tStartingWindow != null && fromActivity.mStartingSurface != null) {
if (tStartingWindow.getParent() == null) {
// The window has been detached from the parent, so the window cannot be transfer
// to another activity because it may be in the remove process.
// Don't need to remove the starting window at this point because that will happen
// at #postWindowRemoveCleanupLocked
return false;
}
// In this case, the starting icon has already been displayed, so start
// letting windows get shown immediately without any more transitions.
if (fromActivity.mVisible) {