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

Unverified Commit f9b5586a authored by Tommy Webb's avatar Tommy Webb Committed by Michael Bestas
Browse files

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: default avatarMSe1969 <mse1969@posteo.de>
Co-Authored-By: default avatarMichael Bestas <mkbestas@gmail.com>
Change-Id: I9f372cfcf02d3b768bd5cf1de220eea1fe8c1dbb
parent c11a528c
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1842,9 +1842,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 (mGnssConfiguration.isActiveSimEmergencySuplEnabled() && mNIHandler.getInEmergency()
        if (mGnssConfiguration.isActiveSimEmergencySuplEnabled() && isEmergency
                && mNetworkConnectivityHandler.getActiveSubId() >= 0) {
            subId = mNetworkConnectivityHandler.getActiveSubId();
        }