Merge "Move EnhancedEstimates to PowerModule" into tm-dev

This commit is contained in:
Dave Mankoff
2022-05-06 15:18:08 +00:00
committed by Android (Google) Code Review
5 changed files with 30 additions and 14 deletions

View File

@@ -38,7 +38,6 @@ import com.android.systemui.media.dagger.MediaModule;
import com.android.systemui.plugins.qs.QSFactory;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.power.EnhancedEstimates;
import com.android.systemui.power.EnhancedEstimatesImpl;
import com.android.systemui.power.dagger.PowerModule;
import com.android.systemui.qs.dagger.QSModule;
import com.android.systemui.qs.tileimpl.QSFactoryImpl;
@@ -80,8 +79,19 @@ import dagger.Module;
import dagger.Provides;
/**
* A dagger module for injecting default implementations of components of System UI that may be
* overridden by the System UI implementation.
* A dagger module for injecting default implementations of components of System UI.
*
* Variants of SystemUI should make a copy of this, include it in their component, and customize it
* as needed.
*
* This module might alternatively be named `AospSystemUIModule`, `PhoneSystemUIModule`,
* or `BasicSystemUIModule`.
*
* Nothing in the module should be strictly required. Each piece should either be swappable with
* a different implementation or entirely removable.
*
* This is different from {@link SystemUIModule} which should be used for pieces of required
* SystemUI code that variants of SystemUI _must_ include to function correctly.
*/
@Module(includes = {
MediaModule.class,
@@ -90,7 +100,7 @@ import dagger.Provides;
StartCentralSurfacesModule.class,
VolumeModule.class
})
public abstract class SystemUIDefaultModule {
public abstract class ReferenceSystemUIModule {
@SysUISingleton
@Provides
@@ -100,9 +110,6 @@ public abstract class SystemUIDefaultModule {
return null;
}
@Binds
abstract EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
@Binds
abstract NotificationLockscreenUserManager bindNotificationLockscreenUserManager(
NotificationLockscreenUserManagerImpl notificationLockscreenUserManager);
@@ -148,6 +155,7 @@ public abstract class SystemUIDefaultModule {
return spC;
}
/** */
@Binds
@SysUISingleton
public abstract QSFactory bindQSFactory(QSFactoryImpl qsFactoryImpl);

View File

@@ -73,7 +73,7 @@ import dagger.Subcomponent;
SystemUIBinder.class,
SystemUIModule.class,
SystemUICoreStartableModule.class,
SystemUIDefaultModule.class})
ReferenceSystemUIModule.class})
public interface SysUIComponent {
/**

View File

@@ -100,8 +100,14 @@ import dagger.Module;
import dagger.Provides;
/**
* A dagger module for injecting components of System UI that are not overridden by the System UI
* implementation.
* A dagger module for injecting components of System UI that are required by System UI.
*
* If your feature can be excluded, subclassed, or re-implemented by a variant of SystemUI, put
* your Dagger Module in {@link ReferenceSystemUIModule} and/or any variant modules that
* rely on the feature.
*
* Adding an entry in this file means that _all_ variants of SystemUI will receive that code. They
* may not appreciate that.
*/
@Module(includes = {
AppOpsModule.class,

View File

@@ -16,6 +16,8 @@
package com.android.systemui.power.dagger;
import com.android.systemui.power.EnhancedEstimates;
import com.android.systemui.power.EnhancedEstimatesImpl;
import com.android.systemui.power.PowerNotificationWarnings;
import com.android.systemui.power.PowerUI;
@@ -26,6 +28,10 @@ import dagger.Module;
/** Dagger Module for code in the power package. */
@Module
public interface PowerModule {
/** */
@Binds
EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
/** */
@Binds
PowerUI.WarningsUI provideWarningsUi(PowerNotificationWarnings controllerImpl);

View File

@@ -38,7 +38,6 @@ import com.android.systemui.doze.DozeHost;
import com.android.systemui.plugins.qs.QSFactory;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.power.EnhancedEstimates;
import com.android.systemui.power.EnhancedEstimatesImpl;
import com.android.systemui.power.dagger.PowerModule;
import com.android.systemui.qs.dagger.QSModule;
import com.android.systemui.qs.tileimpl.QSFactoryImpl;
@@ -101,9 +100,6 @@ public abstract class TvSystemUIModule {
return null;
}
@Binds
abstract EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
@Binds
abstract NotificationLockscreenUserManager bindNotificationLockscreenUserManager(
NotificationLockscreenUserManagerImpl notificationLockscreenUserManager);