From 85aa1709e7bd375ca210edcdfce39be244e66b13 Mon Sep 17 00:00:00 2001 From: Tommy Webb Date: Fri, 10 Feb 2023 09:22:19 -0500 Subject: Remove sensitive info from SUPL requests Except in case of emergency, do not include sensitive subscriber information in SUPL requests (A-GPS). Issue: calyxos#618 Co-Authored-By: MSe1969 Co-Authored-By: Michael Bestas Change-Id: I9f372cfcf02d3b768bd5cf1de220eea1fe8c1dbb --- .../com/android/server/location/gnss/GnssLocationProvider.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java index a6a3db11b729..e9b3e8577fd2 100644 --- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java +++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java @@ -1720,9 +1720,17 @@ public class GnssLocationProvider extends AbstractLocationProvider implements mContext.getSystemService(Context.TELEPHONY_SERVICE); int type = AGPS_SETID_TYPE_NONE; String setId = null; + final Boolean isEmergency = mNIHandler.getInEmergency(); + + // Unless we are in an emergency, do not provide sensitive subscriber information + // to SUPL servers. + if (!isEmergency) { + mGnssNative.setAgpsSetId(type, ""); + return; + } int subId = SubscriptionManager.getDefaultDataSubscriptionId(); - if (mNIHandler.getInEmergency() && mNetworkConnectivityHandler.getActiveSubId() >= 0) { + if (isEmergency && mNetworkConnectivityHandler.getActiveSubId() >= 0) { subId = mNetworkConnectivityHandler.getActiveSubId(); } if (SubscriptionManager.isValidSubscriptionId(subId)) { -- cgit v1.2.3