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

Commit 76386f47 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-dev

parents 0f8269e6 72cdc50a
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()