diff options
| author | 2021-03-22 20:28:41 +0000 | |
|---|---|---|
| committer | 2021-03-22 20:28:41 +0000 | |
| commit | a8d563cf30fd2b1eed07a8b34bac6cfa94711b8f (patch) | |
| tree | 65794298357e74fc3630f47bee69e29bf3e6fb52 | |
| parent | 71cf0b48ceb1717bec463cf838690e597bd415a6 (diff) | |
| parent | 82378198a9fb4b65acfaab9e78ead1fe6afcb688 (diff) | |
Merge "Fix NPE in ActivityRecord.inSizeCompatMode()" into sc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 7c236617d14f..eadfbe2c4ac0 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -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. |