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

Commit 061b42be authored by Susheel nyamala's avatar Susheel nyamala Committed by Gerrit - the friendly Code Review server
Browse files

OMH code enhancements

Address code change comments suggested for OMH feature.

Change-Id: I74fb8c5585e6cdeffece72935d879f9c4494e80a
CRs-Fixed: 564965
parent f90f7120
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -445,17 +445,6 @@ public final class CdmaDataProfileTracker extends Handler {
        return false;
    }

    protected String[] getActiveApnTypes() {
        String[] result;
        if (mActiveDp != null) {
            result = mActiveDp.getServiceTypes();
        } else {
            result = new String[1];
            result[0] = PhoneConstants.APN_TYPE_DEFAULT;
        }
        return result;
    }

    protected void log(String s) {
        Log.d(LOG_TAG, "[CdmaDataProfileTracker] " + s);
    }
+0 −11
Original line number Diff line number Diff line
@@ -38,9 +38,6 @@ public abstract class DataProfile {
    public String mmsProxy;
    public String mmsPort;

    /* ID of the profile in the modem */
    protected int mProfileId = 0;

    /**
     * Current status of APN
     * true : enabled APN, false : disabled APN.
@@ -117,10 +114,6 @@ public abstract class DataProfile {
        mDc = null;
    }

    public String[] getServiceTypes() {
       return types.clone();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("[DataProfile] ")
@@ -140,10 +133,6 @@ public abstract class DataProfile {
        return sb.toString();
    }

    public void setProfileId(int profileId) {
        mProfileId = profileId;
    }

    /* some way to identify this data profile uniquely */
    public abstract String toHash();

+5 −18
Original line number Diff line number Diff line
@@ -108,30 +108,22 @@ public class DataProfileOmh extends DataProfile {
    /* Priority of this profile in the modem */
    private int mPriority = 0;

    private static String PROFILE_TYPE = "DataProfileOmh";
    /* ID of the profile in the modem */
    private int mProfileId = 0;

    public DataProfileOmh(int id, String numeric, String name, String user, String password,
            int authType, String[] types, String protocol, String roamingProtocol, int bearer) {
        super(id, numeric, name, user, password,
                authType, types, protocol, roamingProtocol, bearer);
    }
    private static String PROFILE_TYPE = "DataProfileOmh";

    public DataProfileOmh() {
    public DataProfileOmh(int profileId, int priority) {
        /**
         * Default values if the profile is being used for only selective
         * fields e.g: just profileId and Priority. use case is when rest of the
         * fields can be read and processed only by the modem
         */
        this(0, "", PROFILE_TYPE, null, null,
        super(0, "", PROFILE_TYPE, null, null,
                RILConstants.SETUP_DATA_AUTH_PAP_CHAP, null,
                "IP", "IP", 0);
    }

    public DataProfileOmh(int profileId, int priority) {
        this();
        this.mProfileId = profileId;
        this.mPriority = priority;
        this.types = new String[0];
    }

    @Override
@@ -206,11 +198,6 @@ public class DataProfileOmh extends DataProfile {
        return mPriority;
    }

    public String[] getServiceTypes() {
        String[] dummy = null;
        return dummy;
    }

    public void addServiceType(DataProfileTypeModem modemProfile) {
        serviceTypeMasks |= modemProfile.getid();