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

Commit a94ae667 authored by Roman Birg's avatar Roman Birg
Browse files

DcTracker: use IMSI with APN lookup



Ticket: PAELLA-158
Change-Id: Id805a8ef16a1054dac0bd2b3f3b83a32d4502eea
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 514c79b5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ public class DcTracker extends DcTrackerBase {

    static final Uri PREFERAPN_NO_UPDATE_URI_USING_SUBID =
                        Uri.parse("content://telephony/carriers/preferapn_no_update/subId/");
    static final Uri PREFERAPN_NO_UPDATE_URI_USING_SUBID_IMSI =
            Uri.parse("content://telephony/carriers/preferapn_no_update/subIdImsi/");
    static final String APN_ID = "apn_id";

    /**
@@ -2762,7 +2764,9 @@ public class DcTracker extends DcTrackerBase {
        }

        String subId = Long.toString(mPhone.getSubId());
        Uri uri = Uri.withAppendedPath(PREFERAPN_NO_UPDATE_URI_USING_SUBID, subId);
        String imsi = mPhone.getSubscriberId();
        Uri uri = Uri.withAppendedPath(PREFERAPN_NO_UPDATE_URI_USING_SUBID_IMSI, subId);
        uri = Uri.withAppendedPath(uri, imsi);
        log("setPreferredApn: delete");
        ContentResolver resolver = mPhone.getContext().getContentResolver();
        resolver.delete(uri, null, null);
@@ -2782,7 +2786,9 @@ public class DcTracker extends DcTrackerBase {
        }

        String subId = Long.toString(mPhone.getSubId());
        Uri uri = Uri.withAppendedPath(PREFERAPN_NO_UPDATE_URI_USING_SUBID, subId);
        String imsi = mPhone.getSubscriberId();
        Uri uri = Uri.withAppendedPath(PREFERAPN_NO_UPDATE_URI_USING_SUBID_IMSI, subId);
        uri = Uri.withAppendedPath(uri, imsi);
        Cursor cursor = mPhone.getContext().getContentResolver().query(
                uri, new String[] { "_id", "name", "apn" },
                null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);