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

Commit 896f5fff authored by Chinmay Dhodapkar's avatar Chinmay Dhodapkar
Browse files

Do not send mock/spoofed location for emergency calls

Change-Id: I6d7e7577794bd42eb3f9641f48a12c03626c890c
Bug: 275942159
Tests: CTS
parent 7b6c9ba0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        ConnectionServiceFocusManager.ConnectionServiceFocus {

    private static final String TELECOM_ABBREVIATION = "cast";

    private CompletableFuture<Pair<Integer, Location>> mQueryLocationFuture = null;
    private @Nullable CancellationSignal mOngoingQueryLocationRequest = null;
    private final ExecutorService mQueryLocationExecutor = Executors.newSingleThreadExecutor();
@@ -1432,7 +1431,11 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                callback.send(0,
                        getQueryLocationErrorResult(QueryLocationException.ERROR_UNSPECIFIED));
            }
            //make sure we don't pass mock locations diretly, always reset() mock locations
            if (result.second != null) {
                if(result.second.isMock()) {
                    result.second.reset();
                }
                callback.send(1, getQueryLocationResult(result.second));
            } else {
                callback.send(0, getQueryLocationErrorResult(result.first));