Chrome OS: Fix SIM PIN change logic.
On Chrome OS, the settings UI supports enabling and disabling SIM locking on a cellular modem, and changing the SIM PIN. In the current implementation, all these actions eventually triggers NetworkingPrivateChromeOS::SetCellularSimState, which then calls the org.chromium.flimflam.Device.RequirePIN and org.chromium.flimflam.Device.ChangePIN DBus API exposed by shill. The "Change Pin" action is available after SIM locking is enabled. RequirePIN is called once when SIM locking is enabled. After that, ChangePIN should be used to change the PIN. However, NetworkingPrivateChromeOS::SetCellularSimState currently handles the "Change Pin" action by first calling RequirePIN first and then ChangePIN upon the success completion of RequirePIN. That results in two successive RequirePIN calls, and the second RequirePIN isn't necessary and often fails as the modem complains about SIM locking is already enabled. This CL changes NetworkingPrivateChromeOS::SetCellularSimState to simply call ChangePIN for the "Change Pin" action. BUG=b:63803092 BUG=chromium:751792 TEST=Manually tested the following with a few cellular modems: Under the expanded view of "Settings > Network > Mobile data": 1. Enable and disable SIM locking: a. Turn on "Enable SIM locking". A SIM PIN dialog is shown and asks for a previously set PIN. b. Enter a wrong PIN. The action fails. c. Enter the correct PIN. The action succeeds. d. Turn off "Enable SIM locking". e. Enter a wrong PIN. The action fails. f. Enter the correct PIN. The action succeeds. 2. Enable SIM locking, change the PIN, and disable SIM locking: a. Turn on "Enable SIM locking". A SIM PIN dialog is shown and asks for a previously set PIN. b. Enter the correct PIN. The action succeeds. c. Click "Change Pin". A SIM PIN dialog is shown and asks for the current PIN, the new PIN and the confirmation of the new PIN. d. Enter a wrong current PIN. The action fails. e. Enter the correct current PIN, but the confirmation of the new PIN not matching the new PIN. The action fails. f. Enter the correct current PIN, the new PIN and the confirmation of the new PIN that matches the new PIN. The action succeeds. g. Turn off "Enable SIM locking". h. Enter the old PIN. The action fails. i. Enter the new PIN. The action succeeds. 3. Enable SIM locking, reboot the system, and enter PIN to unlock the SIM: a. Turn on "Enable SIM locking". A SIM PIN dialog is shown and asks for a previously set PIN. b. Enter the correct PIN. The action succeeds. c. Reboot the system. d. A "SIM card is locked" message is shown under "Mobile data". e. Click "Unlock". A SIM PIN dialog is shown and asks for a PIN. f. Enter a wrong PIN. The action fails. g. Enter the correct PIN. The action succeeds. h. The cellular connection can be established after the SIM is unlocked. Change-Id: Ia095c4243ffd777fcfc822a1dcf2b32003257c78 Reviewed-on: https://chromium-review.googlesource.com/595327Reviewed-by:Steven Bennetts <stevenjb@chromium.org> Commit-Queue: Ben Chan <benchan@chromium.org> Cr-Commit-Position: refs/heads/master@{#491842}
Showing
Please register or sign in to comment