Skip to content

Commit 234a5ef

Browse files
Wink SavilleAndroid (Google) Code Review
authored andcommitted
Merge "When the SIM_READY set current preferred network type." into ics-mr1
2 parents d426c33 + 975d348 commit 234a5ef

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

telephony/java/com/android/internal/telephony/BaseCommands.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,13 @@ public void unregisterForRilConnected(Handler h) {
683683
mRilConnectedRegistrants.remove(h);
684684
}
685685

686+
/**
687+
* {@inheritDoc}
688+
*/
689+
@Override
690+
public void setCurrentPreferredNetworkType() {
691+
}
692+
686693
//***** Protected Methods
687694
/**
688695
* Store new RadioState and send notification based on the changes

telephony/java/com/android/internal/telephony/CommandsInterface.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,12 @@ void setFacilityLockForApp(String facility, boolean lockState, String password,
13101310
*/
13111311
void queryAvailableBandMode (Message response);
13121312

1313+
/**
1314+
* Set the current preferred network type. This will be the last
1315+
* networkType that was passed to setPreferredNetworkType.
1316+
*/
1317+
void setCurrentPreferredNetworkType();
1318+
13131319
/**
13141320
* Requests to set the preferred network type for searching and registering
13151321
* (CS/PS domain, RAT, and operation mode)

telephony/java/com/android/internal/telephony/RIL.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,16 @@ public void handleCallSetupRequestFromSim(
18201820
send(rr);
18211821
}
18221822

1823+
/**
1824+
* {@inheritDoc}
1825+
*/
1826+
@Override
1827+
public void setCurrentPreferredNetworkType() {
1828+
if (RILJ_LOGD) riljLog("setCurrentPreferredNetworkType: " + mSetPreferredNetworkType);
1829+
setPreferredNetworkType(mSetPreferredNetworkType, null);
1830+
}
1831+
private int mSetPreferredNetworkType;
1832+
18231833
/**
18241834
* {@inheritDoc}
18251835
*/
@@ -1830,6 +1840,7 @@ public void setPreferredNetworkType(int networkType , Message response) {
18301840
rr.mp.writeInt(1);
18311841
rr.mp.writeInt(networkType);
18321842

1843+
mSetPreferredNetworkType = networkType;
18331844
mPreferredNetworkType = networkType;
18341845

18351846
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)

telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ public void handleMessage (Message msg) {
257257
break;
258258

259259
case EVENT_RUIM_READY:
260+
// TODO: Consider calling setCurrentPreferredNetworkType as we do in GsmSST.
261+
// cm.setCurrentPreferredNetworkType();
262+
260263
// The RUIM is now ready i.e if it was locked it has been
261264
// unlocked. At this stage, the radio is already powered on.
262265
isSubscriptionFromRuim = true;
@@ -277,6 +280,9 @@ public void handleMessage (Message msg) {
277280
break;
278281

279282
case EVENT_NV_READY:
283+
// TODO: Consider calling setCurrentPreferredNetworkType as we do in GsmSST.
284+
// cm.setCurrentPreferredNetworkType();
285+
280286
isSubscriptionFromRuim = false;
281287
// For Non-RUIM phones, the subscription information is stored in
282288
// Non Volatile. Here when Non-Volatile is ready, we can poll the CDMA

telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ public void handleMessage (Message msg) {
270270
break;
271271

272272
case EVENT_SIM_READY:
273+
// Set the network type, in case the radio does not restore it.
274+
cm.setCurrentPreferredNetworkType();
275+
273276
// The SIM is now ready i.e if it was locked
274277
// it has been unlocked. At this stage, the radio is already
275278
// powered on.

0 commit comments

Comments
 (0)