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

Commit b9b6e429 authored by Chris Göllner's avatar Chris Göllner Committed by Josh
Browse files

Organize SysUI display subcomponents/modules the same as the main ones

This includes naming convention and organization of modules and
component inheritance.

PerDisplayCommonModule becomes PerDisplaySystemUIModule. This is the
equivalent to SystemUIModule, and is included in all variants of
SystemUI.

PerDisplayPhoneModule becomes PerDisplayReferenceSystemUIModule. This
is the AOSP module that is the "default" implementation of SystemUI.

Test: Build & Run all SysUI variants
Bug: 417927751
Flag: EXEMPT Dagger changes that can't be flagged
Change-Id: Id2a9017adab9cbdef5cff4ae4f59f9d32689c6f7
parent fda80d6f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import com.android.systemui.battery.BatterySaverModule;
import com.android.systemui.clipboardoverlay.dagger.ClipboardOverlayOverrideModule;
import com.android.systemui.communal.posturing.dagger.NoopPosturingModule;
import com.android.systemui.display.dagger.SystemUIDisplaySubcomponent;
import com.android.systemui.display.dagger.SystemUIPhoneDisplaySubcomponent;
import com.android.systemui.display.dagger.ReferenceSysUIDisplaySubcomponent;
import com.android.systemui.display.data.repository.DisplayPhoneModule;
import com.android.systemui.display.ui.viewmodel.ConnectingDisplayViewModel;
import com.android.systemui.dock.DockManager;
@@ -189,13 +189,13 @@ import javax.inject.Provider;
        ContextualEducationModule.class,
        ActionCornerModule.class,
}, subcomponents = {
        SystemUIPhoneDisplaySubcomponent.class
        ReferenceSysUIDisplaySubcomponent.class
})
public abstract class ReferenceSystemUIModule {

    @Binds
    abstract SystemUIDisplaySubcomponent.Factory systemUIDisplaySubcomponentFactory(
            SystemUIPhoneDisplaySubcomponent.Factory factory);
            ReferenceSysUIDisplaySubcomponent.Factory factory);

    @SysUISingleton
    @Provides
+29 −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.display.dagger

import com.android.systemui.statusbar.phone.dagger.PerDisplayStatusBarReferenceModule
import dagger.Module

/**
 * "Phone" specific module for SysUI classes that should be instantiated once per display.
 *
 * If the classes are common to all SysUI flavors, they should be added to
 * [PerDisplaySystemUIModule] instead.
 */
@Module(includes = [PerDisplayStatusBarReferenceModule::class])
interface PerDisplayReferenceSystemUIModule
+3 −3
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import com.android.systemui.display.data.repository.DisplayStateRepositoryImpl
import com.android.systemui.display.domain.interactor.DisplayStateInteractor
import com.android.systemui.display.domain.interactor.DisplayStateInteractorImpl
import com.android.systemui.plugins.DarkIconDispatcher
import com.android.systemui.statusbar.dagger.StatusBarPerDisplayModule
import com.android.systemui.statusbar.dagger.PerDisplayStatusBarModule
import com.android.systemui.statusbar.phone.DarkIconDispatcherImpl
import com.android.systemui.statusbar.phone.SysuiDarkIconDispatcher
import com.android.systemui.statusbar.pipeline.shared.ui.composable.StatusBarRootFactory
@@ -53,8 +53,8 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope

/** Module providing common dependencies for per-display singletons. */
@Module(includes = [StatusBarPerDisplayModule::class, PerDisplayConfigurationModule::class])
interface PerDisplayCommonModule {
@Module(includes = [PerDisplayStatusBarModule::class, PerDisplayConfigurationModule::class])
interface PerDisplaySystemUIModule {

    @Multibinds
    @DisplayAware
+5 −5
Original line number Diff line number Diff line
@@ -29,14 +29,14 @@ import dagger.Subcomponent
import javax.inject.Provider

/**
 * "Phone" specific subcomponent for SysUI classes that should be instantiated once per display.
 * AOSP subcomponent for SysUI classes that should be instantiated once per display.
 *
 * If the class is not specific to "Phone" SysUI, it should be added to the parent
 * If the class is not specific to AOSP SysUI, it should be added to the parent
 * [SystemUIDisplaySubcomponent] instead.
 */
@PerDisplaySingleton
@Subcomponent(modules = [PerDisplayCommonModule::class, PerDisplayPhoneModule::class])
interface SystemUIPhoneDisplaySubcomponent : SystemUIDisplaySubcomponent {
@Subcomponent(modules = [PerDisplaySystemUIModule::class, PerDisplayReferenceSystemUIModule::class])
interface ReferenceSysUIDisplaySubcomponent : SystemUIDisplaySubcomponent {

    /**
     * A display specific factory that allows to create new instances of [HomeStatusBarComponent],
@@ -66,6 +66,6 @@ interface SystemUIPhoneDisplaySubcomponent : SystemUIDisplaySubcomponent {
    interface Factory : SystemUIDisplaySubcomponent.Factory {
        override fun create(
            @BindsInstance @DisplayId displayId: Int
        ): SystemUIPhoneDisplaySubcomponent
        ): ReferenceSysUIDisplaySubcomponent
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import kotlinx.coroutines.CoroutineScope
 * thread is not feasible as it would cause jank.
 */
@PerDisplaySingleton
@Subcomponent(modules = [PerDisplayCommonModule::class])
@Subcomponent(modules = [PerDisplaySystemUIModule::class])
interface SystemUIDisplaySubcomponent {

    @get:DisplayAware val displayCoroutineScope: CoroutineScope
Loading