diff options
| author | 2020-07-02 02:27:34 +0800 | |
|---|---|---|
| committer | 2023-06-14 14:51:52 +0000 | |
| commit | 13647d752f526ed15f3ad9bf4653e920b4ddd394 (patch) | |
| tree | f2e988a888c8377c51147a716d82acf2ccbbca43 /libs/androidfw/BackupData.cpp | |
| parent | 28227a3e0b7504d6d458c4fec776264a72cec4fe (diff) | |
Fix SystemUI mapping SIM state error issue
KeyguardUpdateMonitor#SimData#simState is updated from telephony
broadcast whose action is Intent#ACTION_SIM_STATE_CHANGED,
but the sim state mapping is inconsistent with telephony design.
Below are the telephony design of broadcast extra(SIM state and reason)
mapping matrix for action Intent#ACTION_SIM_STATE_CHANGED:
1. SIM card state unknown:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_UNKNOWN
b) Intent#EXTRA_SIM_LOCKED_REASON: always null
2. SIM absent:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_ABSENT
b) Intent#EXTRA_SIM_LOCKED_REASON: always null
3. SIM IO error three consecutive times:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_CARD_IO_ERROR
b) Intent#EXTRA_SIM_LOCKED_REASON: Intent#SIM_STATE_CARD_IO_ERROR
4. SIM card is present but not usable due to carrier restrictions:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_CARD_RESTRICTED
b) Intent#EXTRA_SIM_LOCKED_REASON: Intent#SIM_STATE_CARD_RESTRICTED
5. SIM locked:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_LOCKED
b) Intent#EXTRA_SIM_LOCKED_REASON:
- locked on PIN1: Intent#SIM_LOCKED_ON_PIN
- locked on PUK1: Intent#SIM_LOCKED_ON_PUK
- locked on network personalization: Intent#SIM_LOCKED_NETWORK
- permanently disabled due to puk fails:
Intent#SIM_ABSENT_ON_PERM_DISABLED
6. SIM applications are not ready:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_NOT_READY
b) Intent#EXTRA_SIM_LOCKED_REASON: always null
7. SIM IMSI is ready in property, but currently it is never broadcasted:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_IMSI
b) Intent#EXTRA_SIM_LOCKED_REASON: always null
8. SIM all applications are ready:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_READY
b) Intent#EXTRA_SIM_LOCKED_REASON: always null
9. SIM all ICC records, including IMSI, are loaded:
a) Intent#EXTRA_SIM_STATE: Intent#SIM_STATE_LOADED
b) Intent#EXTRA_SIM_LOCKED_REASON: always null
Based on above, this patch fixes below points:
1. Upate KeyguardUpdateMonitor#SimData#fromIntent sim state, which
follows telephony design.
2. Update CarrierTextManager#getStatusForIccState
a) network locked mapping: TelephonyManager#SIM_STATE_NETWORK_LOCKED
to CarrierTextManager#StatusMode#NetworkLocked.
b) adds missed state CarrierTextManager#StatusMode#SimRestricted.
3. Add related automated unit tests to verify code logic
Bug: 265564214
Bug: 265440217
Test: Build and manual test on device.
Test: atest CarrierTextManagerTest KeyguardUpdateMonitorTest
Change-Id: I76eff7a66f2dac6f87072501dc6654e48c105e02
Signed-off-by: Wei Huang <hwbest.v@gmail.com>
Signed-off-by: Honggang Luo <luo.loky@gmail.com>
Signed-off-by: Chao Yuan <chaoyuanx@gmail.com>
Diffstat (limited to 'libs/androidfw/BackupData.cpp')
0 files changed, 0 insertions, 0 deletions