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

Commit 4c89b14d authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Don't accept a user-defined dun-capable connection

If we're asked to connect to a DUN APN and we have a carrier specified
DUN APN setting, verify what we're connected to is the same as what the
carrier specified before accepting it.

bug:4048013
Change-Id: I91edc4a1342cb40c1f6959e149303b7d76710f96
parent df6410dc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -361,6 +361,12 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
    @Override
    protected boolean isApnTypeActive(String type) {
        // TODO: support simultaneous with List instead
        if (Phone.APN_TYPE_DUN.equals(type)) {
            ApnSetting dunApn = fetchDunApn();
            if (dunApn != null) {
                return ((mActiveApn != null) && (dunApn.toString().equals(mActiveApn.toString())));
            }
        }
        return mActiveApn != null && mActiveApn.canHandleType(type);
    }