Merge "Fix NPE in ActivityRecord.inSizeCompatMode()" into sc-dev

This commit is contained in:
Yuncheol Heo
2021-03-22 20:28:41 +00:00
committed by Android (Google) Code Review

View File

@@ -6790,7 +6790,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// The app bounds hasn't been computed yet.
return false;
}
final Configuration parentConfig = getParent().getConfiguration();
final WindowContainer parent = getParent();
if (parent == null) {
// The parent of detached Activity can be null.
return false;
}
final Configuration parentConfig = parent.getConfiguration();
// Although colorMode, screenLayout, smallestScreenWidthDp are also fixed, generally these
// fields should be changed with density and bounds, so here only compares the most
// significant field.