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

Commit 9f6e9969 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Preventing NPE crash if view is detached from window." into tm-qpr-dev

parents 29a03b10 e4f2b2c0
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -87,20 +87,21 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView {

    fun onDisplayChanged(displayId: Int) {
        val oldMode: Display.Mode? = displayMode
        displayMode = display.mode
        val display: Display? = context.display
        displayMode = display?.mode

        if (displayUniqueId != context.display?.uniqueId) {
            displayUniqueId = context.display?.uniqueId
        if (displayUniqueId != display?.uniqueId) {
            displayUniqueId = display?.uniqueId
            shouldDrawCutout = DisplayCutout.getFillBuiltInDisplayCutout(
                    context.resources, displayUniqueId)
        }

        // Skip if display mode or cutout hasn't changed.
        if (!displayModeChanged(oldMode, displayMode) &&
                display.cutout == displayInfo.displayCutout) {
                display?.cutout == displayInfo.displayCutout) {
            return
        }
        if (displayId == display.displayId) {
        if (displayId == display?.displayId) {
            updateCutout()
            updateProtectionBoundingPath()
            onUpdate()