Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82378198 authored by Yuncheol Heo's avatar Yuncheol Heo
Browse files

Fix NPE in ActivityRecord.inSizeCompatMode()

- Since commit c3cb0cb1, isSizeCompatMode is included in protoDump.
  If ActivityMetricsLogger dumps log and the Activity is in detached
  state, then 'parent' can be null.

Bug: 183043632
Test: atest AndroidCarApiTest in cf_x86_auto-userdebug
Change-Id: I823e787ce4f1c70736edcb10e043a4062a31e774
parent c415157f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -6772,7 +6772,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.