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

Commit cf51487f authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Remove emptyView from AodBurnInSection

When the shade window moves, the emptyView was not removed from the ConstraintLayout, resulting in an exception when addviews was called again (as it was added despite having a parent already)

Bug: 362719719
Test: Moved the shade and verified this doesn't crash sysui with the flag turned on.
Flag: com.android.systemui.shade_window_goes_around
Change-Id: I1b144a359e3a4707788072919646bde2293d92ee
parent a1317228
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.keyguard.ui.view.layout.sections

import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.constraintlayout.widget.ConstraintSet.BOTTOM
@@ -47,11 +48,15 @@ constructor(
            visibility = View.GONE
        }
    }

    override fun addViews(constraintLayout: ConstraintLayout) {
        if (!MigrateClocksToBlueprint.isEnabled) {
            return
        }

        if (emptyView.parent != null) {
            // As emptyView is lazy, it might be already attached.
            (emptyView.parent as? ViewGroup)?.removeView(emptyView)
        }
        constraintLayout.addView(emptyView)
        burnInLayer =
            AodBurnInLayer(context).apply {