Fixes failing CustomizationProviderTest. am: 3528f21216 am: 19762ee362

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

Change-Id: I2c37b03a3907ec4cee529b5d5615d5ab2c520a07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alejandro Nijamkin
2023-02-17 08:43:55 +00:00
committed by Automerger Merge Worker
2 changed files with 3 additions and 4 deletions

View File

@@ -131,7 +131,7 @@ class CustomizationProvider :
throw UnsupportedOperationException()
}
return runBlocking { insertSelection(values) }
return runBlocking(mainDispatcher) { insertSelection(values) }
}
override fun query(
@@ -171,7 +171,7 @@ class CustomizationProvider :
throw UnsupportedOperationException()
}
return runBlocking { deleteSelection(uri, selectionArgs) }
return runBlocking(mainDispatcher) { deleteSelection(uri, selectionArgs) }
}
override fun call(method: String, arg: String?, extras: Bundle?): Bundle? {

View File

@@ -62,7 +62,6 @@ import com.android.systemui.util.mockito.whenever
import com.android.systemui.util.settings.FakeSettings
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.runTest
@@ -104,7 +103,7 @@ class CustomizationProviderTest : SysuiTestCase() {
whenever(backgroundHandler.looper).thenReturn(TestableLooper.get(this).looper)
underTest = CustomizationProvider()
val testDispatcher = StandardTestDispatcher()
val testDispatcher = UnconfinedTestDispatcher()
testScope = TestScope(testDispatcher)
val localUserSelectionManager =
KeyguardQuickAffordanceLocalUserSelectionManager(