Loading packages/SystemUI/pods/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ java_defaults { warning_checks: ["MissingApacheLicenseDetector"], }, kotlincflags: [ "-Xexplicit-api=warning", "-Xexplicit-api=strict", "-Xjvm-default=all", ], defaults_visibility: [":__subpackages__"], Loading packages/SystemUI/pods/com/android/systemui/retail/RetailModeModule.kt +7 −3 Original line number Diff line number Diff line Loading @@ -24,11 +24,15 @@ import dagger.Binds import dagger.Module @Module abstract class RetailModeModule { public abstract class RetailModeModule { @Binds abstract fun bindsRetailModeRepository(impl: RetailModeSettingsRepository): RetailModeRepository public abstract fun bindsRetailModeRepository( impl: RetailModeSettingsRepository ): RetailModeRepository @Binds abstract fun bindsRetailModeInteractor(impl: RetailModeInteractorImpl): RetailModeInteractor public abstract fun bindsRetailModeInteractor( impl: RetailModeInteractorImpl ): RetailModeInteractor } packages/SystemUI/pods/com/android/systemui/retail/data/repository/RetailModeRepository.kt +3 −3 Original line number Diff line number Diff line Loading @@ -19,11 +19,11 @@ package com.android.systemui.retail.data.repository import kotlinx.coroutines.flow.StateFlow /** Repository to track if the device is in Retail mode */ interface RetailModeRepository { public interface RetailModeRepository { /** Flow of whether the device is currently in retail mode. */ val retailMode: StateFlow<Boolean> public val retailMode: StateFlow<Boolean> /** Last value of whether the device is in retail mode. */ val inRetailMode: Boolean public val inRetailMode: Boolean get() = retailMode.value } packages/SystemUI/pods/com/android/systemui/retail/data/repository/impl/RetailModeSettingsRepository.kt +4 −4 Original line number Diff line number Diff line Loading @@ -38,17 +38,17 @@ import kotlinx.coroutines.flow.stateIn /** * Tracks [Settings.Global.DEVICE_DEMO_MODE]. * * @see UserManager.isDeviceInDemoMode * @see android.os.UserManager.isDeviceInDemoMode */ @SysUISingleton class RetailModeSettingsRepository public class RetailModeSettingsRepository @Inject constructor( globalSettings: GlobalSettings, @Background backgroundDispatcher: CoroutineDispatcher, @Application scope: CoroutineScope, ) : RetailModeRepository { override val retailMode = override val retailMode: StateFlow<Boolean> = conflatedCallbackFlow { val observer = object : ContentObserver(null) { Loading @@ -66,7 +66,7 @@ constructor( .flowOn(backgroundDispatcher) .stateIn(scope, SharingStarted.Eagerly, false) companion object { public companion object { private const val RETAIL_MODE_SETTING = Settings.Global.DEVICE_DEMO_MODE } } packages/SystemUI/pods/com/android/systemui/retail/domain/interactor/RetailModeInteractor.kt +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.systemui.retail.domain.interactor /** Interactor to determine if the device is currently in retail mode */ interface RetailModeInteractor { public interface RetailModeInteractor { /** Whether the device is currently in retail mode */ val isInRetailMode: Boolean public val isInRetailMode: Boolean } Loading
packages/SystemUI/pods/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ java_defaults { warning_checks: ["MissingApacheLicenseDetector"], }, kotlincflags: [ "-Xexplicit-api=warning", "-Xexplicit-api=strict", "-Xjvm-default=all", ], defaults_visibility: [":__subpackages__"], Loading
packages/SystemUI/pods/com/android/systemui/retail/RetailModeModule.kt +7 −3 Original line number Diff line number Diff line Loading @@ -24,11 +24,15 @@ import dagger.Binds import dagger.Module @Module abstract class RetailModeModule { public abstract class RetailModeModule { @Binds abstract fun bindsRetailModeRepository(impl: RetailModeSettingsRepository): RetailModeRepository public abstract fun bindsRetailModeRepository( impl: RetailModeSettingsRepository ): RetailModeRepository @Binds abstract fun bindsRetailModeInteractor(impl: RetailModeInteractorImpl): RetailModeInteractor public abstract fun bindsRetailModeInteractor( impl: RetailModeInteractorImpl ): RetailModeInteractor }
packages/SystemUI/pods/com/android/systemui/retail/data/repository/RetailModeRepository.kt +3 −3 Original line number Diff line number Diff line Loading @@ -19,11 +19,11 @@ package com.android.systemui.retail.data.repository import kotlinx.coroutines.flow.StateFlow /** Repository to track if the device is in Retail mode */ interface RetailModeRepository { public interface RetailModeRepository { /** Flow of whether the device is currently in retail mode. */ val retailMode: StateFlow<Boolean> public val retailMode: StateFlow<Boolean> /** Last value of whether the device is in retail mode. */ val inRetailMode: Boolean public val inRetailMode: Boolean get() = retailMode.value }
packages/SystemUI/pods/com/android/systemui/retail/data/repository/impl/RetailModeSettingsRepository.kt +4 −4 Original line number Diff line number Diff line Loading @@ -38,17 +38,17 @@ import kotlinx.coroutines.flow.stateIn /** * Tracks [Settings.Global.DEVICE_DEMO_MODE]. * * @see UserManager.isDeviceInDemoMode * @see android.os.UserManager.isDeviceInDemoMode */ @SysUISingleton class RetailModeSettingsRepository public class RetailModeSettingsRepository @Inject constructor( globalSettings: GlobalSettings, @Background backgroundDispatcher: CoroutineDispatcher, @Application scope: CoroutineScope, ) : RetailModeRepository { override val retailMode = override val retailMode: StateFlow<Boolean> = conflatedCallbackFlow { val observer = object : ContentObserver(null) { Loading @@ -66,7 +66,7 @@ constructor( .flowOn(backgroundDispatcher) .stateIn(scope, SharingStarted.Eagerly, false) companion object { public companion object { private const val RETAIL_MODE_SETTING = Settings.Global.DEVICE_DEMO_MODE } }
packages/SystemUI/pods/com/android/systemui/retail/domain/interactor/RetailModeInteractor.kt +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.systemui.retail.domain.interactor /** Interactor to determine if the device is currently in retail mode */ interface RetailModeInteractor { public interface RetailModeInteractor { /** Whether the device is currently in retail mode */ val isInRetailMode: Boolean public val isInRetailMode: Boolean }