summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/binary
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-20 08:50:25 -0700
committerEric Erfanian <erfanian@google.com>2017-03-20 09:03:10 -0700
commit06b6b56e9eaa91ebf757ea641e38a9c885fa40bd (patch)
tree6a0f9f0809cc02004f4be6ef9d20cbced397c3d1 /java/com/android/dialer/binary
parent9a090c89e7a0c43a668bd6e2ac5e5e680f323aed (diff)
Update AOSP Dialer source from internal google3 repository at
cl/150622237 Test: make, treehugger, on device testing. This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150392808 (3/16/2017) to cl/150622237 (3/20/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: Id53e0e580a4ef73760a8afb7bb8c265ee27ad535
Diffstat (limited to 'java/com/android/dialer/binary')
-rw-r--r--java/com/android/dialer/binary/aosp/AospDialerApplication.java7
-rw-r--r--java/com/android/dialer/binary/aosp/AospDialerRootComponent.java11
-rw-r--r--java/com/android/dialer/binary/common/DialerApplication.java26
3 files changed, 42 insertions, 2 deletions
diff --git a/java/com/android/dialer/binary/aosp/AospDialerApplication.java b/java/com/android/dialer/binary/aosp/AospDialerApplication.java
index f657a3987..4ca94e277 100644
--- a/java/com/android/dialer/binary/aosp/AospDialerApplication.java
+++ b/java/com/android/dialer/binary/aosp/AospDialerApplication.java
@@ -26,5 +26,10 @@ import com.android.dialer.inject.ContextModule;
*/
public class AospDialerApplication extends DialerApplication {
-
+ /** Returns a new instance of the root component for the AOSP Dialer. */
+ @Override
+ @NonNull
+ protected Object buildRootComponent() {
+ return DaggerAospDialerRootComponent.builder().contextModule(new ContextModule(this)).build();
+ }
}
diff --git a/java/com/android/dialer/binary/aosp/AospDialerRootComponent.java b/java/com/android/dialer/binary/aosp/AospDialerRootComponent.java
index 8628e90c2..54fedc2be 100644
--- a/java/com/android/dialer/binary/aosp/AospDialerRootComponent.java
+++ b/java/com/android/dialer/binary/aosp/AospDialerRootComponent.java
@@ -27,4 +27,15 @@ import dagger.Component;
import javax.inject.Singleton;
/** Root component for the AOSP Dialer application. */
+@Singleton
+@Component(
+ modules = {
+ ContextModule.class,
+ SimulatorModule.class,
+ StubCallLocationModule.class,
+ StubEnrichedCallModule.class,
+ StubMapsModule.class,
+ VoicemailModule.class
+ }
+)
public interface AospDialerRootComponent extends BaseDialerRootComponent {}
diff --git a/java/com/android/dialer/binary/common/DialerApplication.java b/java/com/android/dialer/binary/common/DialerApplication.java
index c0be4328c..cc7befc90 100644
--- a/java/com/android/dialer/binary/common/DialerApplication.java
+++ b/java/com/android/dialer/binary/common/DialerApplication.java
@@ -22,9 +22,10 @@ import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import com.android.dialer.blocking.BlockedNumbersAutoMigrator;
import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler;
+import com.android.dialer.inject.HasRootComponent;
/** A common application subclass for all Dialer build variants. */
-public abstract class DialerApplication extends Application {
+public abstract class DialerApplication extends Application implements HasRootComponent {
private volatile Object rootComponent;
@@ -40,4 +41,27 @@ public abstract class DialerApplication extends Application {
Trace.endSection();
}
+ /**
+ * Returns a new instance of the root component for the application. Sub classes should define a
+ * root component that extends all the sub components "HasComponent" intefaces. The component
+ * should specify all modules that the application supports and provide stubs for the remainder.
+ */
+ @NonNull
+ protected abstract Object buildRootComponent();
+
+ /** Returns a cached instance of application's root component. */
+ @Override
+ @NonNull
+ public final Object component() {
+ Object result = rootComponent;
+ if (result == null) {
+ synchronized (this) {
+ result = rootComponent;
+ if (result == null) {
+ rootComponent = result = buildRootComponent();
+ }
+ }
+ }
+ return result;
+ }
}