Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 370f9c1e authored by yueg's avatar yueg Committed by Copybara-Service
Browse files

Don't show mock location for emergency call

Test: manual
PiperOrigin-RevId: 202040098
Change-Id: Id9a6c59d343634473fc2f695d6eafefd16b3c1b7
parent 3549493f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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;
  }