summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/calllocation/CallLocationComponent.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/incallui/calllocation/CallLocationComponent.java')
-rw-r--r--java/com/android/incallui/calllocation/CallLocationComponent.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/java/com/android/incallui/calllocation/CallLocationComponent.java b/java/com/android/incallui/calllocation/CallLocationComponent.java
index 6b1faf299..46ca669db 100644
--- a/java/com/android/incallui/calllocation/CallLocationComponent.java
+++ b/java/com/android/incallui/calllocation/CallLocationComponent.java
@@ -17,26 +17,18 @@
package com.android.incallui.calllocation;
import android.content.Context;
+import com.android.dialer.inject.HasRootComponent;
import dagger.Subcomponent;
-import com.android.incallui.calllocation.stub.StubCallLocationModule;
/** Subcomponent that can be used to access the call location implementation. */
-public class CallLocationComponent {
- private static CallLocationComponent instance;
- private CallLocation callLocation;
+@Subcomponent
+public abstract class CallLocationComponent {
- public CallLocation getCallLocation(){
- if (callLocation == null) {
- callLocation = new StubCallLocationModule.StubCallLocation();
- }
- return callLocation;
- }
+ public abstract CallLocation getCallLocation();
public static CallLocationComponent get(Context context) {
- if (instance == null) {
- instance = new CallLocationComponent();
- }
- return instance;
+ return ((HasComponent) ((HasRootComponent) context.getApplicationContext()).component())
+ .callLocationComponent();
}
/** Used to refer to the root application component. */