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

Commit 7366fa04 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[RONs-AOD] clean AOD Skeleton parent before using it

Notifications inflate AOD Skeleton View on the background thread. When AndroidView needs re-composition, existing AOD Skeleton view can't be used since it has a parent. This CL removes it's parent to re-use it.

Fixes: 425120767
Flag: com.android.systemui.ui_rich_ongoing_aod_skeleton_bg_inflation
Test: Have a RON and wait for device to transition to LockScreen. No crash is expected.
Change-Id: I30a9d53d353f2f929cca1f23678a833050fd45ee
parent 7649dfa9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.view.View.MeasureSpec.EXACTLY
import android.view.View.MeasureSpec.UNSPECIFIED
import android.view.View.MeasureSpec.makeMeasureSpec
import android.view.View.VISIBLE
import android.view.ViewGroup
import android.view.ViewGroup.MarginLayoutParams
import android.view.ViewStub
import android.widget.Chronometer
@@ -160,6 +161,9 @@ fun AODPromotedNotificationView(
        AndroidView(
            factory = { context ->
                val notificationView = notificationViewFactory(context)
                if (notificationView.parent != null) {
                    (notificationView.parent as ViewGroup).removeView(notificationView)
                }
                val updater =
                    traceSection("$TAG.findViews") {
                        AODPromotedNotificationViewUpdater(notificationView)