From 2f4a0075e9f546514359eda60a24ac9cd49ea80a Mon Sep 17 00:00:00 2001 From: weijiaxu Date: Wed, 9 May 2018 16:28:04 -0700 Subject: Add some annotations that won't influence aosp. Test: blaze test. PiperOrigin-RevId: 196047666 Change-Id: Ia54e342113f9dbc9fe884b9a85d0f4db33f94cf5 --- java/com/android/dialer/common/concurrent/DialerExecutorComponent.java | 2 ++ java/com/android/dialer/configprovider/ConfigProviderComponent.java | 2 ++ .../android/dialer/configprovider/SharedPrefConfigProviderModule.java | 3 +++ java/com/android/dialer/duo/DuoComponent.java | 2 ++ java/com/android/dialer/duo/stub/StubDuoModule.java | 3 +++ java/com/android/dialer/enrichedcall/EnrichedCallComponent.java | 2 ++ java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java | 3 +++ java/com/android/dialer/metrics/MetricsComponent.java | 2 ++ java/com/android/dialer/spam/SpamComponent.java | 2 ++ java/com/android/dialer/spam/StubSpamModule.java | 3 +++ java/com/android/dialer/storage/StorageComponent.java | 2 ++ java/com/android/dialer/storage/StorageModule.java | 3 +++ java/com/android/voicemail/VoicemailComponent.java | 2 ++ java/com/android/voicemail/stub/StubVoicemailModule.java | 3 +++ 14 files changed, 34 insertions(+) diff --git a/java/com/android/dialer/common/concurrent/DialerExecutorComponent.java b/java/com/android/dialer/common/concurrent/DialerExecutorComponent.java index f4552b203..6a2217416 100644 --- a/java/com/android/dialer/common/concurrent/DialerExecutorComponent.java +++ b/java/com/android/dialer/common/concurrent/DialerExecutorComponent.java @@ -23,6 +23,7 @@ import com.android.dialer.common.concurrent.Annotations.LightweightExecutor; import com.android.dialer.common.concurrent.Annotations.NonUiParallel; import com.android.dialer.common.concurrent.Annotations.Ui; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import com.google.common.util.concurrent.ListeningExecutorService; import dagger.Subcomponent; import java.util.concurrent.ExecutorService; @@ -66,6 +67,7 @@ public abstract class DialerExecutorComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { DialerExecutorComponent dialerExecutorComponent(); } diff --git a/java/com/android/dialer/configprovider/ConfigProviderComponent.java b/java/com/android/dialer/configprovider/ConfigProviderComponent.java index 10d52e749..e974e30bf 100644 --- a/java/com/android/dialer/configprovider/ConfigProviderComponent.java +++ b/java/com/android/dialer/configprovider/ConfigProviderComponent.java @@ -19,6 +19,7 @@ package com.android.dialer.configprovider; import android.content.Context; import android.support.annotation.NonNull; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** Dagger component to provide a {@link ConfigProvider}. */ @@ -36,6 +37,7 @@ public abstract class ConfigProviderComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { ConfigProviderComponent configProviderComponent(); } diff --git a/java/com/android/dialer/configprovider/SharedPrefConfigProviderModule.java b/java/com/android/dialer/configprovider/SharedPrefConfigProviderModule.java index 4af8bfe17..81bed19bd 100644 --- a/java/com/android/dialer/configprovider/SharedPrefConfigProviderModule.java +++ b/java/com/android/dialer/configprovider/SharedPrefConfigProviderModule.java @@ -16,12 +16,15 @@ package com.android.dialer.configprovider; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import com.android.dialer.storage.StorageModule; import dagger.Binds; import dagger.Module; import javax.inject.Singleton; /** Dagger module providing {@link ConfigProvider} based on shared preferences. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module(includes = StorageModule.class) public abstract class SharedPrefConfigProviderModule { diff --git a/java/com/android/dialer/duo/DuoComponent.java b/java/com/android/dialer/duo/DuoComponent.java index 031ee9e53..307832aaf 100644 --- a/java/com/android/dialer/duo/DuoComponent.java +++ b/java/com/android/dialer/duo/DuoComponent.java @@ -19,6 +19,7 @@ package com.android.dialer.duo; import android.content.Context; import android.support.annotation.NonNull; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** @@ -35,6 +36,7 @@ public abstract class DuoComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { DuoComponent duoComponent(); } diff --git a/java/com/android/dialer/duo/stub/StubDuoModule.java b/java/com/android/dialer/duo/stub/StubDuoModule.java index 604406a94..8966602bb 100644 --- a/java/com/android/dialer/duo/stub/StubDuoModule.java +++ b/java/com/android/dialer/duo/stub/StubDuoModule.java @@ -17,10 +17,13 @@ package com.android.dialer.duo.stub; import com.android.dialer.duo.Duo; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import dagger.Binds; import dagger.Module; import javax.inject.Singleton; +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public abstract class StubDuoModule { diff --git a/java/com/android/dialer/enrichedcall/EnrichedCallComponent.java b/java/com/android/dialer/enrichedcall/EnrichedCallComponent.java index 2ed2e94dc..46afd848d 100644 --- a/java/com/android/dialer/enrichedcall/EnrichedCallComponent.java +++ b/java/com/android/dialer/enrichedcall/EnrichedCallComponent.java @@ -19,6 +19,7 @@ package com.android.dialer.enrichedcall; import android.content.Context; import android.support.annotation.NonNull; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** Subcomponent that can be used to access the enriched call implementation. */ @@ -37,6 +38,7 @@ public abstract class EnrichedCallComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { EnrichedCallComponent enrichedCallComponent(); } diff --git a/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java b/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java index 93e15790a..5a0618d3c 100644 --- a/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java +++ b/java/com/android/dialer/enrichedcall/stub/StubEnrichedCallModule.java @@ -18,12 +18,15 @@ package com.android.dialer.enrichedcall.stub; import com.android.dialer.enrichedcall.EnrichedCallManager; import com.android.dialer.enrichedcall.RcsVideoShareFactory; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import com.android.incallui.videotech.empty.EmptyVideoTech; import dagger.Module; import dagger.Provides; import javax.inject.Singleton; /** Module which binds {@link EnrichedCallManagerStub}. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public class StubEnrichedCallModule { diff --git a/java/com/android/dialer/metrics/MetricsComponent.java b/java/com/android/dialer/metrics/MetricsComponent.java index a3570db10..c0d957ba4 100644 --- a/java/com/android/dialer/metrics/MetricsComponent.java +++ b/java/com/android/dialer/metrics/MetricsComponent.java @@ -18,6 +18,7 @@ package com.android.dialer.metrics; import android.content.Context; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** Component for metrics. */ @@ -37,6 +38,7 @@ public abstract class MetricsComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { MetricsComponent metricsComponent(); } diff --git a/java/com/android/dialer/spam/SpamComponent.java b/java/com/android/dialer/spam/SpamComponent.java index 2b70b6fe1..a0ffcce1f 100644 --- a/java/com/android/dialer/spam/SpamComponent.java +++ b/java/com/android/dialer/spam/SpamComponent.java @@ -18,6 +18,7 @@ package com.android.dialer.spam; import android.content.Context; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** Dagger component to get Spam. */ @@ -35,6 +36,7 @@ public abstract class SpamComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { SpamComponent spamComponent(); } diff --git a/java/com/android/dialer/spam/StubSpamModule.java b/java/com/android/dialer/spam/StubSpamModule.java index 5540408ad..b60967475 100644 --- a/java/com/android/dialer/spam/StubSpamModule.java +++ b/java/com/android/dialer/spam/StubSpamModule.java @@ -16,10 +16,13 @@ package com.android.dialer.spam; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import dagger.Binds; import dagger.Module; /** Module which binds {@link SpamStub}. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public abstract class StubSpamModule { diff --git a/java/com/android/dialer/storage/StorageComponent.java b/java/com/android/dialer/storage/StorageComponent.java index cb5c4a879..4754cc6db 100644 --- a/java/com/android/dialer/storage/StorageComponent.java +++ b/java/com/android/dialer/storage/StorageComponent.java @@ -19,6 +19,7 @@ package com.android.dialer.storage; import android.content.Context; import android.content.SharedPreferences; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** Dagger component for storage. */ @@ -42,6 +43,7 @@ public abstract class StorageComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { StorageComponent storageComponent(); } diff --git a/java/com/android/dialer/storage/StorageModule.java b/java/com/android/dialer/storage/StorageModule.java index e1c5b4b08..370998cdb 100644 --- a/java/com/android/dialer/storage/StorageModule.java +++ b/java/com/android/dialer/storage/StorageModule.java @@ -20,11 +20,14 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.v4.content.ContextCompat; import com.android.dialer.inject.ApplicationContext; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import dagger.Module; import dagger.Provides; import javax.inject.Singleton; /** Module for the storage component. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public class StorageModule { diff --git a/java/com/android/voicemail/VoicemailComponent.java b/java/com/android/voicemail/VoicemailComponent.java index bed75f0ef..0e09627b3 100644 --- a/java/com/android/voicemail/VoicemailComponent.java +++ b/java/com/android/voicemail/VoicemailComponent.java @@ -18,6 +18,7 @@ package com.android.voicemail; import android.content.Context; import com.android.dialer.inject.HasRootComponent; +import com.android.dialer.inject.IncludeInDialerRoot; import dagger.Subcomponent; /** Subcomponent that can be used to access the voicemail implementation. */ @@ -32,6 +33,7 @@ public abstract class VoicemailComponent { } /** Used to refer to the root application component. */ + @IncludeInDialerRoot public interface HasComponent { VoicemailComponent voicemailComponent(); } diff --git a/java/com/android/voicemail/stub/StubVoicemailModule.java b/java/com/android/voicemail/stub/StubVoicemailModule.java index 6c1552c15..efcb4cffa 100644 --- a/java/com/android/voicemail/stub/StubVoicemailModule.java +++ b/java/com/android/voicemail/stub/StubVoicemailModule.java @@ -16,6 +16,8 @@ package com.android.voicemail.stub; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import com.android.voicemail.VoicemailClient; import dagger.Binds; import dagger.Module; @@ -24,6 +26,7 @@ import javax.inject.Singleton; /** * A no-op version of the voicemail module for build targets that don't support the new OTMP client. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public abstract class StubVoicemailModule { -- cgit v1.2.3