From 30ccc4f3aa6da94f0bb8a01a880a6353b883b263 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 20 Mar 2017 20:40:36 +0000 Subject: Revert "Update AOSP Dialer source from internal google3 repository at cl/150622237" This reverts commit 06b6b56e9eaa91ebf757ea641e38a9c885fa40bd. Change-Id: Ida8c5ee67669524dc63b9adc60a6dd392cb9b9a6 --- java/com/android/incallui/maps/MapsComponent.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'java/com/android/incallui/maps/MapsComponent.java') 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(); -- cgit v1.2.3