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

Commit b2584868 authored by Peter Kalauskas's avatar Peter Kalauskas Committed by Android (Google) Code Review
Browse files

Merge "Enable strict API mode for sysui pods" into main

parents 9889c37a a4955762
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ java_defaults {
        warning_checks: ["MissingApacheLicenseDetector"],
    },
    kotlincflags: [
        "-Xexplicit-api=warning",
        "-Xexplicit-api=strict",
        "-Xjvm-default=all",
    ],
    defaults_visibility: [":__subpackages__"],
+7 −3
Original line number Diff line number Diff line
@@ -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
}
+3 −3
Original line number Diff line number Diff line
@@ -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
}
+4 −4
Original line number Diff line number Diff line
@@ -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) {
@@ -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
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -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