Loading src/java/com/android/internal/telephony/PhoneBase.java +10 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,11 @@ import static com.android.internal.telephony.MSimConstants.DEFAULT_SUBSCRIPTION; public abstract class PhoneBase extends Handler implements Phone { private static final String LOG_TAG = "PhoneBase"; /** * Indicates whether Out Of Service is considered as data call disconnect. */ protected static final String PROPERTY_OOS_IS_DISCONNECT = "persist.telephony.oosisdc"; // Key used to read and write the saved network selection numeric value public static final String NETWORK_SELECTION_KEY = "network_selection_key"; // Key used to read and write the saved network selection operator name Loading Loading @@ -182,6 +187,10 @@ public abstract class PhoneBase extends Handler implements Phone { return mActionAttached; } // Flag that indicates that Out Of Service is considered as data call disconnect protected boolean mOosIsDisconnect = SystemProperties.getBoolean( PROPERTY_OOS_IS_DISCONNECT, false); /** * Set a system property, unless we're in unit test mode */ Loading Loading @@ -320,6 +329,7 @@ public abstract class PhoneBase extends Handler implements Phone { mSmsUsageMonitor = new SmsUsageMonitor(context); mUiccController = UiccController.getInstance(); mUiccController.registerForIccChanged(this, EVENT_ICC_CHANGED, null); Rlog.d(LOG_TAG, "mOosIsDisconnect=" + mOosIsDisconnect); } @Override Loading src/java/com/android/internal/telephony/cdma/CDMALTEPhone.java +13 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.Message; import android.preference.PreferenceManager; import android.provider.Telephony; import android.telephony.Rlog; import android.telephony.ServiceState; import com.android.internal.telephony.CommandsInterface; Loading Loading @@ -112,6 +113,10 @@ public class CDMALTEPhone extends CDMAPhone { // removeReferences() have already been called ret = PhoneConstants.DataState.DISCONNECTED; } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE && mOosIsDisconnect) { ret = PhoneConstants.DataState.DISCONNECTED; log("getDataConnectionState: Data is Out of Service. ret = " + ret); } else if (mDcTracker.isApnTypeEnabled(apnType) == false) { ret = PhoneConstants.DataState.DISCONNECTED; } else { Loading Loading @@ -237,11 +242,14 @@ public class CDMALTEPhone extends CDMAPhone { return false; } // return IMSI from USIM as subscriber ID. @Override public String getSubscriberId() { if ((super.getSubscriberId()) != null) { return super.getSubscriberId(); } else { return (mSimRecords != null) ? mSimRecords.getIMSI() : ""; } } // return GID1 from USIM @Override Loading src/java/com/android/internal/telephony/cdma/CDMAPhone.java +12 −2 Original line number Diff line number Diff line Loading @@ -532,7 +532,15 @@ public class CDMAPhone extends PhoneBase { @Override public String getSubscriberId() { return mSST.getImsi(); if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) { return mSST.getNvImsi(); } else { IccRecords r = mIccRecords.get(); if (r != null) { return r.getIMSI(); } } return null; } @Override Loading Loading @@ -715,10 +723,12 @@ public class CDMAPhone extends PhoneBase { // already been called ret = PhoneConstants.DataState.DISCONNECTED; } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) { } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE && mOosIsDisconnect) { // If we're out of service, open TCP sockets may still work // but no data will flow ret = PhoneConstants.DataState.DISCONNECTED; log("getDataConnectionState: Data is Out of Service. ret = " + ret); } else if (mDcTracker.isApnTypeEnabled(apnType) == false || mDcTracker.isApnTypeActive(apnType) == false) { ret = PhoneConstants.DataState.DISCONNECTED; Loading src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +3 −15 Original line number Diff line number Diff line Loading @@ -414,17 +414,6 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { mIsMinInfoReady = true; updateOtaspState(); if (!mIsSubscriptionFromRuim && mIccRecords != null) { if (DBG) { log("GET_CDMA_SUBSCRIPTION set imsi in mIccRecords"); } mIccRecords.setImsi(getImsi()); } else { if (DBG) { log("GET_CDMA_SUBSCRIPTION either mIccRecords is null or NV type device" + " - not setting Imsi in mIccRecords"); } } } else { if (DBG) { log("GET_CDMA_SUBSCRIPTION: error parsing cdmaSubscription params num=" Loading Loading @@ -1642,12 +1631,11 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { } /** * Returns IMSI as MCC + MNC + MIN * Returns IMSI from NV in the format MCC + MNC + MIN */ public String getImsi() { // TODO: When RUIM is enabled, IMSI will come from RUIM not build-time props. public String getNvImsi() { String operatorNumeric = getSystemProperty( TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, ""); CDMAPhone.PROPERTY_CDMA_HOME_OPERATOR_NUMERIC, ""); if (!TextUtils.isEmpty(operatorNumeric) && getCdmaMin() != null) { return (operatorNumeric + getCdmaMin()); Loading src/java/com/android/internal/telephony/gsm/GSMPhone.java +3 −1 Original line number Diff line number Diff line Loading @@ -335,10 +335,12 @@ public class GSMPhone extends PhoneBase { ret = PhoneConstants.DataState.DISCONNECTED; } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) { != ServiceState.STATE_IN_SERVICE && mOosIsDisconnect) { // If we're out of service, open TCP sockets may still work // but no data will flow ret = PhoneConstants.DataState.DISCONNECTED; Rlog.d(LOG_TAG, "getDataConnectionState: Data is Out of Service. ret = " + ret); } else if (mDcTracker.isApnTypeEnabled(apnType) == false || mDcTracker.isApnTypeActive(apnType) == false) { //TODO: isApnTypeActive() is just checking whether ApnContext holds Loading Loading
src/java/com/android/internal/telephony/PhoneBase.java +10 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,11 @@ import static com.android.internal.telephony.MSimConstants.DEFAULT_SUBSCRIPTION; public abstract class PhoneBase extends Handler implements Phone { private static final String LOG_TAG = "PhoneBase"; /** * Indicates whether Out Of Service is considered as data call disconnect. */ protected static final String PROPERTY_OOS_IS_DISCONNECT = "persist.telephony.oosisdc"; // Key used to read and write the saved network selection numeric value public static final String NETWORK_SELECTION_KEY = "network_selection_key"; // Key used to read and write the saved network selection operator name Loading Loading @@ -182,6 +187,10 @@ public abstract class PhoneBase extends Handler implements Phone { return mActionAttached; } // Flag that indicates that Out Of Service is considered as data call disconnect protected boolean mOosIsDisconnect = SystemProperties.getBoolean( PROPERTY_OOS_IS_DISCONNECT, false); /** * Set a system property, unless we're in unit test mode */ Loading Loading @@ -320,6 +329,7 @@ public abstract class PhoneBase extends Handler implements Phone { mSmsUsageMonitor = new SmsUsageMonitor(context); mUiccController = UiccController.getInstance(); mUiccController.registerForIccChanged(this, EVENT_ICC_CHANGED, null); Rlog.d(LOG_TAG, "mOosIsDisconnect=" + mOosIsDisconnect); } @Override Loading
src/java/com/android/internal/telephony/cdma/CDMALTEPhone.java +13 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.Message; import android.preference.PreferenceManager; import android.provider.Telephony; import android.telephony.Rlog; import android.telephony.ServiceState; import com.android.internal.telephony.CommandsInterface; Loading Loading @@ -112,6 +113,10 @@ public class CDMALTEPhone extends CDMAPhone { // removeReferences() have already been called ret = PhoneConstants.DataState.DISCONNECTED; } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE && mOosIsDisconnect) { ret = PhoneConstants.DataState.DISCONNECTED; log("getDataConnectionState: Data is Out of Service. ret = " + ret); } else if (mDcTracker.isApnTypeEnabled(apnType) == false) { ret = PhoneConstants.DataState.DISCONNECTED; } else { Loading Loading @@ -237,11 +242,14 @@ public class CDMALTEPhone extends CDMAPhone { return false; } // return IMSI from USIM as subscriber ID. @Override public String getSubscriberId() { if ((super.getSubscriberId()) != null) { return super.getSubscriberId(); } else { return (mSimRecords != null) ? mSimRecords.getIMSI() : ""; } } // return GID1 from USIM @Override Loading
src/java/com/android/internal/telephony/cdma/CDMAPhone.java +12 −2 Original line number Diff line number Diff line Loading @@ -532,7 +532,15 @@ public class CDMAPhone extends PhoneBase { @Override public String getSubscriberId() { return mSST.getImsi(); if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) { return mSST.getNvImsi(); } else { IccRecords r = mIccRecords.get(); if (r != null) { return r.getIMSI(); } } return null; } @Override Loading Loading @@ -715,10 +723,12 @@ public class CDMAPhone extends PhoneBase { // already been called ret = PhoneConstants.DataState.DISCONNECTED; } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) { } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE && mOosIsDisconnect) { // If we're out of service, open TCP sockets may still work // but no data will flow ret = PhoneConstants.DataState.DISCONNECTED; log("getDataConnectionState: Data is Out of Service. ret = " + ret); } else if (mDcTracker.isApnTypeEnabled(apnType) == false || mDcTracker.isApnTypeActive(apnType) == false) { ret = PhoneConstants.DataState.DISCONNECTED; Loading
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +3 −15 Original line number Diff line number Diff line Loading @@ -414,17 +414,6 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { mIsMinInfoReady = true; updateOtaspState(); if (!mIsSubscriptionFromRuim && mIccRecords != null) { if (DBG) { log("GET_CDMA_SUBSCRIPTION set imsi in mIccRecords"); } mIccRecords.setImsi(getImsi()); } else { if (DBG) { log("GET_CDMA_SUBSCRIPTION either mIccRecords is null or NV type device" + " - not setting Imsi in mIccRecords"); } } } else { if (DBG) { log("GET_CDMA_SUBSCRIPTION: error parsing cdmaSubscription params num=" Loading Loading @@ -1642,12 +1631,11 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { } /** * Returns IMSI as MCC + MNC + MIN * Returns IMSI from NV in the format MCC + MNC + MIN */ public String getImsi() { // TODO: When RUIM is enabled, IMSI will come from RUIM not build-time props. public String getNvImsi() { String operatorNumeric = getSystemProperty( TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, ""); CDMAPhone.PROPERTY_CDMA_HOME_OPERATOR_NUMERIC, ""); if (!TextUtils.isEmpty(operatorNumeric) && getCdmaMin() != null) { return (operatorNumeric + getCdmaMin()); Loading
src/java/com/android/internal/telephony/gsm/GSMPhone.java +3 −1 Original line number Diff line number Diff line Loading @@ -335,10 +335,12 @@ public class GSMPhone extends PhoneBase { ret = PhoneConstants.DataState.DISCONNECTED; } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) { != ServiceState.STATE_IN_SERVICE && mOosIsDisconnect) { // If we're out of service, open TCP sockets may still work // but no data will flow ret = PhoneConstants.DataState.DISCONNECTED; Rlog.d(LOG_TAG, "getDataConnectionState: Data is Out of Service. ret = " + ret); } else if (mDcTracker.isApnTypeEnabled(apnType) == false || mDcTracker.isApnTypeActive(apnType) == false) { //TODO: isApnTypeActive() is just checking whether ApnContext holds Loading