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

Commit 8b41bc91 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am b9be4520: am 5d612f16: Merge "Remove unused onResetDone." into honeycomb-LTE

* commit 'b9be4520':
  Remove unused onResetDone.
parents e9f66af9 b9be4520
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -219,6 +219,7 @@ public abstract class DataConnection extends HierarchicalStateMachine {
    protected static final int EVENT_LOG_BAD_DNS_ADDRESS = 50100;
    protected static final int EVENT_LOG_BAD_DNS_ADDRESS = 50100;


    //***** Member Variables
    //***** Member Variables
    protected ApnSetting mApn;
    protected int mTag;
    protected int mTag;
    protected PhoneBase phone;
    protected PhoneBase phone;
    protected int cid;
    protected int cid;
@@ -429,11 +430,12 @@ public abstract class DataConnection extends HierarchicalStateMachine {
    protected void clearSettings() {
    protected void clearSettings() {
        if (DBG) log("clearSettings");
        if (DBG) log("clearSettings");


        this.createTime = -1;
        createTime = -1;
        this.lastFailTime = -1;
        lastFailTime = -1;
        this.lastFailCause = FailCause.NONE;
        lastFailCause = FailCause.NONE;


        mLinkProperties = new LinkProperties();
        mLinkProperties = new LinkProperties();
        mApn = null;
    }
    }


    /**
    /**
@@ -1087,4 +1089,11 @@ public abstract class DataConnection extends HierarchicalStateMachine {
    public FailCause getLastFailCause() {
    public FailCause getLastFailCause() {
        return lastFailCause;
        return lastFailCause;
    }
    }

    /**
     * @return the current ApnSetting
     */
    public ApnSetting getApn() {
        return mApn;
    }
}
}
+20 −2
Original line number Original line Diff line number Diff line
@@ -441,7 +441,6 @@ public abstract class DataConnectionTracker extends Handler {
    protected abstract void onRadioOffOrNotAvailable();
    protected abstract void onRadioOffOrNotAvailable();
    protected abstract void onDataSetupComplete(AsyncResult ar);
    protected abstract void onDataSetupComplete(AsyncResult ar);
    protected abstract void onDisconnectDone(int connId, AsyncResult ar);
    protected abstract void onDisconnectDone(int connId, AsyncResult ar);
    protected abstract void onResetDone(AsyncResult ar);
    protected abstract void onVoiceCallStarted();
    protected abstract void onVoiceCallStarted();
    protected abstract void onVoiceCallEnded();
    protected abstract void onVoiceCallEnded();
    protected abstract void onCleanUpConnection(boolean tearDown, int apnId, String reason);
    protected abstract void onCleanUpConnection(boolean tearDown, int apnId, String reason);
@@ -514,9 +513,10 @@ public abstract class DataConnectionTracker extends Handler {
                onSetInternalDataEnabled(enabled);
                onSetInternalDataEnabled(enabled);
                break;
                break;
            }
            }
            case EVENT_RESET_DONE:
            case EVENT_RESET_DONE: {
                onResetDone((AsyncResult) msg.obj);
                onResetDone((AsyncResult) msg.obj);
                break;
                break;
            }
            case CMD_SET_DATA_ENABLE: {
            case CMD_SET_DATA_ENABLE: {
                log("CMD_SET_DATA_ENABLE msg=" + msg);
                log("CMD_SET_DATA_ENABLE msg=" + msg);
                boolean enabled = (msg.arg1 == ENABLED) ? true : false;
                boolean enabled = (msg.arg1 == ENABLED) ? true : false;
@@ -602,6 +602,8 @@ public abstract class DataConnectionTracker extends Handler {


    protected abstract void setState(State s);
    protected abstract void setState(State s);


    protected abstract void gotoIdleAndNotifyDataConnection(String reason);

    protected LinkProperties getLinkProperties(String apnType) {
    protected LinkProperties getLinkProperties(String apnType) {
        int id = apnTypeToId(apnType);
        int id = apnTypeToId(apnType);
        if (isApnIdEnabled(id)) {
        if (isApnIdEnabled(id)) {
@@ -872,6 +874,22 @@ public abstract class DataConnectionTracker extends Handler {
    protected void onEnableNewApn() {
    protected void onEnableNewApn() {
    }
    }


    /**
     * Called when EVENT_RESET_DONE is received so goto
     * IDLE state and send notifications to those interested.
     *
     * TODO - currently unused.  Needs to be hooked into DataConnection cleanup
     * TODO - needs to pass some notion of which connection is reset..
     */
    protected void onResetDone(AsyncResult ar) {
        if (DBG) log("EVENT_RESET_DONE");
        String reason = null;
        if (ar.userObj instanceof String) {
            reason = (String) ar.userObj;
        }
        gotoIdleAndNotifyDataConnection(reason);
    }

    /**
    /**
     * Prevent mobile data connections from being established, or once again
     * Prevent mobile data connections from being established, or once again
     * allow mobile data connections. If the state toggles, then either tear
     * allow mobile data connections. If the state toggles, then either tear
+1 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,7 @@ public class CdmaDataConnection extends DataConnection {
    protected void onConnect(ConnectionParams cp) {
    protected void onConnect(ConnectionParams cp) {
        if (DBG) log("CdmaDataConnection Connecting...");
        if (DBG) log("CdmaDataConnection Connecting...");


        mApn = cp.apn;
        createTime = -1;
        createTime = -1;
        lastFailTime = -1;
        lastFailTime = -1;
        lastFailCause = FailCause.NONE;
        lastFailCause = FailCause.NONE;
+1 −15
Original line number Original line Diff line number Diff line
@@ -508,7 +508,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
        notifyDataAvailability(null);
        notifyDataAvailability(null);
    }
    }


    private void gotoIdleAndNotifyDataConnection(String reason) {
    protected void gotoIdleAndNotifyDataConnection(String reason) {
        if (DBG) log("gotoIdleAndNotifyDataConnection: reason=" + reason);
        if (DBG) log("gotoIdleAndNotifyDataConnection: reason=" + reason);
        setState(State.IDLE);
        setState(State.IDLE);
        notifyDataConnection(reason);
        notifyDataConnection(reason);
@@ -667,20 +667,6 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
      }
      }
    }
    }


    /**
     * Called when EVENT_RESET_DONE is received so goto
     * IDLE state and send notifications to those interested.
     */
    @Override
    protected void onResetDone(AsyncResult ar) {
      if (DBG) log("EVENT_RESET_DONE");
      String reason = null;
      if (ar.userObj instanceof String) {
          reason = (String) ar.userObj;
      }
      gotoIdleAndNotifyDataConnection(reason);
    }

    /**
    /**
     * @override com.android.internal.telephony.DataConnectionTracker
     * @override com.android.internal.telephony.DataConnectionTracker
     */
     */
+17 −28
Original line number Original line Diff line number Diff line
@@ -36,8 +36,6 @@ public class GsmDataConnection extends DataConnection {
    private static final String LOG_TAG = "GSM";
    private static final String LOG_TAG = "GSM";


    //***** Instance Variables
    //***** Instance Variables
    private ApnSetting apn;

    protected int mProfileId = RILConstants.DATA_PROFILE_DEFAULT;
    protected int mProfileId = RILConstants.DATA_PROFILE_DEFAULT;
    protected String mActiveApnType = Phone.APN_TYPE_DEFAULT;
    protected String mActiveApnType = Phone.APN_TYPE_DEFAULT;
    //***** Constructor
    //***** Constructor
@@ -74,13 +72,13 @@ public class GsmDataConnection extends DataConnection {
    @Override
    @Override
    protected
    protected
    void onConnect(ConnectionParams cp) {
    void onConnect(ConnectionParams cp) {
        apn = cp.apn;
        mApn = cp.apn;


        if (DBG) log("Connecting to carrier: '" + apn.carrier
        if (DBG) log("Connecting to carrier: '" + mApn.carrier
                + "' APN: '" + apn.apn
                + "' APN: '" + mApn.apn
                + "' proxy: '" + apn.proxy + "' port: '" + apn.port);
                + "' proxy: '" + mApn.proxy + "' port: '" + mApn.port);


        setHttpProxy (apn.proxy, apn.port);
        setHttpProxy (mApn.proxy, mApn.port);


        createTime = -1;
        createTime = -1;
        lastFailTime = -1;
        lastFailTime = -1;
@@ -90,23 +88,23 @@ public class GsmDataConnection extends DataConnection {
        Message msg = obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE, cp);
        Message msg = obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE, cp);
        msg.obj = cp;
        msg.obj = cp;


        int authType = apn.authType;
        int authType = mApn.authType;
        if (authType == -1) {
        if (authType == -1) {
            authType = (apn.user != null) ? RILConstants.SETUP_DATA_AUTH_PAP_CHAP :
            authType = (mApn.user != null) ? RILConstants.SETUP_DATA_AUTH_PAP_CHAP :
                RILConstants.SETUP_DATA_AUTH_NONE;
                RILConstants.SETUP_DATA_AUTH_NONE;
        }
        }


        String protocol;
        String protocol;
        if (phone.getServiceState().getRoaming()) {
        if (phone.getServiceState().getRoaming()) {
            protocol = apn.roamingProtocol;
            protocol = mApn.roamingProtocol;
        } else {
        } else {
            protocol = apn.protocol;
            protocol = mApn.protocol;
        }
        }


        phone.mCM.setupDataCall(
        phone.mCM.setupDataCall(
                Integer.toString(RILConstants.SETUP_DATA_TECH_GSM),
                Integer.toString(RILConstants.SETUP_DATA_TECH_GSM),
                Integer.toString(mProfileId),
                Integer.toString(mProfileId),
                apn.apn, apn.user, apn.password,
                mApn.apn, mApn.user, mApn.password,
                Integer.toString(authType),
                Integer.toString(authType),
                protocol, msg);
                protocol, msg);
    }
    }
@@ -128,15 +126,9 @@ public class GsmDataConnection extends DataConnection {
        mActiveApnType = apnType;
        mActiveApnType = apnType;
    }
    }


    @Override
    protected void clearSettings() {
        super.clearSettings();
        apn = null;
    }

    @Override
    @Override
    public String toString() {
    public String toString() {
        return "State=" + getCurrentState().getName() + " Apn=" + apn +
        return "State=" + getCurrentState().getName() + " Apn=" + mApn +
               " create=" + createTime + " lastFail=" + lastFailTime +
               " create=" + createTime + " lastFail=" + lastFailTime +
               " lastFailCause=" + lastFailCause;
               " lastFailCause=" + lastFailCause;
    }
    }
@@ -150,11 +142,12 @@ public class GsmDataConnection extends DataConnection {
            // Do not apply the race condition workaround for MMS APN
            // Do not apply the race condition workaround for MMS APN
            // if Proxy is an IP-address.
            // if Proxy is an IP-address.
            // Otherwise, the default APN will not be restored anymore.
            // Otherwise, the default APN will not be restored anymore.
            if (!apn.types[0].equals(Phone.APN_TYPE_MMS)
            if (!mApn.types[0].equals(Phone.APN_TYPE_MMS)
                || !isIpAddress(apn.mmsProxy)) {
                || !isIpAddress(mApn.mmsProxy)) {
                log(String.format(
                log(String.format(
                        "isDnsOk: return false apn.types[0]=%s APN_TYPE_MMS=%s isIpAddress(%s)=%s",
                        "isDnsOk: return false apn.types[0]=%s APN_TYPE_MMS=%s isIpAddress(%s)=%s",
                        apn.types[0], Phone.APN_TYPE_MMS, apn.mmsProxy, isIpAddress(apn.mmsProxy)));
                        mApn.types[0], Phone.APN_TYPE_MMS, mApn.mmsProxy,
                        isIpAddress(mApn.mmsProxy)));
                return false;
                return false;
            }
            }
        }
        }
@@ -166,15 +159,11 @@ public class GsmDataConnection extends DataConnection {
        Log.d(LOG_TAG, "[" + getName() + "] " + s);
        Log.d(LOG_TAG, "[" + getName() + "] " + s);
    }
    }


    public ApnSetting getApn() {
        return this.apn;
    }

    private void setHttpProxy(String httpProxy, String httpPort) {
    private void setHttpProxy(String httpProxy, String httpPort) {


        if (DBG) log("set http proxy for"
        if (DBG) log("set http proxy for"
                + "' APN: '" + mActiveApnType
                + "' APN: '" + mActiveApnType
                + "' proxy: '" + apn.proxy + "' port: '" + apn.port);
                + "' proxy: '" + mApn.proxy + "' port: '" + mApn.port);
        if(TextUtils.equals(mActiveApnType, Phone.APN_TYPE_DEFAULT)) {
        if(TextUtils.equals(mActiveApnType, Phone.APN_TYPE_DEFAULT)) {
            if (httpProxy == null || httpProxy.length() == 0) {
            if (httpProxy == null || httpProxy.length() == 0) {
                phone.setSystemProperty("net.gprs.http-proxy", null);
                phone.setSystemProperty("net.gprs.http-proxy", null);
@@ -205,6 +194,6 @@ public class GsmDataConnection extends DataConnection {
    private boolean isIpAddress(String address) {
    private boolean isIpAddress(String address) {
        if (address == null) return false;
        if (address == null) return false;


        return Patterns.IP_ADDRESS.matcher(apn.mmsProxy).matches();
        return Patterns.IP_ADDRESS.matcher(address).matches();
    }
    }
}
}
Loading