summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/calllocation
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/calllocation
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/calllocation')
-rw-r--r--java/com/android/incallui/calllocation/CallLocationComponent.java20
-rw-r--r--java/com/android/incallui/calllocation/impl/HttpFetcher.java2
-rw-r--r--java/com/android/incallui/calllocation/stub/StubCallLocationModule.java6
3 files changed, 17 insertions, 11 deletions
diff --git a/java/com/android/incallui/calllocation/CallLocationComponent.java b/java/com/android/incallui/calllocation/CallLocationComponent.java
index 46ca669db..6b1faf299 100644
--- a/java/com/android/incallui/calllocation/CallLocationComponent.java
+++ b/java/com/android/incallui/calllocation/CallLocationComponent.java
@@ -17,18 +17,26 @@
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. */
-@Subcomponent
-public abstract class CallLocationComponent {
+public class CallLocationComponent {
+ private static CallLocationComponent instance;
+ private CallLocation callLocation;
- public abstract CallLocation getCallLocation();
+ public CallLocation getCallLocation(){
+ if (callLocation == null) {
+ callLocation = new StubCallLocationModule.StubCallLocation();
+ }
+ return callLocation;
+ }
public static CallLocationComponent get(Context context) {
- return ((HasComponent) ((HasRootComponent) context.getApplicationContext()).component())
- .callLocationComponent();
+ if (instance == null) {
+ instance = new CallLocationComponent();
+ }
+ return instance;
}
/** Used to refer to the root application component. */
diff --git a/java/com/android/incallui/calllocation/impl/HttpFetcher.java b/java/com/android/incallui/calllocation/impl/HttpFetcher.java
index 7bfbaa6ef..c4aaa2257 100644
--- a/java/com/android/incallui/calllocation/impl/HttpFetcher.java
+++ b/java/com/android/incallui/calllocation/impl/HttpFetcher.java
@@ -223,8 +223,6 @@ public class HttpFetcher {
/**
* Lookup up url re-write rules from gServices and apply to the given url.
*
- * <p>https://wiki.corp.google.com/twiki/bin/view/Main/AndroidGservices#URL_Rewriting_Rules
- *
* @return The new url.
*/
private static URL reWriteUrl(Context context, String url) {
diff --git a/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java b/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java
index 20460699a..fc198c724 100644
--- a/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java
+++ b/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java
@@ -32,9 +32,9 @@ public abstract class StubCallLocationModule {
@Binds
public abstract CallLocation bindCallLocation(StubCallLocation callLocation);
- static class StubCallLocation implements CallLocation {
+ static public class StubCallLocation implements CallLocation {
@Inject
- StubCallLocation() {}
+ public StubCallLocation() {}
@Override
public boolean canGetLocation(@NonNull Context context) {
@@ -44,7 +44,7 @@ public abstract class StubCallLocationModule {
@Override
@NonNull
public Fragment getLocationFragment(@NonNull Context context) {
- throw Assert.createUnsupportedOperationFailException();
+ return null;
}
@Override