Add @InstallIn and @IncludeInDialerRoot to dagger modules in dialer codebase.

Test: presubmit.
PiperOrigin-RevId: 196158524
Change-Id: Iec1e457039e97be0236cd700d397b4095ee3c2c3
diff --git a/java/com/android/dialer/calllog/CallLogModule.java b/java/com/android/dialer/calllog/CallLogModule.java
index 5657270..0e3a3be 100644
--- a/java/com/android/dialer/calllog/CallLogModule.java
+++ b/java/com/android/dialer/calllog/CallLogModule.java
@@ -22,11 +22,14 @@
 import com.android.dialer.calllog.datasources.phonelookup.PhoneLookupDataSource;
 import com.android.dialer.calllog.datasources.systemcalllog.SystemCallLogDataSource;
 import com.android.dialer.calllog.datasources.voicemail.VoicemailDataSource;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.google.common.collect.ImmutableList;
 import dagger.Module;
 import dagger.Provides;
 
 /** Dagger module which satisfies call log dependencies. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module(includes = CallLogDatabaseModule.class)
 public abstract class CallLogModule {
 
diff --git a/java/com/android/dialer/commandline/CommandLineComponent.java b/java/com/android/dialer/commandline/CommandLineComponent.java
index c9abc53..50a1ff2 100644
--- a/java/com/android/dialer/commandline/CommandLineComponent.java
+++ b/java/com/android/dialer/commandline/CommandLineComponent.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import com.android.dialer.function.Supplier;
 import com.android.dialer.inject.HasRootComponent;
+import com.android.dialer.inject.IncludeInDialerRoot;
 import com.google.common.collect.ImmutableMap;
 import dagger.Subcomponent;
 
@@ -34,6 +35,7 @@
   }
 
   /** Used to refer to the root application component. */
+  @IncludeInDialerRoot
   public interface HasComponent {
     CommandLineComponent commandLineComponent();
   }
