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

Commit 1256c0e1 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Fix Duplicate Binding Warning for QSFragmentComponent

The Component only needs the view, so just bind the view directly.
This makes dagger happy, as the Fragment was being bound twice.

Bug: 303693030
Test: built and found no errors or warnings
Change-Id: I974d6b2b30d1f225285dcb047317db2110e2c411
parent 76c63cc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public class QSFragmentLegacy extends LifecycleFragment implements QS {

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        QSFragmentComponent qsFragmentComponent = mQsComponentFactory.create(this);
        QSFragmentComponent qsFragmentComponent = mQsComponentFactory.create(getView());
        mQsImpl = mQsImplProvider.get();
        mQsImpl.onComponentCreated(qsFragmentComponent, savedInstanceState);
    }
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.systemui.qs.dagger;

import android.view.View;

import com.android.systemui.dagger.qualifiers.RootView;
import com.android.systemui.qs.QSFragmentLegacy;

import dagger.BindsInstance;
@@ -31,6 +34,7 @@ public interface QSFragmentComponent extends QSComponent {
    /** Factory for building a {@link QSFragmentComponent}. */
    @Subcomponent.Factory
    interface Factory {
        QSFragmentComponent create(@BindsInstance QSFragmentLegacy qsFragment);
        /** */
        QSFragmentComponent create(@BindsInstance @RootView View view);
    }
}
+2 −19
Original line number Diff line number Diff line
@@ -20,34 +20,17 @@ import static com.android.systemui.util.Utils.useCollapsedMediaInLandscape;
import static com.android.systemui.util.Utils.useQsMediaPlayer;

import android.content.Context;
import android.view.View;

import com.android.systemui.dagger.qualifiers.RootView;
import com.android.systemui.plugins.qs.QS;
import com.android.systemui.qs.QSFragmentLegacy;

import javax.inject.Named;

import dagger.Binds;
import dagger.Module;
import dagger.Provides;

import javax.inject.Named;

/**
 * Dagger Module for {@link QSFragmentComponent}.
 */
@Module(includes = {QSScopeModule.class})
public  interface QSFragmentModule {

    @Provides
    @RootView
    static View provideRootView(QSFragmentLegacy qsFragment) {
        return qsFragment.getView();
    }

    /** */
    @Binds
    QS bindQS(QSFragmentLegacy qsFragment);

    /** */
    @Provides
    @Named(QSScopeModule.QS_USING_MEDIA_PLAYER)