Permalink
Browse files

bug 828195 - always listen to card state change

  • Loading branch information...
1 parent fb2f218 commit 19eed10c353c6d65972db0b38db4b1da9ac2f77e @evelynhung evelynhung committed Jan 9, 2013
Showing with 4 additions and 12 deletions.
  1. +0 −2 apps/system/js/airplane_mode.js
  2. +4 −6 apps/system/js/sim_lock.js
  3. +0 −4 apps/system/js/window_manager.js
@@ -129,8 +129,6 @@ var AirplaneMode = {
'geolocation.enabled': true
});
}
-
- SimLock.showIfLocked();
}
});
}
View
@@ -18,6 +18,9 @@ var SimLock = {
// Display the dialog only after lockscreen is unlocked
// To prevent keyboard being displayed behind it.
window.addEventListener('unlock', this);
+
+ // always monitor card state change
+ conn.addEventListener('cardstatechange', this.showIfLocked.bind(this));
},
handleEvent: function sl_handleEvent(evt) {
@@ -70,14 +73,9 @@ var SimLock = {
return false;
switch (conn.cardState) {
- // If the phone is in airplane mode then the state will be 'absent' before
- // going to null.
+ // do nothing in absent and null card states
case null:
case 'absent':
- conn.addEventListener('cardstatechange', function stateChange(e) {
- conn.removeEventListener(e.type, stateChange);
- this.showIfLocked();
- }.bind(this));
break;
case 'pukRequired':
case 'pinRequired':
@@ -842,10 +842,6 @@ var WindowManager = (function() {
document.getElementById('screen').classList.remove('ftuStarting');
handleInitlogo();
setDisplayedApp(homescreen);
- // Eventually ask for SIM code, but only when we do not show FTU,
- // which already asks for it! Note that it has to be done
- // after setDisplayedApp which is going to mess with focus.
- SimLock.showIfLocked();
}
// Check if the FTU was executed or not, if not, get a

0 comments on commit 19eed10

Please sign in to comment.