Files
Flexera-Launcher/tests/multivalentTests/src/com/android/launcher3/util/TestDispatcherProvider.kt
T
Uwais Ashraf 1348514466 Use custom background dispatcher to stop excess thread creation.
Bug: 381317629
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Performance tests
Change-Id: I0e205cf7f55c90375a5a1e95fbd0f1adf0fc6658
2024-12-05 11:05:27 +00:00

28 lines
1.1 KiB
Kotlin

/*
* Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.launcher3.util
import com.android.launcher3.util.coroutines.DispatcherProvider
import kotlinx.coroutines.CoroutineDispatcher
class TestDispatcherProvider(testDispatcher: CoroutineDispatcher) : DispatcherProvider {
override val default: CoroutineDispatcher = testDispatcher
override val background: CoroutineDispatcher = testDispatcher
override val main: CoroutineDispatcher = testDispatcher
override val unconfined: CoroutineDispatcher = testDispatcher
}