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

Commit 5dd006e3 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

base: Remove sending IMSI/MSISDN to SUPL server

- Both are sent only for devices with simcard
 IMSI - Subscriber Id
 MSISDN - Line/Phone Number
parent 58ae0f32
Loading
Loading
Loading
Loading
+5 −31
Original line number Diff line number Diff line
@@ -1596,37 +1596,11 @@ public class GnssLocationProvider extends AbstractLocationProvider implements

    @Override
    public void onRequestSetID(@GnssNative.AGpsCallbacks.AgpsSetIdFlags int flags) {
        TelephonyManager phone = (TelephonyManager)
                mContext.getSystemService(Context.TELEPHONY_SERVICE);
        int type = AGPS_SETID_TYPE_NONE;
        String setId = null;

        // Unless we are in an emergency, do not provide sensitive subscriber information
        // to SUPL servers.
        if (!mNIHandler.getInEmergency()) {
            mGnssNative.setAgpsSetId(type, "");
            return;
        }

        int ddSubId = SubscriptionManager.getDefaultDataSubscriptionId();
        if (SubscriptionManager.isValidSubscriptionId(ddSubId)) {
            phone = phone.createForSubscriptionId(ddSubId);
        }
        if ((flags & AGPS_REQUEST_SETID_IMSI) == AGPS_REQUEST_SETID_IMSI) {
            setId = phone.getSubscriberId();
            if (setId != null) {
                // This means the framework has the SIM card.
                type = AGPS_SETID_TYPE_IMSI;
            }
        } else if ((flags & AGPS_REQUEST_SETID_MSISDN) == AGPS_REQUEST_SETID_MSISDN) {
            setId = phone.getLine1Number();
            if (setId != null) {
                // This means the framework has the SIM card.
                type = AGPS_SETID_TYPE_MSISDN;
            }
        }

        mGnssNative.setAgpsSetId(type, (setId == null) ? "" : setId);
        // Dont send IMSI or Phone number to SUPL server
        // Fine on devices with/without SIM cards
        final int type = AGPS_SETID_TYPE_NONE;
        final String setId = "";
        mGnssNative.setAgpsSetId(type, setId);
    }

    @Override