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

Commit 7a59eafd authored by Tao Wu's avatar Tao Wu
Browse files

[Growth] Create startable to observe device entry event.

- Create a feature flag
- Setup dagger module
- Create a CoreStartable to register device entry event

Bug: 410857267
Flag: com.android.systemui.enable_desktop_growth
Change-Id: I6b06124f262f4d325ca4211ea7dbc772ef7d8600
parent a302a178
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1986,3 +1986,10 @@ flag {
     purpose: PURPOSE_BUGFIX
   }
}

flag {
   name: "enable_desktop_growth"
   namespace: "systemui"
   description: "Enables the growth framework for desktop."
   bug: "383601076"
}
+2 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import com.android.systemui.dreams.dagger.DreamModule;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.FlagDependenciesModule;
import com.android.systemui.flags.FlagsModule;
import com.android.systemui.growth.dagger.GrowthModule;
import com.android.systemui.haptics.msdl.dagger.MSDLModule;
import com.android.systemui.inputmethod.InputMethodModule;
import com.android.systemui.keyboard.KeyboardModule;
@@ -245,6 +246,7 @@ import javax.inject.Named;
        FooterActionsModule.class,
        KairosCoreStartableModule.class,
        GestureModule.class,
        GrowthModule.class,
        InputMethodModule.class,
        KeyEventRepositoryModule.class,
        KeyboardModule.class,
+9 −0
Original line number Diff line number Diff line
# Bug component: 1419696

# System UI team
nijamkin@google.com

# Desktop growth team
llin@google.com
thv@google.com
wutao@google.com
 No newline at end of file
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.growth.dagger

import com.android.systemui.CoreStartable
import com.android.systemui.growth.domain.startable.GrowthCoreStartable
import dagger.Binds
import dagger.Module
import dagger.multibindings.ClassKey
import dagger.multibindings.IntoMap

/** Module for dagger injections related to the Android Desktop Growth. */
@Module
interface GrowthModule {
    @Binds
    @IntoMap
    @ClassKey(GrowthCoreStartable::class)
    fun provideGrowthCoreStartable(startable: GrowthCoreStartable): CoreStartable
}
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.growth.domain.interactor

import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
import com.android.systemui.lifecycle.ExclusiveActivatable
import com.android.systemui.dagger.SysUISingleton
import javax.inject.Inject
import dagger.Lazy

/** Interactor to communicate with the growth app. */
@SysUISingleton
class GrowthInteractor
@Inject
constructor(private val deviceEntryInteractor: Lazy<DeviceEntryInteractor>) :
    ExclusiveActivatable() {

    override suspend fun onActivated(): Nothing {
        deviceEntryInteractor.get().isDeviceEnteredDirectly.collect {
            if (it) {
                // TODO: b/410857267 - Notify the growth app.
            }
        }
    }
}
Loading