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

Commit 0f255612 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] avoid calling update on removed UMOs in the new list." into main

parents c6cb2fc5 2086464d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.media.controls.ui.util

import androidx.recyclerview.widget.ListUpdateCallback
import com.android.systemui.media.controls.ui.viewmodel.MediaCommonViewModel
import kotlin.math.min

/** A [ListUpdateCallback] to apply media events needed to reach the new state. */
class MediaViewModelListUpdateCallback(
@@ -46,7 +47,7 @@ class MediaViewModelListUpdateCallback(
    }

    override fun onChanged(position: Int, count: Int, payload: Any?) {
        for (i in position until position + count) {
        for (i in position until min(position + count, new.size)) {
            onUpdated(new[i], position)
        }
    }