diff options
author | Tommy Webb <tommy@calyxinstitute.org> | 2023-02-10 09:22:19 -0500 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
commit | 85aa1709e7bd375ca210edcdfce39be244e66b13 (patch) | |
tree | 1dedd76269b60421344315948b6866b3f7649c2e | |
parent | fdc7ab510cbebd0b0514e457acc82a3c41ececb7 (diff) |
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 <mse1969@posteo.de>
Co-Authored-By: Michael Bestas <mkbestas@gmail.com>
Change-Id: I9f372cfcf02d3b768bd5cf1de220eea1fe8c1dbb
-rw-r--r-- | services/core/java/com/android/server/location/gnss/GnssLocationProvider.java | 10 |
1 files changed, 9 insertions, 1 deletions
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)) { |