diff --git a/java/com/android/dialer/commandline/CommandLineModule.java b/java/com/android/dialer/commandline/CommandLineModule.java
index c78de21..c3b58d1 100644
--- a/java/com/android/dialer/commandline/CommandLineModule.java
+++ b/java/com/android/dialer/commandline/CommandLineModule.java
@@ -23,12 +23,15 @@
 import com.android.dialer.commandline.impl.Help;
 import com.android.dialer.commandline.impl.Version;
 import com.android.dialer.function.Supplier;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.google.common.collect.ImmutableMap;
 import dagger.Module;
 import dagger.Provides;
 import javax.inject.Inject;
 
 /** Provides {@link Command} */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class CommandLineModule {
 
diff --git a/java/com/android/dialer/feedback/stub/StubFeedbackModule.java b/java/com/android/dialer/feedback/stub/StubFeedbackModule.java
index 49df09a..19f7e2e 100644
--- a/java/com/android/dialer/feedback/stub/StubFeedbackModule.java
+++ b/java/com/android/dialer/feedback/stub/StubFeedbackModule.java
@@ -20,6 +20,8 @@
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.feedback.FeedbackSender;
 import com.android.dialer.inject.ApplicationContext;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.logging.LoggingBindings;
 import com.android.dialer.logging.LoggingBindingsFactory;
 import com.android.dialer.logging.LoggingBindingsStub;
@@ -28,6 +30,7 @@
 import dagger.Provides;
 
 /** Module which bind {@link com.android.dialer.feedback.stub.CallFeedbackListenerStub}. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public class StubFeedbackModule {
 
diff --git a/java/com/android/dialer/glidephotomanager/GlidePhotoManagerModule.java b/java/com/android/dialer/glidephotomanager/GlidePhotoManagerModule.java
index 79629d6..d4199f0 100644
--- a/java/com/android/dialer/glidephotomanager/GlidePhotoManagerModule.java
+++ b/java/com/android/dialer/glidephotomanager/GlidePhotoManagerModule.java
@@ -17,11 +17,14 @@
 package com.android.dialer.glidephotomanager;
 
 import com.android.dialer.glidephotomanager.impl.GlidePhotoManagerImpl;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import dagger.Binds;
 import dagger.Module;
 import javax.inject.Singleton;
 
 /** Module for {@link GlidePhotoManagerComponent} */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class GlidePhotoManagerModule {
   @Binds
diff --git a/java/com/android/dialer/metrics/StubMetricsModule.java b/java/com/android/dialer/metrics/StubMetricsModule.java
index a2d9ebf..46b2b4d 100644
--- a/java/com/android/dialer/metrics/StubMetricsModule.java
+++ b/java/com/android/dialer/metrics/StubMetricsModule.java
@@ -16,10 +16,13 @@
 
 package com.android.dialer.metrics;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import dagger.Binds;
 import dagger.Module;
 
 /** Binds stub {@link Metrics}. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public interface StubMetricsModule {
 
diff --git a/java/com/android/dialer/phonelookup/PhoneLookupComponent.java b/java/com/android/dialer/phonelookup/PhoneLookupComponent.java
index 832587c..70743c8 100644
--- a/java/com/android/dialer/phonelookup/PhoneLookupComponent.java
+++ b/java/com/android/dialer/phonelookup/PhoneLookupComponent.java
@@ -17,6 +17,7 @@
 
 import android.content.Context;
 import com.android.dialer.inject.HasRootComponent;
+import com.android.dialer.inject.IncludeInDialerRoot;
 import com.android.dialer.phonelookup.composite.CompositePhoneLookup;
 import dagger.Subcomponent;
 
@@ -32,6 +33,7 @@
   }
 
   /** Used to refer to the root application component. */
+  @IncludeInDialerRoot
   public interface HasComponent {
     PhoneLookupComponent phoneLookupComponent();
   }
diff --git a/java/com/android/dialer/phonelookup/PhoneLookupModule.java b/java/com/android/dialer/phonelookup/PhoneLookupModule.java
index 16aa8e5..6d5ffd2 100644
--- a/java/com/android/dialer/phonelookup/PhoneLookupModule.java
+++ b/java/com/android/dialer/phonelookup/PhoneLookupModule.java
@@ -16,6 +16,8 @@
 
 package com.android.dialer.phonelookup;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.phonelookup.blockednumber.SystemBlockedNumberPhoneLookup;
 import com.android.dialer.phonelookup.cequint.CequintPhoneLookup;
 import com.android.dialer.phonelookup.cnap.CnapPhoneLookup;
@@ -28,6 +30,7 @@
 import dagger.Provides;
 
 /** Dagger module which binds the PhoneLookup implementation. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class PhoneLookupModule {
 
diff --git a/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilModule.java b/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilModule.java
index 3878ac5..db4f7fa 100644
--- a/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilModule.java
+++ b/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilModule.java
@@ -16,12 +16,15 @@
 
 package com.android.dialer.phonenumbergeoutil.impl;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.phonenumbergeoutil.PhoneNumberGeoUtil;
 import dagger.Binds;
 import dagger.Module;
 import javax.inject.Singleton;
 
 /** Module which binds {@link PhoneNumberGeoUtilImpl}. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class PhoneNumberGeoUtilModule {
 
diff --git a/java/com/android/dialer/precall/impl/PreCallModule.java b/java/com/android/dialer/precall/impl/PreCallModule.java
index 455453e..fa78cba 100644
--- a/java/com/android/dialer/precall/impl/PreCallModule.java
+++ b/java/com/android/dialer/precall/impl/PreCallModule.java
@@ -16,6 +16,8 @@
 
 package com.android.dialer.precall.impl;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.precall.PreCall;
 import com.android.dialer.precall.PreCallAction;
 import com.google.common.collect.ImmutableList;
@@ -25,6 +27,7 @@
 import javax.inject.Singleton;
 
 /** Dagger module for {@link PreCall}. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class PreCallModule {
 
diff --git a/java/com/android/dialer/simulator/impl/SimulatorModule.java b/java/com/android/dialer/simulator/impl/SimulatorModule.java
index 2bc72c9..af554b6 100644
--- a/java/com/android/dialer/simulator/impl/SimulatorModule.java
+++ b/java/com/android/dialer/simulator/impl/SimulatorModule.java
@@ -16,6 +16,8 @@
 
 package com.android.dialer.simulator.impl;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.simulator.Simulator;
 import com.android.dialer.simulator.SimulatorConnectionsBank;
 import dagger.Binds;
@@ -23,6 +25,7 @@
 import javax.inject.Singleton;
 
 /** This module provides an instance of the simulator. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class SimulatorModule {
   @Binds
diff --git a/java/com/android/dialer/simulator/stub/StubSimulatorEnrichedCallModule.java b/java/com/android/dialer/simulator/stub/StubSimulatorEnrichedCallModule.java
index 36314e7..6a002f0 100644
--- a/java/com/android/dialer/simulator/stub/StubSimulatorEnrichedCallModule.java
+++ b/java/com/android/dialer/simulator/stub/StubSimulatorEnrichedCallModule.java
@@ -16,12 +16,15 @@
 
 package com.android.dialer.simulator.stub;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.simulator.SimulatorEnrichedCall;
 import dagger.Binds;
 import dagger.Module;
 import javax.inject.Singleton;
 
 /** Provides a stub instance of SimulatorEnrichedCall. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class StubSimulatorEnrichedCallModule {
   @Binds
diff --git a/java/com/android/dialer/strictmode/impl/SystemStrictModeModule.java b/java/com/android/dialer/strictmode/impl/SystemStrictModeModule.java
index 6ece874..ac6416c 100644
--- a/java/com/android/dialer/strictmode/impl/SystemStrictModeModule.java
+++ b/java/com/android/dialer/strictmode/impl/SystemStrictModeModule.java
@@ -16,12 +16,15 @@
 
 package com.android.dialer.strictmode.impl;
 
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.dialer.strictmode.DialerStrictMode;
 import dagger.Binds;
 import dagger.Module;
 import javax.inject.Singleton;
 
 /** Module which binds {@link SystemDialerStrictMode}. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class SystemStrictModeModule {
 
diff --git a/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java b/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java
index 2046069..c60663b 100644
--- a/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java
+++ b/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java
@@ -20,12 +20,15 @@
 import android.support.annotation.NonNull;
 import android.support.v4.app.Fragment;
 import com.android.dialer.common.Assert;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.incallui.calllocation.CallLocation;
 import dagger.Binds;
 import dagger.Module;
 import javax.inject.Inject;
 
 /** This module provides an instance of call location. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class StubCallLocationModule {
 
diff --git a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java
index 960692b..d5f6443 100644
--- a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java
+++ b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java
@@ -17,12 +17,15 @@
 package com.android.incallui.speakeasy;
 
 import android.support.v4.app.Fragment;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.google.common.base.Optional;
 import dagger.Binds;
 import dagger.Module;
 import dagger.Provides;
 
 /** Module which binds {@link SpeakEasyCallManagerStub}. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public abstract class StubSpeakEasyModule {
 
diff --git a/java/com/android/voicemail/impl/VoicemailModule.java b/java/com/android/voicemail/impl/VoicemailModule.java
index e689e47..c4c72d3 100644
--- a/java/com/android/voicemail/impl/VoicemailModule.java
+++ b/java/com/android/voicemail/impl/VoicemailModule.java
@@ -19,6 +19,8 @@
 import android.content.Context;
 import android.support.v4.os.BuildCompat;
 import com.android.dialer.inject.ApplicationContext;
+import com.android.dialer.inject.DialerVariant;
+import com.android.dialer.inject.InstallIn;
 import com.android.voicemail.VoicemailClient;
 import com.android.voicemail.VoicemailPermissionHelper;
 import com.android.voicemail.stub.StubVoicemailClient;
@@ -27,6 +29,7 @@
 import javax.inject.Singleton;
 
 /** This module provides an instance of the voicemail client. */
+@InstallIn(variants = {DialerVariant.DIALER_TEST})
 @Module
 public final class VoicemailModule {