am 09263e1b: Merge change Id0267cc0 into eclair

Merge commit '09263e1bc0f8f783b24b92643d4ccda87966d01f' into eclair-mr2

* commit '09263e1bc0f8f783b24b92643d4ccda87966d01f':
  Add needsOtaServiceProvisioning and used to not allow
This commit is contained in:
Wink Saville
2009-11-05 19:10:43 -08:00
committed by Android Git Automerger
2 changed files with 28 additions and 2 deletions

View File

@@ -80,6 +80,10 @@ public class CDMAPhone extends PhoneBase {
static final String LOG_TAG = "CDMA";
private static final boolean DBG = true;
// Min values used to by needsActivation
private static final String UNACTIVATED_MIN2_VALUE = "000000";
private static final String UNACTIVATED_MIN_VALUE = "1111110111";
// Default Emergency Callback Mode exit timer
private static final int DEFAULT_ECM_EXIT_TIMER_VALUE = 300000;
@@ -838,6 +842,26 @@ public class CDMAPhone extends PhoneBase {
mRuimRecords.setVoiceMessageWaiting(1, mwi);
}
/**
* Returns true if CDMA OTA Service Provisioning needs to be performed.
*/
/* package */ boolean
needsOtaServiceProvisioning() {
String cdmaMin = getCdmaMin();
boolean needsProvisioning;
if (cdmaMin == null || (cdmaMin.length() < 6)) {
if (DBG) Log.d(LOG_TAG, "needsOtaServiceProvisioning: illegal cdmaMin='"
+ cdmaMin + "' assume provisioning needed.");
needsProvisioning = true;
} else {
needsProvisioning = (cdmaMin.equals(UNACTIVATED_MIN_VALUE)
|| cdmaMin.substring(0,6).equals(UNACTIVATED_MIN2_VALUE))
|| SystemProperties.getBoolean("test_cdma_setup", false);
}
if (DBG) Log.d(LOG_TAG, "needsOtaServiceProvisioning: ret=" + needsProvisioning);
return needsProvisioning;
}
@Override
public void exitEmergencyCallbackMode() {
if (mWakeLock.isHeld()) {

View File

@@ -330,7 +330,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
phone.getState() == Phone.State.IDLE )
&& isDataAllowed()
&& desiredPowerState
&& !mPendingRestartRadio) {
&& !mPendingRestartRadio
&& !mCdmaPhone.needsOtaServiceProvisioning()) {
return setupData(reason);
@@ -348,7 +349,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
" dataOnRoamingEnable=" + getDataOnRoamingEnabled() +
" desiredPowerState=" + desiredPowerState +
" PendingRestartRadio=" + mPendingRestartRadio +
" MasterDataEnabled=" + mMasterDataEnabled);
" MasterDataEnabled=" + mMasterDataEnabled +
" needsOtaServiceProvisioning=" + mCdmaPhone.needsOtaServiceProvisioning());
}
return false;
}