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

Commit 5fa57299 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Preventing NPE crash if view is detached from window." into tm-dev am: 76386f47

parents 24650a74 76386f47
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()