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

Commit b04104d9 authored by Coco Duan's avatar Coco Duan Committed by Android (Google) Code Review
Browse files

Merge "Update isCommunalEnabled() for whether feature flags are enabled" into main

parents 8545642d bf1236fc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@ interface CommunalRepository {
class CommunalRepositoryImpl
@Inject
constructor(
    featureFlags: FeatureFlagsClassic,
    private val featureFlags: FeatureFlagsClassic,
) : CommunalRepository {
    override val isCommunalEnabled = featureFlags.isEnabled(Flags.COMMUNAL_SERVICE_ENABLED)
    override val isCommunalEnabled: Boolean
        get() =
            featureFlags.isEnabled(Flags.COMMUNAL_SERVICE_ENABLED) &&
                featureFlags.isEnabled(Flags.COMMUNAL_HUB)
}
+4 −2
Original line number Diff line number Diff line
@@ -28,11 +28,13 @@ import kotlinx.coroutines.flow.Flow
class CommunalInteractor
@Inject
constructor(
    communalRepository: CommunalRepository,
    private val communalRepository: CommunalRepository,
    widgetRepository: CommunalWidgetRepository,
) {

    /** Whether communal features are enabled. */
    val isCommunalEnabled: Boolean = communalRepository.isCommunalEnabled
    val isCommunalEnabled: Boolean
        get() = communalRepository.isCommunalEnabled

    /** A flow of info about the widget to be displayed, or null if widget is unavailable. */
    val appWidgetInfo: Flow<CommunalAppWidgetInfo?> = widgetRepository.stopwatchAppWidgetInfo