Skip to content

Commit 6ac0471

Browse files
author
John Wang
committed
Enable restart in getSpnFsm().
If the FSM gets restart while waiting for one of SPN EFs results (i.e. a SIM refresh occurs after issuing read EF_CPHS_SPN), it will re-initialize only after receiving and discarding the unfinished SPN EF result. bug:5499225 Change-Id: I715fc2feabdd03435903f7dcb785c8f0154619bc
1 parent 459e459 commit 6ac0471

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,11 @@ private enum Get_Spn_Fsm_State {
14591459
* After starting, FSM will search SPN EFs in order and stop after finding
14601460
* the first valid SPN
14611461
*
1462+
* If the FSM gets restart while waiting for one of
1463+
* SPN EFs results (i.e. a SIM refresh occurs after issuing
1464+
* read EF_CPHS_SPN), it will re-initialize only after
1465+
* receiving and discarding the unfinished SPN EF result.
1466+
*
14621467
* @param start set true only for initialize loading
14631468
* @param ar the AsyncResult from loadEFTransparent
14641469
* ar.exception holds exception in error
@@ -1468,7 +1473,19 @@ private void getSpnFsm(boolean start, AsyncResult ar) {
14681473
byte[] data;
14691474

14701475
if (start) {
1471-
spnState = Get_Spn_Fsm_State.INIT;
1476+
// Check previous state to see if there is outstanding
1477+
// SPN read
1478+
if(spnState == Get_Spn_Fsm_State.READ_SPN_3GPP ||
1479+
spnState == Get_Spn_Fsm_State.READ_SPN_CPHS ||
1480+
spnState == Get_Spn_Fsm_State.READ_SPN_SHORT_CPHS ||
1481+
spnState == Get_Spn_Fsm_State.INIT) {
1482+
// Set INIT then return so the INIT code
1483+
// will run when the outstanding read done.
1484+
spnState = Get_Spn_Fsm_State.INIT;
1485+
return;
1486+
} else {
1487+
spnState = Get_Spn_Fsm_State.INIT;
1488+
}
14721489
}
14731490

14741491
switch(spnState){

0 commit comments

Comments
 (0)