summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mark Renouf <mrenouf@google.com> 2024-03-12 13:05:41 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-03-12 13:05:41 +0000
commit3cd94450488a7d098de2851b72e62f235db3d573 (patch)
tree4b42f41e002d51d2dce31a5122aed9f4eea9e941
parent1e5660261e618c06fd1ec0b51fdaf34ae8d1f5b0 (diff)
parent400a1a46b75af5093a9ec1803a33dd1971eadaa7 (diff)
Merge "Backport fixes and enable new Dagger Validations" into main
-rw-r--r--packages/SystemUI/Android.bp2
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/unfold/SysUIUnfoldModule.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt11
4 files changed, 16 insertions, 12 deletions
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index 62b8cb73af48..dd7f8d5baf50 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -214,6 +214,8 @@ android_library {
javacflags: [
"-Adagger.fastInit=enabled",
+ "-Adagger.explicitBindingConflictsWithInject=ERROR",
+ "-Adagger.strictMultibindingValidation=enabled",
"-Aroom.schemaLocation=frameworks/base/packages/SystemUI/schemas",
],
kotlincflags: ["-Xjvm-default=all"],
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
index 236c5b8ed2d7..cc5be8d0b47e 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
@@ -59,6 +59,7 @@ import com.android.systemui.statusbar.policy.IndividualSensorPrivacyController;
import com.android.systemui.statusbar.policy.IndividualSensorPrivacyControllerImpl;
import com.android.systemui.statusbar.policy.SensorPrivacyController;
import com.android.systemui.statusbar.policy.SensorPrivacyControllerImpl;
+import com.android.systemui.unfold.UnfoldTransitionModule;
import com.android.systemui.volume.dagger.VolumeModule;
import com.android.systemui.wallpapers.dagger.WallpaperModule;
@@ -99,6 +100,7 @@ import javax.inject.Named;
RotationLockModule.class,
SceneContainerFrameworkModule.class,
StartCentralSurfacesModule.class,
+ UnfoldTransitionModule.Startables.class,
VolumeModule.class,
WallpaperModule.class,
KeyboardShortcutsModule.class
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/SysUIUnfoldModule.kt b/packages/SystemUI/src/com/android/systemui/unfold/SysUIUnfoldModule.kt
index 10fc83c8b82c..8cbe9c5e56cf 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/SysUIUnfoldModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/SysUIUnfoldModule.kt
@@ -26,7 +26,6 @@ import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider
import com.android.systemui.unfold.util.UnfoldKeyguardVisibilityManager
import com.android.systemui.util.kotlin.getOrNull
import dagger.BindsInstance
-import dagger.Lazy
import dagger.Module
import dagger.Provides
import dagger.Subcomponent
@@ -34,7 +33,9 @@ import java.util.Optional
import javax.inject.Named
import javax.inject.Scope
-@Scope @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class SysUIUnfoldScope
+@Scope @MustBeDocumented
+@Retention(AnnotationRetention.RUNTIME)
+annotation class SysUIUnfoldScope
/**
* Creates an injectable [SysUIUnfoldComponent] that provides objects that have been scoped with
@@ -49,7 +50,6 @@ import javax.inject.Scope
*/
@Module(subcomponents = [SysUIUnfoldComponent::class])
class SysUIUnfoldModule {
-
@Provides
@SysUISingleton
fun provideSysUIUnfoldComponent(
@@ -57,8 +57,7 @@ class SysUIUnfoldModule {
rotationProvider: Optional<NaturalRotationUnfoldProgressProvider>,
@Named(UNFOLD_STATUS_BAR) scopedProvider: Optional<ScopedUnfoldTransitionProgressProvider>,
@UnfoldBg bgProvider: Optional<UnfoldTransitionProgressProvider>,
- unfoldLatencyTracker: Lazy<UnfoldLatencyTracker>,
- factory: SysUIUnfoldComponent.Factory
+ factory: SysUIUnfoldComponent.Factory,
): Optional<SysUIUnfoldComponent> {
val p1 = provider.getOrNull()
val p2 = rotationProvider.getOrNull()
@@ -67,7 +66,7 @@ class SysUIUnfoldModule {
return if (p1 == null || p2 == null || p3 == null || p4 == null) {
Optional.empty()
} else {
- Optional.of(factory.create(p1, p2, p3, p4, unfoldLatencyTracker.get()))
+ Optional.of(factory.create(p1, p2, p3, p4))
}
}
}
@@ -75,7 +74,6 @@ class SysUIUnfoldModule {
@SysUIUnfoldScope
@Subcomponent
interface SysUIUnfoldComponent {
-
@Subcomponent.Factory
interface Factory {
fun create(
@@ -83,7 +81,6 @@ interface SysUIUnfoldComponent {
@BindsInstance p2: NaturalRotationUnfoldProgressProvider,
@BindsInstance p3: ScopedUnfoldTransitionProgressProvider,
@BindsInstance @UnfoldBg p4: UnfoldTransitionProgressProvider,
- @BindsInstance p5: UnfoldLatencyTracker,
): SysUIUnfoldComponent
}
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt
index 50515daedc51..3c55ce912072 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt
@@ -170,14 +170,17 @@ class UnfoldTransitionModule {
@Module
interface Bindings {
+ @Binds fun bindRepository(impl: UnfoldTransitionRepositoryImpl): UnfoldTransitionRepository
+
+ @Binds fun bindInteractor(impl: UnfoldTransitionInteractorImpl): UnfoldTransitionInteractor
+ }
+
+ @Module
+ interface Startables {
@Binds
@IntoMap
@ClassKey(UnfoldTraceLogger::class)
fun bindUnfoldTraceLogger(impl: UnfoldTraceLogger): CoreStartable
-
- @Binds fun bindRepository(impl: UnfoldTransitionRepositoryImpl): UnfoldTransitionRepository
-
- @Binds fun bindInteractor(impl: UnfoldTransitionInteractorImpl): UnfoldTransitionInteractor
}
}