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

Commit 5f141f2a authored by Dave Mankoff's avatar Dave Mankoff Committed by Alejandro Nijamkin
Browse files

Split ReferenceSysUIComponent off of SysUIComponent.

ReferenceSysUIComponent is used for the basic AOSP build,
and gives us a place to add pieces for phones that shouldn't
go into other variants, like TVs, Cars, etc.

Bug: 254857637
Test: manuall built and run
Change-Id: I5085ed6d94924f776b16cccb8cb7b10a8a9e0993
parent 28ba402d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.systemui

import android.content.Context
import com.android.systemui.dagger.DaggerGlobalRootComponent
import com.android.systemui.dagger.DaggerReferenceGlobalRootComponent
import com.android.systemui.dagger.GlobalRootComponent

/**
@@ -25,6 +25,6 @@ import com.android.systemui.dagger.GlobalRootComponent
 */
class SystemUIInitializerImpl(context: Context) : SystemUIInitializer(context) {
    override fun getGlobalRootComponentBuilder(): GlobalRootComponent.Builder {
        return DaggerGlobalRootComponent.builder()
        return DaggerReferenceGlobalRootComponent.builder()
    }
}
+4 −2
Original line number Diff line number Diff line
@@ -27,7 +27,9 @@ import dagger.BindsInstance;
import dagger.Component;

/**
 * Root component for Dagger injection.
 * Base root component for Dagger injection.
 *
 * See {@link ReferenceGlobalRootComponent} for the one actually used by AOSP.
 */
@Singleton
@Component(modules = {GlobalModule.class})
@@ -51,7 +53,7 @@ public interface GlobalRootComponent {
    WMComponent.Builder getWMComponentBuilder();

    /**
     * Builder for a {@link SysUIComponent}, which makes it a subcomponent of this class.
     * Builder for a {@link ReferenceSysUIComponent}, which makes it a subcomponent of this class.
     */
    SysUIComponent.Builder getSysUIComponent();

+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 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.dagger;

import javax.inject.Singleton;

import dagger.Component;

/**
 * Root component for Dagger injection used in AOSP.
 */
@Singleton
@Component(modules = {GlobalModule.class})
public interface ReferenceGlobalRootComponent extends GlobalRootComponent {

    /**
     * Builder for a ReferenceGlobalRootComponent.
     */
    @Component.Builder
    interface Builder extends GlobalRootComponent.Builder {
        ReferenceGlobalRootComponent build();
    }

    /**
     * Builder for a {@link ReferenceSysUIComponent}, which makes it a subcomponent of this class.
     */
    ReferenceSysUIComponent.Builder getSysUIComponent();
}
+45 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 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.dagger;

import com.android.systemui.statusbar.QsFrameTranslateModule;

import dagger.Subcomponent;

/**
 * Dagger Subcomponent for Core SysUI used in AOSP.
 */
@SysUISingleton
@Subcomponent(modules = {
        DefaultComponentBinder.class,
        DependencyProvider.class,
        QsFrameTranslateModule.class,
        SystemUIBinder.class,
        SystemUIModule.class,
        SystemUICoreStartableModule.class,
        ReferenceSystemUIModule.class})
public interface ReferenceSysUIComponent extends SysUIComponent {

    /**
     * Builder for a ReferenceSysUIComponent.
     */
    @SysUISingleton
    @Subcomponent.Builder
    interface Builder extends SysUIComponent.Builder {
        ReferenceSysUIComponent build();
    }
}
+3 −1
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ import dagger.BindsInstance;
import dagger.Subcomponent;

/**
 * Dagger Subcomponent for Core SysUI.
 * An example Dagger Subcomponent for Core SysUI.
 *
 * See {@link ReferenceSysUIComponent} for the one actually used by AOSP.
 */
@SysUISingleton
@Subcomponent(modules = {