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

Commit 9f638ce6 authored by Amit Mahajan's avatar Amit Mahajan Committed by Android (Google) Code Review
Browse files

Merge "fix issues to set data profiles" into lmp-dev

parents d8e86a5e dd5db099
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -107,4 +107,9 @@ public class DataProfile {
                + "/" + maxConns + "/" + waitTime + "/" + enabled;
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof DataProfile == false) return false;
        return (toString().equals(o.toString()));
    }
}
+12 −2
Original line number Diff line number Diff line
@@ -1697,7 +1697,8 @@ public abstract class DcTrackerBase extends Handler {
            // Search for Initial APN setting and the first apn that can handle default
            for (ApnSetting apn : mAllApnSettings) {
                // Can't use apn.canHandleType(), as that returns true for APNs that have no type.
                if (ArrayUtils.contains(apn.types, PhoneConstants.APN_TYPE_IA)) {
                if (ArrayUtils.contains(apn.types, PhoneConstants.APN_TYPE_IA) &&
                        apn.carrierEnabled) {
                    // The Initial Attach APN is highest priority so use it if there is one
                    log("setInitialApn: iaApnSetting=" + apn);
                    iaApnSetting = apn;
@@ -1751,9 +1752,18 @@ public abstract class DcTrackerBase extends Handler {
                if (apn.modemCognitive) {
                    DataProfile dp = new DataProfile(apn,
                            mPhone.getServiceState().getRoaming());
                    boolean isDup = false;
                    for(DataProfile dpIn : dps) {
                        if (dp.equals(dpIn)) {
                            isDup = true;
                            break;
                        }
                    }
                    if (!isDup) {
                        dps.add(dp);
                    }
                }
            }
            if(dps.size() > 0) {
                mPhone.mCi.setDataProfile(dps.toArray(new DataProfile[0]), null);
            }