summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/maps/MapsComponent.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-20 20:40:36 +0000
committerEric Erfanian <erfanian@google.com>2017-03-20 20:40:36 +0000
commit30ccc4f3aa6da94f0bb8a01a880a6353b883b263 (patch)
tree2f55365aaf87df9ba7c1fe0be56a7d0988eadf30 /java/com/android/incallui/maps/MapsComponent.java
parent06b6b56e9eaa91ebf757ea641e38a9c885fa40bd (diff)
Revert "Update AOSP Dialer source from internal google3 repository at cl/150622237"
This reverts commit 06b6b56e9eaa91ebf757ea641e38a9c885fa40bd. Change-Id: Ida8c5ee67669524dc63b9adc60a6dd392cb9b9a6
Diffstat (limited to 'java/com/android/incallui/maps/MapsComponent.java')
-rw-r--r--java/com/android/incallui/maps/MapsComponent.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/java/com/android/incallui/maps/MapsComponent.java b/java/com/android/incallui/maps/MapsComponent.java
index 796abaa92..1ca17b781 100644
--- a/java/com/android/incallui/maps/MapsComponent.java
+++ b/java/com/android/incallui/maps/MapsComponent.java
@@ -19,18 +19,29 @@ package com.android.incallui.maps;
import android.content.Context;
import com.android.dialer.inject.HasRootComponent;
import dagger.Subcomponent;
+import com.android.incallui.maps.stub.StubMapsModule;
/** Subcomponent that can be used to access the maps implementation. */
-@Subcomponent
-public abstract class MapsComponent {
+public class MapsComponent {
- public abstract Maps getMaps();
+ private static MapsComponent instance;
+ private Maps maps;
+
+ public Maps getMaps() {
+ if (maps == null) {
+ maps = new StubMapsModule.StubMaps();
+ }
+ return maps;
+ }
public static MapsComponent get(Context context) {
- return ((HasComponent) ((HasRootComponent) context.getApplicationContext()).component())
- .mapsComponent();
+ if (instance == null) {
+ instance = new MapsComponent();
+ }
+ return instance;
}
+
/** Used to refer to the root application component. */
public interface HasComponent {
MapsComponent mapsComponent();