Merge "When the SIM_READY set current preferred network type." into ics-mr1

This commit is contained in:
Wink Saville
2011-12-07 20:15:45 -08:00
committed by Android (Google) Code Review
5 changed files with 33 additions and 0 deletions

View File

@@ -683,6 +683,13 @@ public abstract class BaseCommands implements CommandsInterface {
mRilConnectedRegistrants.remove(h);
}
/**
* {@inheritDoc}
*/
@Override
public void setCurrentPreferredNetworkType() {
}
//***** Protected Methods
/**
* Store new RadioState and send notification based on the changes

View File

@@ -1310,6 +1310,12 @@ public interface CommandsInterface {
*/
void queryAvailableBandMode (Message response);
/**
* Set the current preferred network type. This will be the last
* networkType that was passed to setPreferredNetworkType.
*/
void setCurrentPreferredNetworkType();
/**
* Requests to set the preferred network type for searching and registering
* (CS/PS domain, RAT, and operation mode)

View File

@@ -1820,6 +1820,16 @@ public final class RIL extends BaseCommands implements CommandsInterface {
send(rr);
}
/**
* {@inheritDoc}
*/
@Override
public void setCurrentPreferredNetworkType() {
if (RILJ_LOGD) riljLog("setCurrentPreferredNetworkType: " + mSetPreferredNetworkType);
setPreferredNetworkType(mSetPreferredNetworkType, null);
}
private int mSetPreferredNetworkType;
/**
* {@inheritDoc}
*/
@@ -1830,6 +1840,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
rr.mp.writeInt(1);
rr.mp.writeInt(networkType);
mSetPreferredNetworkType = networkType;
mPreferredNetworkType = networkType;
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)

View File

@@ -257,6 +257,9 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
break;
case EVENT_RUIM_READY:
// TODO: Consider calling setCurrentPreferredNetworkType as we do in GsmSST.
// cm.setCurrentPreferredNetworkType();
// The RUIM is now ready i.e if it was locked it has been
// unlocked. At this stage, the radio is already powered on.
isSubscriptionFromRuim = true;
@@ -277,6 +280,9 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
break;
case EVENT_NV_READY:
// TODO: Consider calling setCurrentPreferredNetworkType as we do in GsmSST.
// cm.setCurrentPreferredNetworkType();
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

View File

@@ -270,6 +270,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
break;
case EVENT_SIM_READY:
// Set the network type, in case the radio does not restore it.
cm.setCurrentPreferredNetworkType();
// The SIM is now ready i.e if it was locked
// it has been unlocked. At this stage, the radio is already
// powered on.