Permalink
Browse files

Bug 824941 - The PIN code should be asked as soon as we leave Airplan…

…e mode, if the SIM is locked
  • Loading branch information...
1 parent 655b8a8 commit f22d13a73254eae254198411ecf66cb7b3b28b87 @vingtetun vingtetun committed Dec 28, 2012
Showing with 13 additions and 2 deletions.
  1. +3 −1 apps/system/js/airplane_mode.js
  2. +10 −1 apps/system/js/sim_lock.js
@@ -52,7 +52,7 @@ var AirplaneMode = {
// Turn off mobile data
// We toggle the mozSettings value here just for the sake of UI,
- // platform ril dissconnects mobile data when
+ // platform ril disconnects mobile data when
// 'ril.radio.disabled' is true.
if (mobileData) {
restoreMobileData = mobileDataEnabled;
@@ -129,6 +129,8 @@ var AirplaneMode = {
'geolocation.enabled': true
});
}
+
+ SimLock.showIfLocked();
}
});
}
View
@@ -67,9 +67,18 @@ var SimLock = {
return false;
if (LockScreen.locked)
- return;
+ return false;
switch (conn.cardState) {
+ // If the phone is in airplane mode then the state will be 'absent' before
+ // going to null.
+ case null:
+ case 'absent':
+ conn.addEventListener('cardstatechange', function stateChange(e) {
+ conn.removeEventListener(e.type, stateChange);
+ this.showIfLocked();
+ }.bind(this));
+ break;
case 'pukRequired':
case 'pinRequired':
SimPinDialog.show('unlock', this.onClose);

0 comments on commit f22d13a

Please sign in to comment.