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

Commit 3e273cda authored by Austin Tankiang's avatar Austin Tankiang Committed by Android (Google) Code Review
Browse files

Merge "Turn FakeObserver into a anonymous object" into main

parents 574829ca d8510bda
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import com.android.documentsui.ActionHandler
import com.android.documentsui.ActionModeController
import com.android.documentsui.BaseActivity
import com.android.documentsui.DirectoryResult
import com.android.documentsui.DocsSelectionHelper
import com.android.documentsui.Injector
import com.android.documentsui.MenuManager
import com.android.documentsui.ProfileTabsController
@@ -130,16 +129,14 @@ class DirectoryFragmentTest {
        assertThat(injector.selectionMgr.selection).hasSize(2)

        // Add an observer to the selection manager.
        class FakeObserver(
            private val selectionMgr: DocsSelectionHelper,
        ) : SelectionTracker.SelectionObserver<String>() {
        val observer =
            object : SelectionTracker.SelectionObserver<String>() {
                var selections = MutableSelection<String>()

                override fun onSelectionChanged() {
                selectionMgr.copySelection(selections)
                    injector.selectionMgr.copySelection(selections)
                }
            }
        val observer = FakeObserver(injector.selectionMgr)
        injector.selectionMgr.addObserver(observer)

        // model.update() will trigger a updateLayout() call in ModelUpdateListener, which then