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

Commit 8fee1444 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[SysUI][Floaty] Provide no-op CoreStartable when feature disabled" into main

parents c43f791d 8cb71dff
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -17,17 +17,32 @@
package com.android.systemui.topwindoweffects.dagger

import com.android.systemui.CoreStartable
import com.android.systemui.shared.Flags.enableLppAssistInvocationEffect
import com.android.systemui.topwindoweffects.TopLevelWindowEffects
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.multibindings.ClassKey
import dagger.multibindings.IntoMap

@Module
interface TopLevelWindowEffectsModule {

    @Binds
    @Binds fun bindTopLevelWindowEffectsCoreStartable(impl: TopLevelWindowEffects): CoreStartable

    companion object {

        @Provides
        @IntoMap
        @ClassKey(TopLevelWindowEffects::class)
    fun bindTopLevelWindowEffectsCoreStartable(impl: TopLevelWindowEffects): CoreStartable
        fun provideTopLevelWindowEffectsCoreStartable(impl: TopLevelWindowEffects): CoreStartable {
            return if (enableLppAssistInvocationEffect()) {
                impl
            } else {
                CoreStartable {
                    // empty, no-op
                }
            }
        }
    }
}