From fb62e910e67b6878d9ed49b1f2d23f15845d8731 Mon Sep 17 00:00:00 2001 From: Etienne Segonzac Date: Wed, 28 Nov 2012 11:56:35 +0100 Subject: [PATCH] Bug 813900 - Fix black "mozilla" screen freeze. r=vingtetun --- apps/system/js/window_manager.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/system/js/window_manager.js b/apps/system/js/window_manager.js index 9002a6bbf712..2155db4a8ea1 100644 --- a/apps/system/js/window_manager.js +++ b/apps/system/js/window_manager.js @@ -773,16 +773,20 @@ var WindowManager = (function() { } } + function skipFTU() { + // Eventually ask for SIM code, but only when we do not show FTU, + // which already asks for it! + handleInitlogo(); + SimLock.showIfLocked(); + setDisplayedApp(homescreen); + } + // Check if the FTU was executed or not, if not, get a // reference to the app and launch it. function retrieveFTU() { window.asyncStorage.getItem('ftu.enabled', function getItem(launchFTU) { if (launchFTU === false) { - // Eventually ask for SIM code, but only when we do not show FTU, - // which already asks for it! - handleInitlogo(); - SimLock.showIfLocked(); - setDisplayedApp(homescreen); + skipFTU(); return; } document.getElementById('screen').classList.add('ftuStarting'); @@ -792,18 +796,22 @@ var WindowManager = (function() { ftuManifestURL = this.result['ftu.manifestURL']; if (!ftuManifestURL) { dump('FTU manifest cannot be found skipping.\n'); - setDisplayedApp(homescreen); + skipFTU(); return; } ftu = Applications.getByManifestURL(ftuManifestURL); if (!ftu) { dump('Opps, bogus FTU manifest.\n'); - setDisplayedApp(homescreen); + skipFTU(); return; } ftuURL = ftu.origin + ftu.manifest.entry_points['ftu'].launch_path; ftu.launch('ftu'); }; + req.onerror = function() { + dump('Couldn\'t get the ftu manifestURL.\n'); + skipFTU(); + }; }); }