aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-10-06 14:14:48 -0700
committerWink Saville <wink@google.com>2012-10-06 14:14:48 -0700
commitf860a3f42f87c9c8572623aff33349168d689477 (patch)
tree90b68fcbc43c532c3da3ff9490fe6d117b486760
parentbe3dc4b04cd65e576d250cf68f310d47637167ff (diff)
downloadtelephony-f860a3f42f87c9c8572623aff33349168d689477.tar.gz
Fake sim status changed appropriately
On a VZW GN if we always do ENTER_SIM_PIN the GET_SIM_STATUS comes so quickly that it causes the SIMRecords to return an operator.numeric of 666666 instead of 311480. To fix this we only fake sim status changed when an error occurs on the CHANGE/ENTER SIM_PIN/PIN2. Also, faking on RIL_REQUEST_SET_FACILITY_LOCK on errors so on a VZW GN we automatically go to the main lock screen when the PUK is needed, Finally, on VZN GN RIL_REQUEST_ENTER_SIM_PUK we need to always fake RIL_RESPONSE_UNSOL_SIM_STATUS_CHANGED, otherwise we won't automatically leave the main lock screen when we enter the correct PUK. I also do this for RIL_REQUEST_ENTER_SIM_PUK2 for consistency. Bug: 7255789 Change-Id: I712cc5020970317922f0c3d686c621a6abcd552c
-rw-r--r--src/java/com/android/internal/telephony/RIL.java33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java
index e27c9c660c..faae72a8b4 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -2347,26 +2347,39 @@ public final class RIL extends BaseCommands implements CommandsInterface {
}
}
- // Some devices do not send RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED so fake it.
- // See b/7255789
+ // Here and below fake RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED, see b/7255789.
+ // This is needed otherwise we don't automatically transition to the main lock
+ // screen when the pin or puk is entered incorrectly.
switch (rr.mRequest) {
- case RIL_REQUEST_ENTER_SIM_PIN:
case RIL_REQUEST_ENTER_SIM_PUK:
- case RIL_REQUEST_ENTER_SIM_PIN2:
case RIL_REQUEST_ENTER_SIM_PUK2:
- case RIL_REQUEST_CHANGE_SIM_PIN:
- case RIL_REQUEST_CHANGE_SIM_PIN2:
- if (RILJ_LOGD) {
- riljLog("fakeSimStatusChanged: reg count="
- + mIccStatusChangedRegistrants.size());
- }
if (mIccStatusChangedRegistrants != null) {
+ if (RILJ_LOGD) {
+ riljLog("ON enter sim puk fakeSimStatusChanged: reg count="
+ + mIccStatusChangedRegistrants.size());
+ }
mIccStatusChangedRegistrants.notifyRegistrants();
}
break;
}
if (error != 0) {
+ switch (rr.mRequest) {
+ case RIL_REQUEST_ENTER_SIM_PIN:
+ case RIL_REQUEST_ENTER_SIM_PIN2:
+ case RIL_REQUEST_CHANGE_SIM_PIN:
+ case RIL_REQUEST_CHANGE_SIM_PIN2:
+ case RIL_REQUEST_SET_FACILITY_LOCK:
+ if (mIccStatusChangedRegistrants != null) {
+ if (RILJ_LOGD) {
+ riljLog("ON some errors fakeSimStatusChanged: reg count="
+ + mIccStatusChangedRegistrants.size());
+ }
+ mIccStatusChangedRegistrants.notifyRegistrants();
+ }
+ break;
+ }
+
rr.onError(error, ret);
rr.release();
return;