From 370f9c1ecdf1d48360a625c31439dc449b350670 Mon Sep 17 00:00:00 2001 From: yueg Date: Mon, 25 Jun 2018 16:27:06 -0700 Subject: Don't show mock location for emergency call Test: manual PiperOrigin-RevId: 202040098 Change-Id: Id9a6c59d343634473fc2f695d6eafefd16b3c1b7 --- java/com/android/incallui/calllocation/impl/LocationHelper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'java') 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; } -- cgit v1.2.3