{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/28745951","id":28745951,"diff_hunk":"@@ -0,0 +1,108 @@\n+/* global BaseModule */\n+'use strict';\n+\n+(function() {\n+  /**\n+   * This module is responsible to read all boot up related\n+   * configurations and asks other launcher to launch\n+   * at the correct timing by the configurations.\n+   */\n+  var Launcher = function() {};\n+  Launcher.SUB_MODULES = ['Scheduler'];\n+  Launcher.SETTINGS = [\n+    'ftu.manifestURL',\n+    'homescreen.manifestURL',\n+    'deviceinfo.previous_os',\n+    'deviceinfo.os',\n+    'lockscreen.enabled'\n+  ];\n+  Launcher.STATES = [\n+    'justUpgraded'\n+  ];\n+  BaseModule.create(Launcher, {\n+    name: 'Launcher',\n+    DEBUG: false,\n+    _start: function() {\n+      this._version = {};\n+      this.debug('reading configurations...');\n+      return Promise.all([\n+        this.readFtu(),\n+        this.readSetting('homescreen.manifestURL'),\n+        this.readSetting('ftu.manifestURL'),\n+        this.readSetting('deviceinfo.os'),\n+        this.readSetting('deviceinfo.previous_os'),\n+        this.readSetting('lockscreen.enabled')\n+      ]).then(function(results) {\n+        var [ftuEnabled, homescreenManifestURL, ftuManifestURL,\n+             osVersion, previousOsVersion, lockscreenEnabled] = results;\n+        this.lockscreenEnabled = lockscreenEnabled;\n+        this.debug('Ftu enabled = ' + ftuEnabled +\n+          '; ftuManifestURL = ' + ftuManifestURL +\n+          '; osVersion = ' + osVersion +\n+          '; previousOsVersion = ' + previousOsVersion +\n+          '; homescreenManifestURL = ' + homescreenManifestURL +\n+          '; lockscreenEnabled = ' + lockscreenEnabled);\n+        if (this.checkUpgrading(osVersion, previousOsVersion)) {\n+          this.debug('upgrading boot');\n+          this.launchFtuThenHomescreen(ftuManifestURL, homescreenManifestURL);\n+        } else {\n+          if (ftuEnabled !== false && ftuManifestURL) {\n+            this.debug('clean boot');\n+            this.launchFtuThenHomescreen(ftuManifestURL, homescreenManifestURL);\n+          } else {\n+            this.debug('normal boot');\n+            // We still need to tell FtuLauncher to skip to process some tasks.\n+            this.service.request('FtuLauncher:skip');\n+            if (lockscreenEnabled) {\n+              // XXX: We should have a lockscreenLauncher here.\n+              this.service.request('LockScreenLauncher:launch').then(() => {","path":"apps/system/js/launcher.js","position":58,"original_position":58,"commit_id":"fea033a5b6c59a8beefb0b5f8dccdc0c37a9207d","original_commit_id":"fea033a5b6c59a8beefb0b5f8dccdc0c37a9207d","user":{"login":"snowmantw","id":129153,"avatar_url":"https://avatars.githubusercontent.com/u/129153?v=3","gravatar_id":"","url":"https://api.github.com/users/snowmantw","html_url":"https://github.com/snowmantw","followers_url":"https://api.github.com/users/snowmantw/followers","following_url":"https://api.github.com/users/snowmantw/following{/other_user}","gists_url":"https://api.github.com/users/snowmantw/gists{/gist_id}","starred_url":"https://api.github.com/users/snowmantw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowmantw/subscriptions","organizations_url":"https://api.github.com/users/snowmantw/orgs","repos_url":"https://api.github.com/users/snowmantw/repos","events_url":"https://api.github.com/users/snowmantw/events{/privacy}","received_events_url":"https://api.github.com/users/snowmantw/received_events","type":"User","site_admin":false},"body":"Could we wrap L58-L62, and L64-L68 as two functions?","created_at":"2015-04-21T02:29:24Z","updated_at":"2015-04-21T02:29:24Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/29581#discussion_r28745951","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/28745951"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/29581#discussion_r28745951"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581","id":33600185,"html_url":"https://github.com/mozilla-b2g/gaia/pull/29581","diff_url":"https://github.com/mozilla-b2g/gaia/pull/29581.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/29581.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29581","number":29581,"state":"open","locked":false,"title":"Bug 1094759 - new Bootstrap","user":{"login":"alivedise","id":546519,"avatar_url":"https://avatars.githubusercontent.com/u/546519?v=3","gravatar_id":"","url":"https://api.github.com/users/alivedise","html_url":"https://github.com/alivedise","followers_url":"https://api.github.com/users/alivedise/followers","following_url":"https://api.github.com/users/alivedise/following{/other_user}","gists_url":"https://api.github.com/users/alivedise/gists{/gist_id}","starred_url":"https://api.github.com/users/alivedise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alivedise/subscriptions","organizations_url":"https://api.github.com/users/alivedise/orgs","repos_url":"https://api.github.com/users/alivedise/repos","events_url":"https://api.github.com/users/alivedise/events{/privacy}","received_events_url":"https://api.github.com/users/alivedise/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-18T10:34:06Z","updated_at":"2015-04-21T02:29:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d720d4e01b629b72be07f3320cae342d1df3f7d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29581/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/fea033a5b6c59a8beefb0b5f8dccdc0c37a9207d","head":{"label":"alivedise:new-bootstrap-0417","ref":"new-bootstrap-0417","sha":"fea033a5b6c59a8beefb0b5f8dccdc0c37a9207d","user":{"login":"alivedise","id":546519,"avatar_url":"https://avatars.githubusercontent.com/u/546519?v=3","gravatar_id":"","url":"https://api.github.com/users/alivedise","html_url":"https://github.com/alivedise","followers_url":"https://api.github.com/users/alivedise/followers","following_url":"https://api.github.com/users/alivedise/following{/other_user}","gists_url":"https://api.github.com/users/alivedise/gists{/gist_id}","starred_url":"https://api.github.com/users/alivedise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alivedise/subscriptions","organizations_url":"https://api.github.com/users/alivedise/orgs","repos_url":"https://api.github.com/users/alivedise/repos","events_url":"https://api.github.com/users/alivedise/events{/privacy}","received_events_url":"https://api.github.com/users/alivedise/received_events","type":"User","site_admin":false},"repo":{"id":4659245,"name":"gaia","full_name":"alivedise/gaia","owner":{"login":"alivedise","id":546519,"avatar_url":"https://avatars.githubusercontent.com/u/546519?v=3","gravatar_id":"","url":"https://api.github.com/users/alivedise","html_url":"https://github.com/alivedise","followers_url":"https://api.github.com/users/alivedise/followers","following_url":"https://api.github.com/users/alivedise/following{/other_user}","gists_url":"https://api.github.com/users/alivedise/gists{/gist_id}","starred_url":"https://api.github.com/users/alivedise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alivedise/subscriptions","organizations_url":"https://api.github.com/users/alivedise/orgs","repos_url":"https://api.github.com/users/alivedise/repos","events_url":"https://api.github.com/users/alivedise/events{/privacy}","received_events_url":"https://api.github.com/users/alivedise/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alivedise/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project","fork":true,"url":"https://api.github.com/repos/alivedise/gaia","forks_url":"https://api.github.com/repos/alivedise/gaia/forks","keys_url":"https://api.github.com/repos/alivedise/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alivedise/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alivedise/gaia/teams","hooks_url":"https://api.github.com/repos/alivedise/gaia/hooks","issue_events_url":"https://api.github.com/repos/alivedise/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/alivedise/gaia/events","assignees_url":"https://api.github.com/repos/alivedise/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/alivedise/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/alivedise/gaia/tags","blobs_url":"https://api.github.com/repos/alivedise/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alivedise/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alivedise/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/alivedise/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alivedise/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/alivedise/gaia/languages","stargazers_url":"https://api.github.com/repos/alivedise/gaia/stargazers","contributors_url":"https://api.github.com/repos/alivedise/gaia/contributors","subscribers_url":"https://api.github.com/repos/alivedise/gaia/subscribers","subscription_url":"https://api.github.com/repos/alivedise/gaia/subscription","commits_url":"https://api.github.com/repos/alivedise/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/alivedise/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/alivedise/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/alivedise/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/alivedise/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/alivedise/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alivedise/gaia/merges","archive_url":"https://api.github.com/repos/alivedise/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alivedise/gaia/downloads","issues_url":"https://api.github.com/repos/alivedise/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/alivedise/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/alivedise/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/alivedise/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alivedise/gaia/labels{/name}","releases_url":"https://api.github.com/repos/alivedise/gaia/releases{/id}","created_at":"2012-06-14T04:21:54Z","updated_at":"2014-07-09T07:58:30Z","pushed_at":"2015-04-20T09:53:12Z","git_url":"git://github.com/alivedise/gaia.git","ssh_url":"git@github.com:alivedise/gaia.git","clone_url":"https://github.com/alivedise/gaia.git","svn_url":"https://github.com/alivedise/gaia","homepage":"https://wiki.mozilla.org/B2G","size":920453,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"8d2ce4f0b07081119d19e909e7b5317d983b8ae3","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-04-21T02:27:19Z","pushed_at":"2015-04-21T02:28:45Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1519916,"stargazers_count":1907,"watchers_count":1907,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2283,"mirror_url":null,"open_issues_count":961,"forks":2283,"open_issues":961,"watchers":1907,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/29581"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29581"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29581/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29581/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/fea033a5b6c59a8beefb0b5f8dccdc0c37a9207d"}}}}