diff --git a/telephony/java/com/android/internal/telephony/ServiceStateTracker.java b/telephony/java/com/android/internal/telephony/ServiceStateTracker.java
index bdcf3f7099f27..8e76cd2384eea 100644
--- a/telephony/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -116,6 +116,7 @@ public abstract class ServiceStateTracker extends Handler {
protected static final int EVENT_POLL_STATE_CDMA_SUBSCRIPTION = 34;
protected static final int EVENT_NV_READY = 35;
protected static final int EVENT_ERI_FILE_LOADED = 36;
+ protected static final int EVENT_OTA_PROVISION_STATUS_CHANGE = 37;
//***** Time Zones
protected static final String TIMEZONE_PROPERTY = "persist.sys.timezone";
diff --git a/telephony/java/com/android/internal/telephony/SmsMessageBase.java b/telephony/java/com/android/internal/telephony/SmsMessageBase.java
index 3c7dd458f94bf..9c78b985e4897 100644
--- a/telephony/java/com/android/internal/telephony/SmsMessageBase.java
+++ b/telephony/java/com/android/internal/telephony/SmsMessageBase.java
@@ -352,60 +352,36 @@ public abstract class SmsMessageBase {
}
/**
- * Try to parse this message as an email gateway message -> Neither
- * of the standard ways are currently supported: There are two ways
- * specified in TS 23.040 Section 3.8 (not supported via this mechanism) -
- * SMS message "may have its TP-PID set for internet electronic mail - MT
+ * Try to parse this message as an email gateway message
+ * There are two ways specified in TS 23.040 Section 3.8 :
+ * - SMS message "may have its TP-PID set for internet electronic mail - MT
* SMS format: [
- */ - // TODO(Moto): Generally broadcast intents are for use to allow entities which - // may not know about each other to "communicate". This seems quite specific - // and maybe using the registrant style would be better. - - // Moto: Since this is used for apps not in the same process of phone, can the - // registrant style be used? (Ling Li says: Maybe the "app" can request rather - // than save the MDN each time and this intent would not be necessary?) - // Moto response: Moto internal discussion is on-going. - public static final String ACTION_CDMA_OTA_MDN_CHANGED - = "android.intent.action.ACTION_MDN_STATE_CHANGED"; - } diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index 3362de83e954d..42fa586f84e33 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java @@ -392,7 +392,7 @@ public class CDMAPhone extends PhoneBase { } public String getCdmaPrlVersion(){ - return mRuimRecords.getPrlVersion(); + return mSST.getPrlVersion(); } public String getCdmaMIN() { diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java index b45a9b2db1df8..d9912ca71f65c 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java @@ -127,6 +127,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { private int mHomeSystemId; private int mHomeNetworkId; private String mMin; + private String mPrlVersion; private boolean isEriTextLoaded = false; private boolean isSubscriptionFromRuim = false; @@ -178,6 +179,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { cm.registerForNVReady(this, EVENT_NV_READY, null); phone.registerForEriFileLoaded(this, EVENT_ERI_FILE_LOADED, null); + cm.registerForCdmaOtaProvision(this,EVENT_OTA_PROVISION_STATUS_CHANGE, null); // system setting property AIRPLANE_MODE_ON is set in Settings. int airplaneMode = Settings.System.getInt( @@ -201,6 +203,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { cm.unregisterForNetworkStateChanged(this); cm.unregisterForRUIMReady(this); cm.unregisterForNVReady(this); + cm.unregisterForCdmaOtaProvision(this); phone.unregisterForEriFileLoaded(this); phone.mRuimRecords.unregisterForRecordsLoaded(this); cm.unSetOnSignalStrengthUpdate(this); @@ -302,6 +305,10 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { case EVENT_NV_READY: isSubscriptionFromRuim = false; + // For Non-RUIM phones, the subscription information is stored in + // Non Volatile. Here when Non-Volatile is ready, we can poll the CDMA + // subscription info. + cm.getCDMASubscription( obtainMessage(EVENT_POLL_STATE_CDMA_SUBSCRIPTION)); pollState(); // Signal strength polling stops when radio is off queueNextSignalStrengthPoll(); @@ -379,11 +386,29 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { case EVENT_POLL_STATE_REGISTRATION_CDMA: case EVENT_POLL_STATE_OPERATOR_CDMA: - case EVENT_POLL_STATE_CDMA_SUBSCRIPTION: ar = (AsyncResult) msg.obj; handlePollStateResult(msg.what, ar); break; + case EVENT_POLL_STATE_CDMA_SUBSCRIPTION: // Handle RIL_CDMA_SUBSCRIPTION + ar = (AsyncResult) msg.obj; + + if (ar.exception == null) { + String cdmaSubscription[] = (String[])ar.result; + if (cdmaSubscription != null && cdmaSubscription.length >= 5) { + mMdn = cdmaSubscription[0]; + mHomeSystemId = Integer.parseInt(cdmaSubscription[1], 16); + mHomeNetworkId = Integer.parseInt(cdmaSubscription[2], 16); + mMin = cdmaSubscription[3]; + mPrlVersion = cdmaSubscription[4]; + Log.d(LOG_TAG,"GET_CDMA_SUBSCRIPTION MDN=" + mMdn); + } else { + Log.w(LOG_TAG,"error parsing cdmaSubscription params num=" + + cdmaSubscription.length); + } + } + break; + case EVENT_POLL_SIGNAL_STRENGTH: // Just poll signal strength...not part of pollState() @@ -430,6 +455,19 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { pollState(); break; + case EVENT_OTA_PROVISION_STATUS_CHANGE: + ar = (AsyncResult)msg.obj; + if (ar.exception == null) { + ints = (int[]) ar.result; + int otaStatus = ints[0]; + if (otaStatus == phone.CDMA_OTA_PROVISION_STATUS_COMMITTED + || otaStatus == phone.CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED) { + Log.d(LOG_TAG, "Received OTA_PROGRAMMING Complete,Reload MDN "); + cm.getCDMASubscription( obtainMessage(EVENT_POLL_STATE_CDMA_SUBSCRIPTION)); + } + } + break; + default: Log.e(LOG_TAG, "Unhandled message with number: " + msg.what); break; @@ -663,20 +701,6 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { } break; - case EVENT_POLL_STATE_CDMA_SUBSCRIPTION: // Handle RIL_CDMA_SUBSCRIPTION - String cdmaSubscription[] = (String[])ar.result; - - if (cdmaSubscription != null && cdmaSubscription.length >= 4) { - mMdn = cdmaSubscription[0]; - mHomeSystemId = Integer.parseInt(cdmaSubscription[1], 16); - mHomeNetworkId = Integer.parseInt(cdmaSubscription[2], 16); - mMin = cdmaSubscription[3]; - - } else { - Log.w(LOG_TAG, "error parsing cdmaSubscription"); - } - break; - default: Log.e(LOG_TAG, "RIL response handle in wrong phone!" + " Expected CDMA RIL request and get GSM RIL request."); @@ -792,11 +816,6 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { // then count down the responses, which // are allowed to arrive out-of-order - pollingContext[0]++; - // RIL_REQUEST_CDMA_SUBSCRIPTION is necessary for CDMA - cm.getCDMASubscription( - obtainMessage(EVENT_POLL_STATE_CDMA_SUBSCRIPTION, pollingContext)); - pollingContext[0]++; // RIL_REQUEST_OPERATOR is necessary for CDMA cm.getOperator( @@ -1467,4 +1486,9 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { return mMin; } + /** Returns null if NV is not yet ready */ + public String getPrlVersion() { + return mPrlVersion; + } + } diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java index 38a92cd434d9e..7e50cc54d6cf8 100644 --- a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java +++ b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java @@ -37,10 +37,6 @@ import com.android.internal.telephony.IccRecords; import com.android.internal.telephony.IccUtils; import com.android.internal.telephony.PhoneProxy; -import com.android.internal.telephony.TelephonyIntents; -import android.app.ActivityManagerNative; -import android.content.Intent; - /** * {@hide} @@ -67,7 +63,6 @@ public final class RuimRecords extends IccRecords { private static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = 2; private static final int EVENT_GET_DEVICE_IDENTITY_DONE = 4; private static final int EVENT_GET_ICCID_DONE = 5; - private static final int EVENT_NV_READY = 9; private static final int EVENT_GET_CDMA_SUBSCRIPTION_DONE = 10; private static final int EVENT_UPDATE_DONE = 14; private static final int EVENT_GET_SST_DONE = 17; @@ -78,7 +73,7 @@ public final class RuimRecords extends IccRecords { private static final int EVENT_GET_SMS_DONE = 22; private static final int EVENT_RUIM_REFRESH = 31; - private static final int EVENT_OTA_PROVISION_STATUS_CHANGE = 32; + RuimRecords(CDMAPhone p) { super(p); @@ -92,14 +87,12 @@ public final class RuimRecords extends IccRecords { p.mCM.registerForRUIMReady(this, EVENT_RUIM_READY, null); - p.mCM.registerForNVReady(this, EVENT_NV_READY, null); p.mCM.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); // NOTE the EVENT_SMS_ON_RUIM is not registered p.mCM.setOnIccRefresh(this, EVENT_RUIM_REFRESH, null); // Start off by setting empty state onRadioOffOrNotAvailable(); - p.mCM.registerForCdmaOtaProvision(this,EVENT_OTA_PROVISION_STATUS_CHANGE, null); } @@ -108,8 +101,6 @@ public final class RuimRecords extends IccRecords { phone.mCM.unregisterForRUIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unSetOnIccRefresh(this); - phone.mCM.unregisterForNVReady(this); - phone.mCM.unregisterForCdmaOtaProvision(this); } @Override @@ -213,9 +204,7 @@ public final class RuimRecords extends IccRecords { case EVENT_RUIM_READY: onRuimReady(); break; - case EVENT_NV_READY: - onNvReady(); - break; + case EVENT_RADIO_OFF_OR_NOT_AVAILABLE: onRadioOffOrNotAvailable(); break; @@ -232,15 +221,7 @@ public final class RuimRecords extends IccRecords { if (ar.exception != null) { break; } - if (m_ota_commited) { - if (mMyMobileNumber != localTemp[0]) { - Intent intent = new Intent(TelephonyIntents.ACTION_CDMA_OTA_MDN_CHANGED); - intent.putExtra("mdn", localTemp[0]); - Log.d(LOG_TAG,"Broadcasting intent MDN Change in OTA "); - ActivityManagerNative.broadcastStickyIntent(intent, null); - } - m_ota_commited = false; - } + mMyMobileNumber = localTemp[0]; mSid = localTemp[1]; mNid = localTemp[2]; @@ -294,21 +275,6 @@ public final class RuimRecords extends IccRecords { } break; - case EVENT_OTA_PROVISION_STATUS_CHANGE: - m_ota_commited=false; - ar = (AsyncResult)msg.obj; - if (ar.exception == null) { - int[] ints = (int[]) ar.result; - int otaStatus = ints[0]; - if (otaStatus == phone.CDMA_OTA_PROVISION_STATUS_COMMITTED) { - m_ota_commited=true; - phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE)); - } else if (otaStatus == phone.CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED) { - phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE)); - } - } - break; - }}catch (RuntimeException exc) { // I don't want these exceptions to be fatal Log.w(LOG_TAG, "Exception parsing RUIM record", exc); @@ -360,10 +326,6 @@ public final class RuimRecords extends IccRecords { } - private void onNvReady() { - phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE)); - - } private void fetchRuimRecords() { recordsRequested = true;