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

Commit a4955762 authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Enable strict API mode for sysui pods

Test: m, flashall
Bug: 307607958
Flag: EXEMPT build change is a no-op
Change-Id: I5d3f037893f3f66a39464e1730c173bc2d4bb321
parent 66191f6e
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