Loading packages/SystemUI/customization/src/com/android/systemui/shared/customization/data/content/CustomizationProviderClient.kt +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.withContext Loading Loading @@ -518,6 +519,7 @@ class CustomizationProviderClientImpl( awaitClose { context.contentResolver.unregisterContentObserver(observer) } } .onStart { emit(Unit) } .flowOn(backgroundDispatcher) } private fun String.toIntent( Loading packages/SystemUI/src/com/android/systemui/util/animation/data/repository/AnimationStatusRepository.kt +20 −18 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext import kotlinx.coroutines.flow.flowOn /** Utility class that could give information about if animation are enabled in the system */ interface AnimationStatusRepository { Loading @@ -45,8 +45,9 @@ constructor( * Emits true if animations are enabled in the system, after subscribing it immediately emits * the current state */ override fun areAnimationsEnabled(): Flow<Boolean> = conflatedCallbackFlow { val initialValue = withContext(backgroundDispatcher) { resolver.areAnimationsEnabled() } override fun areAnimationsEnabled(): Flow<Boolean> = conflatedCallbackFlow { val initialValue = resolver.areAnimationsEnabled() trySend(initialValue) val observer = Loading @@ -65,4 +66,5 @@ constructor( awaitClose { resolver.unregisterContentObserver(observer) } } .flowOn(backgroundDispatcher) } Loading
packages/SystemUI/customization/src/com/android/systemui/shared/customization/data/content/CustomizationProviderClient.kt +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.withContext Loading Loading @@ -518,6 +519,7 @@ class CustomizationProviderClientImpl( awaitClose { context.contentResolver.unregisterContentObserver(observer) } } .onStart { emit(Unit) } .flowOn(backgroundDispatcher) } private fun String.toIntent( Loading
packages/SystemUI/src/com/android/systemui/util/animation/data/repository/AnimationStatusRepository.kt +20 −18 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext import kotlinx.coroutines.flow.flowOn /** Utility class that could give information about if animation are enabled in the system */ interface AnimationStatusRepository { Loading @@ -45,8 +45,9 @@ constructor( * Emits true if animations are enabled in the system, after subscribing it immediately emits * the current state */ override fun areAnimationsEnabled(): Flow<Boolean> = conflatedCallbackFlow { val initialValue = withContext(backgroundDispatcher) { resolver.areAnimationsEnabled() } override fun areAnimationsEnabled(): Flow<Boolean> = conflatedCallbackFlow { val initialValue = resolver.areAnimationsEnabled() trySend(initialValue) val observer = Loading @@ -65,4 +66,5 @@ constructor( awaitClose { resolver.unregisterContentObserver(observer) } } .flowOn(backgroundDispatcher) }