summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2018-06-25 16:27:06 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-26 13:45:19 -0700
commit370f9c1ecdf1d48360a625c31439dc449b350670 (patch)
tree8adf42ea8bfb816df547139bd53ca139f3ba0571
parent3549493fcf01ea4926666d6ceeb85e35271345e2 (diff)
Don't show mock location for emergency call
Test: manual PiperOrigin-RevId: 202040098 Change-Id: Id9a6c59d343634473fc2f695d6eafefd16b3c1b7
-rw-r--r--java/com/android/incallui/calllocation/impl/LocationHelper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/java/com/android/incallui/calllocation/impl/LocationHelper.java b/java/com/android/incallui/calllocation/impl/LocationHelper.java
index 7fbd60d04..5c105e4c0 100644
--- a/java/com/android/incallui/calllocation/impl/LocationHelper.java
+++ b/java/com/android/incallui/calllocation/impl/LocationHelper.java
@@ -49,6 +49,7 @@ public class LocationHelper {
public static final int LOCATION_STATUS_STALE = 2;
public static final int LOCATION_STATUS_INACCURATE = 3;
public static final int LOCATION_STATUS_NO_LOCATION = 4;
+ public static final int LOCATION_STATUS_MOCK = 5;
/** Possible return values for {@code checkLocation()} */
@IntDef({
@@ -56,7 +57,8 @@ public class LocationHelper {
LOCATION_STATUS_OK,
LOCATION_STATUS_STALE,
LOCATION_STATUS_INACCURATE,
- LOCATION_STATUS_NO_LOCATION
+ LOCATION_STATUS_NO_LOCATION,
+ LOCATION_STATUS_MOCK
})
@Retention(RetentionPolicy.SOURCE)
public @interface LocationStatus {}
@@ -118,6 +120,11 @@ public class LocationHelper {
return LOCATION_STATUS_INACCURATE;
}
+ if (location.isFromMockProvider()) {
+ LogUtil.i("LocationHelper.checkLocation", "from mock provider");
+ return LOCATION_STATUS_MOCK;
+ }
+
return LOCATION_STATUS_OK;
}