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

Commit c3abfb8d authored by Anton Potapov's avatar Anton Potapov Committed by Automerger Merge Worker
Browse files

Merge "Synchronously call callback when load is cancelled" into udc-qpr-dev...

Merge "Synchronously call callback when load is cancelled" into udc-qpr-dev am: 7ac68504 am: 69eed5ee

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23589236



Change-Id: If342f5dc367e069165c4c3881cf95cc64283e516
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f0038e3e 69eed5ee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@ open class ControlsBindingControllerImpl @Inject constructor(
                Log.d(TAG, "Canceling loadSubscribtion")
                it.invoke()
            }
            callback.error("Load cancelled")
        }

        override fun onSubscribe(token: IBinder, subs: IControlsSubscription) {
+2 −5
Original line number Diff line number Diff line
@@ -116,11 +116,7 @@ class ControlsBindingControllerImplTest : SysuiTestCase() {

    @Test
    fun testBindAndLoad_cancel() {
        val callback = object : ControlsBindingController.LoadCallback {
            override fun error(message: String) {}

            override fun accept(t: List<Control>) {}
        }
        val callback = mock(ControlsBindingController.LoadCallback::class.java)
        val subscription = mock(IControlsSubscription::class.java)

        val canceller = controller.bindAndLoad(TEST_COMPONENT_NAME_1, callback)
@@ -130,6 +126,7 @@ class ControlsBindingControllerImplTest : SysuiTestCase() {

        canceller.run()
        verify(providers[0]).cancelSubscription(subscription)
        verify(callback).error(any())
    }

    @Test