Merge b2g-inbound to m-c a=merge
authorWes Kocher <wkocher@mozilla.com>
Fri, 15 May 2015 17:29:29 -0700
changeset 244068 f1bb9cfd7661644d4cc188ec7749dd0ad5692150
parent 244042 32976e27159ec042bba96943673ae5e850040d9d (current diff)
parent 244067 66e2cce8d014c8998bbedb3675b7bf4ee8975dfa (diff)
child 244069 36ca5101582f94e5fdfdfad3466523d646a675b1
child 244134 c96edd3211223fa3c46ae15c0e2fa3e4aa523baa
child 244161 a72c3bc040924c2df5fb5da7f8f4f0ac625d6f83
child 244176 029a9d7300f258394d2fbe8d36e55027c6dabc6c
push id28764
push userkwierso@gmail.com
push dateSat, 16 May 2015 00:29:35 +0000
treeherdermozilla-central@f1bb9cfd7661 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone41.0a1
first release with
nightly linux32
f1bb9cfd7661 / 41.0a1 / 20150516030207 / files
nightly linux64
f1bb9cfd7661 / 41.0a1 / 20150516030207 / files
nightly mac
f1bb9cfd7661 / 41.0a1 / 20150516030207 / files
nightly win32
f1bb9cfd7661 / 41.0a1 / 20150516030207 / files
nightly win64
f1bb9cfd7661 / 41.0a1 / 20150516030207 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge b2g-inbound to m-c a=merge
testing/taskcluster/tasks/branches/cypress/job_flags.yml
--- a/b2g/components/AlertsHelper.jsm
+++ b/b2g/components/AlertsHelper.jsm
@@ -227,26 +227,26 @@ let AlertsHelper = {
     try {
       let data = Cu.cloneInto(dataObj, {});
     } catch(e) { dataObj = null; }
 
     return dataObj;
   },
 
   showNotification: function(imageURL, title, text, textClickable, cookie,
-                             uid, bidi, lang, dataObj, manifestURL, timestamp,
+                             uid, dir, lang, dataObj, manifestURL, timestamp,
                              behavior) {
     function send(appName, appIcon) {
       SystemAppProxy._sendCustomEvent(kMozChromeNotificationEvent, {
         type: kDesktopNotification,
         id: uid,
         icon: imageURL,
         title: title,
         text: text,
-        bidi: bidi,
+        dir: dir,
         lang: lang,
         appName: appName,
         appIcon: appIcon,
         manifestURL: manifestURL,
         timestamp: timestamp,
         data: dataObj,
         mozbehavior: behavior
       });
@@ -271,17 +271,17 @@ let AlertsHelper = {
     let currentListener = this._listeners[data.name];
     if (currentListener && currentListener.observer) {
       currentListener.observer.observe(null, kTopicAlertFinished, currentListener.cookie);
     }
 
     let dataObj = this.deserializeStructuredClone(data.dataStr);
     this.registerListener(data.name, data.cookie, data.alertListener);
     this.showNotification(data.imageURL, data.title, data.text,
-                          data.textClickable, data.cookie, data.name, data.bidi,
+                          data.textClickable, data.cookie, data.name, data.dir,
                           data.lang, dataObj, null, data.inPrivateBrowsing);
   },
 
   showAppNotification: function(aMessage) {
     let data = aMessage.data;
     let details = data.details;
     let dataObject = this.deserializeStructuredClone(details.data);
     let listener = {
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="a8ace1361d702eef293e48f2ea525dac686daa86">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="a8ace1361d702eef293e48f2ea525dac686daa86">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="173b3104bfcbd23fc9dccd4b0035fc49aae3d444">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9a9797062c6001d6346504161c51187a2968466b"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8c2d32bccc7061e9ca0165135457c3fd53e7107e"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="4efd19d199ae52656604f794c5a77518400220fd">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="a8ace1361d702eef293e48f2ea525dac686daa86">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="173b3104bfcbd23fc9dccd4b0035fc49aae3d444">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9a9797062c6001d6346504161c51187a2968466b"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8c2d32bccc7061e9ca0165135457c3fd53e7107e"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="a8ace1361d702eef293e48f2ea525dac686daa86">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "27f6760ceb0c8897bd21461e8b91136d7efff2a1", 
+        "git_revision": "84d77c1f3cbe06b91d4a5acac02a6c829e9a7488", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "7fbbf564986896c9cf3a1e8d59b49e3eb6d7f7ef", 
+    "revision": "65b78de3c7968e078018096712a5e14321fe0a14", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="4efd19d199ae52656604f794c5a77518400220fd">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="27f6760ceb0c8897bd21461e8b91136d7efff2a1"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="84d77c1f3cbe06b91d4a5acac02a6c829e9a7488"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0627790166dccd8dd370fa7d9f434ed9fc027fb4"/>
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -628,16 +628,17 @@ static BluetoothInterface* sBtInterface;
 static nsTArray<nsRefPtr<BluetoothProfileController> > sControllerArray;
 static InfallibleTArray<BluetoothNamedValue> sRemoteDevicesPack;
 static nsTArray<int> sRequestedDeviceCountArray;
 static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sSetPropertyRunnableArray;
 static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sGetDeviceRunnableArray;
 static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sBondingRunnableArray;
 static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sUnbondingRunnableArray;
 static bool sAdapterDiscoverable(false);
+static bool sAdapterDiscovering(false);
 static bool sIsRestart(false);
 static bool sIsFirstTimeToggleOffBt(false);
 static uint32_t sAdapterDiscoverableTimeout(0);
 
 /**
  *  Static callback functions
  */
 void
@@ -2485,18 +2486,19 @@ BluetoothServiceBluedroid::AdapterProper
 #endif
 }
 
 /**
  * RemoteDevicePropertiesNotification will be called
  *
  *   (1) automatically by Bluedroid when BT is turning on, or
  *   (2) as result of remote device properties update during discovery, or
- *   (3) as result of GetRemoteDeviceProperties, or
- *   (4) as result of GetRemoteServices.
+ *   (3) as result of CreateBond, or
+ *   (4) as result of GetRemoteDeviceProperties, or
+ *   (5) as result of GetRemoteServices.
  */
 void
 BluetoothServiceBluedroid::RemoteDevicePropertiesNotification(
   BluetoothStatus aStatus, const nsAString& aBdAddr,
   int aNumProperties, const BluetoothProperty* aProperties)
 {
 #ifdef MOZ_B2G_BT_API_V2
   MOZ_ASSERT(NS_IsMainThread());
@@ -2660,25 +2662,27 @@ BluetoothServiceBluedroid::RemoteDeviceP
   // BlueDroid wouldn't notify the status of connection, therefore, query the
   // connection state and append to properties array
   BT_APPEND_NAMED_VALUE(props, "Connected", IsConnected(aBdAddr));
 
   if (sRequestedDeviceCountArray.IsEmpty()) {
     /**
      * This is possible when
      *
-     *  (1) the callback is called after Bluetooth is turned on, or
-     *  (2) remote device properties get updated during discovery.
-     *
-     * For (2), fire 'devicefound' again to update device name.
-     * See bug 1076553 for more information.
+     *  (1) the callback is called when BT is turning on, or
+     *  (2) remote device properties get updated during discovery, or
+     *  (3) as result of CreateBond
      */
-    DistributeSignal(BluetoothSignal(NS_LITERAL_STRING("DeviceFound"),
-                                     NS_LITERAL_STRING(KEY_ADAPTER),
-                                     BluetoothValue(props)));
+    if (sAdapterDiscovering) {
+      // Fire 'devicefound' again to update device name for (2).
+      // See bug 1076553 for more information.
+      DistributeSignal(BluetoothSignal(NS_LITERAL_STRING("DeviceFound"),
+                                       NS_LITERAL_STRING(KEY_ADAPTER),
+                                       BluetoothValue(props)));
+    }
     return;
   }
 
   // Use address as the index
   sRemoteDevicesPack.AppendElement(
     BluetoothNamedValue(nsString(aBdAddr), props));
 
   if (--sRequestedDeviceCountArray[0] == 0) {
@@ -2807,26 +2811,27 @@ BluetoothServiceBluedroid::DiscoveryStat
   // Reply that Promise is resolved
   if (!sChangeDiscoveryRunnableArray.IsEmpty()) {
     DispatchReplySuccess(sChangeDiscoveryRunnableArray[0]);
     sChangeDiscoveryRunnableArray.RemoveElementAt(0);
   }
 #else
   MOZ_ASSERT(NS_IsMainThread());
 
-  bool isDiscovering = (aState == true);
+  sAdapterDiscovering = aState;
 
   DistributeSignal(
     BluetoothSignal(NS_LITERAL_STRING(DISCOVERY_STATE_CHANGED_ID),
-                    NS_LITERAL_STRING(KEY_ADAPTER), isDiscovering));
+                    NS_LITERAL_STRING(KEY_ADAPTER), sAdapterDiscovering));
 
   // Distribute "PropertyChanged" signal to notice adapter this change since
   // Bluedroid don' treat "discovering" as a property of adapter.
   InfallibleTArray<BluetoothNamedValue> props;
-  BT_APPEND_NAMED_VALUE(props, "Discovering", BluetoothValue(isDiscovering));
+  BT_APPEND_NAMED_VALUE(props, "Discovering",
+                        BluetoothValue(sAdapterDiscovering));
   DistributeSignal(BluetoothSignal(NS_LITERAL_STRING("PropertyChanged"),
                                    NS_LITERAL_STRING(KEY_ADAPTER),
                                    BluetoothValue(props)));
 #endif
 }
 
 void
 BluetoothServiceBluedroid::PinRequestNotification(const nsAString& aRemoteBdAddr,
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ -222,17 +222,16 @@ BluetoothHfpManager::Cleanup()
   mSignal = 0;
 
   mController = nullptr;
 }
 
 void
 BluetoothHfpManager::Reset()
 {
-  mFirstCKPD = false;
   // Phone & Device CIND
   ResetCallArray();
   // Clear Sco state
   mAudioState = HFP_AUDIO_STATE_DISCONNECTED;
   Cleanup();
 }
 
 bool
@@ -1310,18 +1309,16 @@ BluetoothHfpManager::Disconnect(Bluetoot
                                      new DisconnectResultHandler(this));
 }
 
 void
 BluetoothHfpManager::OnConnect(const nsAString& aErrorStr)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  mFirstCKPD = true;
-
   /**
    * On the one hand, notify the controller that we've done for outbound
    * connections. On the other hand, we do nothing for inbound connections.
    */
   NS_ENSURE_TRUE_VOID(mController);
 
   mController->NotifyCompletion(aErrorStr);
   mController = nullptr;
@@ -1653,38 +1650,27 @@ BluetoothHfpManager::KeyPressedNotificat
     NotifyDialer(NS_LITERAL_STRING("ATA"));
   } else if (hasActiveCall) {
     if (!IsScoConnected()) {
       /*
        * Bluetooth HSP spec 4.3
        * If there's no SCO, set up a SCO link.
        */
       ConnectSco();
-    } else if (mFirstCKPD) {
-      /*
-       * Bluetooth HSP spec 4.2 & 4.3
-       * The SCO link connection may be set up prior to receiving the AT+CKPD=200
-       * command from the HS.
-       *
-       * Once FxOS initiates a SCO connection before receiving the
-       * AT+CKPD=200, we should ignore this key press.
-       */
-     } else {
+    } else {
       /*
        * Bluetooth HSP spec 4.5
        * There are two ways to release SCO: sending CHUP to dialer or closing
        * SCO socket directly. We notify dialer only if there is at least one
        * active call.
        */
       NotifyDialer(NS_LITERAL_STRING("CHUP"));
     }
-    mFirstCKPD = false;
   } else {
     // BLDN
-    mDialingRequestProcessed = false;
 
     NotifyDialer(NS_LITERAL_STRING("BLDN"));
 
     MessageLoop::current()->PostDelayedTask(FROM_HERE,
                                             new RespondToBLDNTask(),
                                             sWaitingForDialingInterval);
   }
 }
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h
@@ -206,18 +206,18 @@ private:
   int mBattChg;
   BluetoothHandsfreeNetworkState mService;
   BluetoothHandsfreeServiceType mRoam;
   int mSignal;
 
   int mCurrentVgs;
   int mCurrentVgm;
   bool mReceiveVgsFlag;
+  // This flag is for HFP only, not for HSP.
   bool mDialingRequestProcessed;
-  bool mFirstCKPD;
   PhoneType mPhoneType;
   nsString mDeviceAddress;
   nsString mMsisdn;
   nsString mOperatorName;
 
   nsTArray<Call> mCurrentCallArray;
   nsAutoPtr<BluetoothRilListener> mListener;
   nsRefPtr<BluetoothProfileController> mController;
--- a/dom/interfaces/notification/nsINotificationStorage.idl
+++ b/dom/interfaces/notification/nsINotificationStorage.idl
@@ -36,17 +36,17 @@ interface nsINotificationStorageCallback
    */
   [implicit_jscontext]
   void done();
 };
 
 /**
  * Interface for notification persistence layer.
  */
-[scriptable, uuid(f5145be6-e34b-468b-84da-c8c4c1ad60fe)]
+[scriptable, uuid(cac01fb0-c2eb-4252-b2f4-5b1fac933bd4)]
 interface nsINotificationStorage : nsISupports
 {
 
   /**
    * Add/replace a notification to the persistence layer.
    *
    * @param origin: the origin/app of this notification
    * @param id: a uuid for this notification
@@ -89,13 +89,27 @@ interface nsINotificationStorage : nsISu
   /**
    * Remove a notification from storage.
    *
    * @param origin: the origin/app to delete the notification from
    * @param id: the uuid for the notification to delete
    */
   void delete(in DOMString origin,
               in DOMString id);
+
+  /**
+   * Notifications are not supposed to be persistent, according to spec, at
+   * least for now. But we want to be able to have this behavior on B2G. Thus,
+   * this method will check if the origin sending the notifications is a valid
+   * registered app with a manifest or not. Hence, a webpage that has none
+   * will have its notification sent and available (via Notification.get())
+   * during the life time of the page.
+   *
+   * @param origin: Origin from which the notification is sent.
+   *
+   * @return boolean
+   */
+  boolean canPut(in DOMString origin);
 };
 
 %{C++
 #define NS_NOTIFICATION_STORAGE_CONTRACTID "@mozilla.org/notificationStorage;1"
 %}
--- a/dom/mobileconnection/tests/marionette/test_mobile_preferred_network_type.js
+++ b/dom/mobileconnection/tests/marionette/test_mobile_preferred_network_type.js
@@ -32,16 +32,19 @@ const TEST_DATA = [
     preferredNetworkType: "lte/wcdma/gsm",
     expectedErrorMessage: "ModeNotSupported"
   }, {
     preferredNetworkType: "lte/wcdma/gsm/cdma/evdo",
     expectedErrorMessage: "ModeNotSupported"
   }, {
     preferredNetworkType: "lte",
     expectedErrorMessage: "ModeNotSupported"
+  }, {
+    preferredNetworkType: "lte/wcdma",
+    expectedErrorMessage: "ModeNotSupported"
   },
   // Test passing an invalid mode. We expect to get an exception here.
   {
     preferredNetworkType: "InvalidTypes",
     expectGotException: true
   }, {
     preferredNetworkType: null,
     expectGotException: true
--- a/dom/notification/NotificationDB.jsm
+++ b/dom/notification/NotificationDB.jsm
@@ -19,16 +19,20 @@ Cu.import("resource://gre/modules/Promis
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
                                    "@mozilla.org/parentprocessmessagemanager;1",
                                    "nsIMessageListenerManager");
 
+XPCOMUtils.defineLazyServiceGetter(this, "notificationStorage",
+                                   "@mozilla.org/notificationStorage;1",
+                                   "nsINotificationStorage");
+
 const NOTIFICATION_STORE_DIR = OS.Constants.Path.profileDir;
 const NOTIFICATION_STORE_PATH =
         OS.Path.join(NOTIFICATION_STORE_DIR, "notificationstore.json");
 
 const kMessages = [
   "Notification:Save",
   "Notification:Delete",
   "Notification:GetAll",
@@ -72,36 +76,52 @@ let NotificationDB = {
     if (DEBUG) debug("Topic: " + aTopic);
     if (aTopic == "xpcom-shutdown") {
       this._shutdownInProgress = true;
       Services.obs.removeObserver(this, "xpcom-shutdown");
       this.unregisterListeners();
     }
   },
 
+  filterNonAppNotifications: function(notifications) {
+    let origins = Object.keys(notifications);
+    for (let origin of origins) {
+      let canPut = notificationStorage.canPut(origin);
+      if (!canPut) {
+        if (DEBUG) debug("Origin " + origin + " is not linked to an app manifest, deleting.");
+	delete notifications[origin];
+      }
+    }
+    return notifications;
+  },
+
   // Attempt to read notification file, if it's not there we will create it.
   load: function() {
     var promise = OS.File.read(NOTIFICATION_STORE_PATH, { encoding: "utf-8"});
     return promise.then(
       function onSuccess(data) {
         if (data.length > 0) {
-          this.notifications = JSON.parse(data);
+	  // Preprocessing phase intends to cleanly separate any migration-related
+          // tasks.
+	  this.notifications = this.filterNonAppNotifications(JSON.parse(data));
         }
+
         // populate the list of notifications by tag
         if (this.notifications) {
           for (var origin in this.notifications) {
             this.byTag[origin] = {};
             for (var id in this.notifications[origin]) {
               var curNotification = this.notifications[origin][id];
               if (curNotification.tag) {
                 this.byTag[origin][curNotification.tag] = curNotification;
               }
             }
           }
         }
+
         this.loaded = true;
       }.bind(this),
 
       // If read failed, we assume we have no notifications to load.
       function onFailure(reason) {
         this.loaded = true;
         return this.createStore();
       }.bind(this)
--- a/dom/notification/NotificationStorage.js
+++ b/dom/notification/NotificationStorage.js
@@ -18,16 +18,20 @@ const NOTIFICATIONSTORAGE_CONTRACTID = "
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsIMessageSender");
 
+XPCOMUtils.defineLazyServiceGetter(this, "appsService",
+                                   "@mozilla.org/AppsService;1",
+                                   "nsIAppsService");
+
 const kMessageNotificationGetAllOk = "Notification:GetAll:Return:OK";
 const kMessageNotificationGetAllKo = "Notification:GetAll:Return:KO";
 const kMessageNotificationSaveKo   = "Notification:Save:Return:KO";
 const kMessageNotificationDeleteKo = "Notification:Delete:Return:KO";
 
 const kMessages = [
   kMessageNotificationGetAllOk,
   kMessageNotificationGetAllKo,
@@ -40,16 +44,17 @@ function NotificationStorage() {
   this._notifications = {};
   this._byTag = {};
   this._cached = false;
 
   this._requests = {};
   this._requestCount = 0;
 
   Services.obs.addObserver(this, "xpcom-shutdown", false);
+
   // Register for message listeners.
   this.registerListeners();
 }
 
 NotificationStorage.prototype = {
 
   registerListeners: function() {
     for (let message of kMessages) {
@@ -60,22 +65,29 @@ NotificationStorage.prototype = {
   unregisterListeners: function() {
     for (let message of kMessages) {
       cpmm.removeMessageListener(message, this);
     }
   },
 
   observe: function(aSubject, aTopic, aData) {
     if (DEBUG) debug("Topic: " + aTopic);
-    if (aTopic == "xpcom-shutdown") {
+    if (aTopic === "xpcom-shutdown") {
       Services.obs.removeObserver(this, "xpcom-shutdown");
       this.unregisterListeners();
     }
   },
 
+  canPut: function(aOrigin) {
+    if (DEBUG) debug("Querying appService for: " + aOrigin);
+    let rv = !!appsService.getAppByManifestURL(aOrigin);
+    if (DEBUG) debug("appService returned: " + rv);
+    return rv;
+  },
+
   put: function(origin, id, title, dir, lang, body, tag, icon, alertName,
                 data, behavior) {
     if (DEBUG) { debug("PUT: " + id + ": " + title); }
     var notification = {
       id: id,
       title: title,
       dir: dir,
       lang: lang,
@@ -100,20 +112,22 @@ NotificationStorage.prototype = {
       if (this._byTag[origin][tag]) {
         var oldNotification = this._byTag[origin][tag];
         delete this._notifications[oldNotification.id];
       }
 
       this._byTag[origin][tag] = notification;
     };
 
-    cpmm.sendAsyncMessage("Notification:Save", {
-      origin: origin,
-      notification: notification
-    });
+    if (this.canPut(origin)) {
+      cpmm.sendAsyncMessage("Notification:Save", {
+        origin: origin,
+        notification: notification
+      });
+    }
   },
 
   get: function(origin, tag, callback) {
     if (DEBUG) { debug("GET: " + origin + " " + tag); }
     if (this._cached) {
       this._fetchFromCache(origin, tag, callback);
     } else {
       this._fetchFromDB(origin, tag, callback);
--- a/dom/secureelement/DOMSecureElement.js
+++ b/dom/secureelement/DOMSecureElement.js
@@ -94,45 +94,58 @@ let PromiseHelpers;
 function SEReaderImpl() {}
 
 SEReaderImpl.prototype = {
   _window: null,
 
   _sessions: [],
 
   type: null,
+  _isSEPresent: false,
 
   classID: Components.ID("{1c7bdba3-cd35-4f8b-a546-55b3232457d5}"),
   contractID: "@mozilla.org/secureelement/reader;1",
   QueryInterface: XPCOMUtils.generateQI([]),
 
   // Chrome-only function
   onSessionClose: function onSessionClose(sessionCtx) {
     let index = this._sessions.indexOf(sessionCtx);
     if (index != -1) {
       this._sessions.splice(index, 1);
     }
   },
 
-  initialize: function initialize(win, type) {
+  initialize: function initialize(win, type, isPresent) {
     this._window = win;
     this.type = type;
+    this._isSEPresent = isPresent;
+  },
+
+  _checkPresence: function _checkPresence() {
+    if (!this._isSEPresent) {
+      throw new Error(SE.ERROR_NOTPRESENT);
+    }
   },
 
   openSession: function openSession() {
+    this._checkPresence();
+
     return PromiseHelpers.createSEPromise((resolverId) => {
-      let chromeObj = new SESessionImpl();
-      chromeObj.initialize(this._window, this);
-      let contentObj = this._window.SESession._create(this._window, chromeObj);
-      this._sessions.push(contentObj);
-      PromiseHelpers.takePromiseResolver(resolverId).resolve(contentObj);
+      let sessionImpl = new SESessionImpl();
+      sessionImpl.initialize(this._window, this);
+      this._window.SESession._create(this._window, sessionImpl);
+      this._sessions.push(sessionImpl);
+      PromiseHelpers.takePromiseResolver(resolverId)
+                    .resolve(sessionImpl.__DOM_IMPL__);
     });
   },
 
   closeAll: function closeAll() {
+    this._checkPresence();
+
     return PromiseHelpers.createSEPromise((resolverId) => {
       let promises = [];
       for (let session of this._sessions) {
         if (!session.isClosed) {
           promises.push(session.closeAll());
         }
       }
 
@@ -143,20 +156,34 @@ SEReaderImpl.prototype = {
         resolver.resolve();
       }, (reason) => {
         resolver.reject(new Error(SE.ERROR_BADSTATE +
           " Unable to close all channels associated with this reader"));
       });
     });
   },
 
+  updateSEPresence: function updateSEPresence(isSEPresent) {
+    if (!isSEPresent) {
+      this.invalidate();
+      return;
+    }
+
+    this._isSEPresent = isSEPresent;
+  },
+
+  invalidate: function invalidate() {
+    debug("Invalidating SE reader: " + this.type);
+    this._isSEPresent = false;
+    this._sessions.forEach(s => s.invalidate());
+    this._sessions = [];
+  },
+
   get isSEPresent() {
-    // TODO: Bug 1119152 - Implement new idl with interfaces to detect
-    //                     secureelement state changes.
-    return true;
+    return this._isSEPresent;
   }
 };
 
 /**
  * Instance of 'SESessionImpl' object represent a connection session
  * to one of the secure elements available on the device.
  * These objects can be used to get a communication channel with an application
  * hosted by the Secure Element.
@@ -249,27 +276,29 @@ SESessionImpl.prototype = {
         resolver.resolve();
       }, (reason) => {
         resolver.reject(new Error(SE.ERROR_BADSTATE +
           " Unable to close all channels associated with this session"));
       });
     });
   },
 
+  invalidate: function invlidate() {
+    this._isClosed = true;
+    this._channels.forEach(ch => ch.invalidate());
+    this._channels = [];
+  },
+
   get reader() {
     return this._reader.__DOM_IMPL__;
   },
 
   get isClosed() {
     return this._isClosed;
   },
-
-  set isClosed(isClosed) {
-    this._isClosed = isClosed;
-  }
 };
 
 /**
  * Instance of 'SEChannelImpl' object represent an ISO/IEC 7816-4 specification
  * channel opened to a secure element. It can be either a logical channel
  * or basic channel.
  */
 function SEChannelImpl() {}
@@ -382,27 +411,27 @@ SEChannelImpl.prototype = {
       cpmm.sendAsyncMessage("SE:CloseChannel", {
         resolverId: resolverId,
         channelToken: this._channelToken,
         appId: this._window.document.nodePrincipal.appId
       });
     }, this);
   },
 
+  invalidate: function invalidate() {
+    this._isClosed = true;
+  },
+
   get session() {
     return this._session.__DOM_IMPL__;
   },
 
   get isClosed() {
     return this._isClosed;
   },
-
-  set isClosed(isClosed) {
-    this._isClosed = isClosed;
-  }
 };
 
 function SEResponseImpl() {}
 
 SEResponseImpl.prototype = {
   sw1: 0x00,
 
   sw2: 0x00,
@@ -442,122 +471,133 @@ SEManagerImpl.prototype = {
   classID: Components.ID("{4a8b6ec0-4674-11e4-916c-0800200c9a66}"),
   contractID: "@mozilla.org/secureelement/manager;1",
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsIDOMGlobalPropertyInitializer,
     Ci.nsISupportsWeakReference,
     Ci.nsIObserver
   ]),
 
+  _readers: [],
+
   init: function init(win) {
     this._window = win;
     PromiseHelpers = new PromiseHelpersSubclass(this._window);
 
     // Add the messages to be listened to.
     const messages = ["SE:GetSEReadersResolved",
                       "SE:OpenChannelResolved",
                       "SE:CloseChannelResolved",
                       "SE:TransmitAPDUResolved",
                       "SE:GetSEReadersRejected",
                       "SE:OpenChannelRejected",
                       "SE:CloseChannelRejected",
-                      "SE:TransmitAPDURejected"];
+                      "SE:TransmitAPDURejected",
+                      "SE:ReaderPresenceChanged"];
 
     this.initDOMRequestHelper(win, messages);
   },
 
   // This function will be called from DOMRequestIPCHelper.
   uninit: function uninit() {
     // All requests that are still pending need to be invalidated
     // because the context is no longer valid.
     this.forEachPromiseResolver((k) => {
       this.takePromiseResolver(k).reject("Window Context got destroyed!");
     });
     PromiseHelpers = null;
     this._window = null;
   },
 
   getSEReaders: function getSEReaders() {
+    // invalidate previous readers on new request
+    if (this._readers.length) {
+      this._readers.forEach(r => r.invalidate());
+      this._readers = [];
+    }
+
     return PromiseHelpers.createSEPromise((resolverId) => {
-      /**
-       * @params for 'SE:GetSEReaders'
-       *
-       * resolverId  : Id that identifies this IPC request.
-       * appId       : Current appId obtained from 'Principal' obj
-       */
       cpmm.sendAsyncMessage("SE:GetSEReaders", {
         resolverId: resolverId,
         appId: this._window.document.nodePrincipal.appId
       });
     });
   },
 
   receiveMessage: function receiveMessage(message) {
+    DEBUG && debug("Message received: " + JSON.stringify(message));
+
     let result = message.data.result;
-    let chromeObj = null;
-    let contentObj = null;
     let resolver = null;
     let context = null;
 
     let promiseResolver = PromiseHelpers.takePromise(result.resolverId);
     if (promiseResolver) {
       resolver = promiseResolver.resolver;
       // This 'context' is the instance that originated this IPC message.
       context = promiseResolver.context;
     }
 
-    debug("receiveMessage(): " + message.name);
     switch (message.name) {
       case "SE:GetSEReadersResolved":
         let readers = new this._window.Array();
-        for (let i = 0; i < result.readerTypes.length; i++) {
-          chromeObj = new SEReaderImpl();
-          chromeObj.initialize(this._window, result.readerTypes[i]);
-          contentObj = this._window.SEReader._create(this._window, chromeObj);
-          readers.push(contentObj);
-        }
+        result.readers.forEach(reader => {
+          let readerImpl = new SEReaderImpl();
+          readerImpl.initialize(this._window, reader.type, reader.isPresent);
+          this._window.SEReader._create(this._window, readerImpl);
+
+          this._readers.push(readerImpl);
+          readers.push(readerImpl.__DOM_IMPL__);
+        });
         resolver.resolve(readers);
         break;
       case "SE:OpenChannelResolved":
-        chromeObj = new SEChannelImpl();
-        chromeObj.initialize(this._window,
-                             result.channelToken,
-                             result.isBasicChannel,
-                             result.openResponse,
-                             context);
-        contentObj = this._window.SEChannel._create(this._window, chromeObj);
+        let channelImpl = new SEChannelImpl();
+        channelImpl.initialize(this._window,
+                               result.channelToken,
+                               result.isBasicChannel,
+                               result.openResponse,
+                               context);
+        this._window.SEChannel._create(this._window, channelImpl);
         if (context) {
           // Notify context's handler with SEChannel instance
-          context.onChannelOpen(contentObj);
+          context.onChannelOpen(channelImpl);
         }
-        resolver.resolve(contentObj);
+        resolver.resolve(channelImpl.__DOM_IMPL__);
         break;
       case "SE:TransmitAPDUResolved":
-        chromeObj = new SEResponseImpl();
-        chromeObj.initialize(result.sw1,
-                             result.sw2,
-                             result.response,
-                             context);
-        contentObj = this._window.SEResponse._create(this._window, chromeObj);
-        resolver.resolve(contentObj);
+        let responseImpl = new SEResponseImpl();
+        responseImpl.initialize(result.sw1,
+                                result.sw2,
+                                result.response,
+                                context);
+        this._window.SEResponse._create(this._window, responseImpl);
+        resolver.resolve(responseImpl.__DOM_IMPL__);
         break;
       case "SE:CloseChannelResolved":
         if (context) {
           // Notify context's onClose handler
           context.onClose();
         }
         resolver.resolve();
         break;
       case "SE:GetSEReadersRejected":
       case "SE:OpenChannelRejected":
       case "SE:CloseChannelRejected":
       case "SE:TransmitAPDURejected":
         let error = result.error || SE.ERROR_GENERIC;
         resolver.reject(error);
         break;
+      case "SE:ReaderPresenceChanged":
+        debug("Reader " + result.type + " present: " + result.isPresent);
+        let reader = this._readers.find(r => r.type === result.type);
+        if (reader) {
+          reader.updateSEPresence(result.isPresent);
+        }
+        break;
       default:
         debug("Could not find a handler for " + message.name);
         resolver.reject();
         break;
     }
   }
 };
 
--- a/dom/secureelement/gonk/SecureElement.js
+++ b/dom/secureelement/gonk/SecureElement.js
@@ -86,39 +86,37 @@ function getConnector(type) {
  * relationship between given application and its opened channels.
  */
 XPCOMUtils.defineLazyGetter(this, "gMap", function() {
   return {
     // example structure of AppInfoMap
     // {
     //   "appId1": {
     //     target: target1,
-    //     readerType: ["uicc", "eSE"],
     //     channels: {
     //       "channelToken1": {
     //         seType: "uicc",
     //         aid: "aid1",
     //         channelNumber: 1
     //       },
     //       "channelToken2": { ... }
     //     }
     //   },
     //  "appId2": { ... }
     // }
     appInfoMap: {},
 
-    registerSecureElementTarget: function(appId, readerTypes, target) {
+    registerSecureElementTarget: function(appId, target) {
       if (this.isAppIdRegistered(appId)) {
         debug("AppId: " + appId + "already registered");
         return;
       }
 
       this.appInfoMap[appId] = {
         target: target,
-        readerTypes: readerTypes,
         channels: {}
       };
 
       debug("Registered a new SE target " + appId);
     },
 
     unregisterSecureElementTarget: function(target) {
       let appId = Object.keys(this.appInfoMap).find((id) => {
@@ -176,46 +174,61 @@ XPCOMUtils.defineLazyGetter(this, "gMap"
 
       if (!appId) {
         return [];
       }
 
       return Object.keys(this.appInfoMap[appId].channels)
                    .map(token => this.appInfoMap[appId].channels[token]);
     },
+
+    getTargets: function() {
+      return Object.keys(this.appInfoMap)
+                   .map(appId => this.appInfoMap[appId].target);
+    },
   };
 });
 
 /**
  * 'SecureElementManager' is the main object that handles IPC messages from
  * child process. It interacts with other objects such as 'gMap' & 'Connector
  * instances (UiccConnector, eSEConnector)' to perform various
- * SE-related (open,close,transmit) operations.
+ * SE-related (open, close, transmit) operations.
+ * @TODO: Bug 1118097 Support slot based SE/reader names
+ * @TODO: Bug 1118101 Introduce SE type specific permissions
  */
 function SecureElementManager() {
   this._registerMessageListeners();
+  this._registerSEListeners();
   Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
 }
 
 SecureElementManager.prototype = {
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsIMessageListener,
+    Ci.nsISEListener,
     Ci.nsIObserver]),
   classID: SECUREELEMENTMANAGER_CID,
   classInfo: XPCOMUtils.generateCI({
     classID:          SECUREELEMENTMANAGER_CID,
     classDescription: "SecureElementManager",
     interfaces:       [Ci.nsIMessageListener,
+                       Ci.nsISEListener,
                        Ci.nsIObserver]
   }),
 
+  // Stores information about supported SE types and their presence.
+  // key: secure element type, value: (Boolean) is present/accessible
+  _sePresence: {},
+
   _shutdown: function() {
     this.secureelement = null;
     Services.obs.removeObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
     this._unregisterMessageListeners();
+    this._unregisterSEListeners();
   },
 
   _registerMessageListeners: function() {
     ppmm.addMessageListener("child-process-shutdown", this);
     for (let msgname of SE_IPC_SECUREELEMENT_MSG_NAMES) {
       ppmm.addMessageListener(msgname, this);
     }
   },
@@ -223,29 +236,46 @@ SecureElementManager.prototype = {
   _unregisterMessageListeners: function() {
     ppmm.removeMessageListener("child-process-shutdown", this);
     for (let msgname of SE_IPC_SECUREELEMENT_MSG_NAMES) {
       ppmm.removeMessageListener(msgname, this);
     }
     ppmm = null;
   },
 
-  _getAvailableReaderTypes: function() {
-    let readerTypes = [];
-    // TODO 1: Bug 1118096 - Add IDL so that other sub-systems such as RIL ,
-    // NFC can implement it.
-    // TODO 2: Bug 1118097 - According to OpenMobile spec, the reader names
-    // should support slot based naming convention.
-    // i;e; Instead of returning 'uicc', return 'uicc<slot#>'.
-
-    if (UiccConnector) {
-      readerTypes.push(SE.TYPE_UICC);
+  _registerSEListeners: function() {
+    let connector = getConnector(SE.TYPE_UICC);
+    if (!connector) {
+      return;
     }
 
-    return readerTypes;
+    this._sePresence[SE.TYPE_UICC] = false;
+    connector.registerListener(this);
+  },
+
+  _unregisterSEListeners: function() {
+    Object.keys(this._sePresence).forEach((type) => {
+      let connector = getConnector(type);
+      if (connector) {
+        connector.unregisterListener(this);
+      }
+    });
+
+    this._sePresence = {};
+  },
+
+  notifySEPresenceChanged: function(type, isPresent) {
+    // we need to notify all targets, even those without open channels,
+    // app could've stored the reader without actually using it
+    debug("notifying DOM about SE state change");
+    this._sePresence[type] = isPresent;
+    gMap.getTargets().forEach(target => {
+      let result = { type: type, isPresent: isPresent };
+      target.sendAsyncMessage("SE:ReaderPresenceChanged", { result: result });
+    });
   },
 
   _canOpenChannel: function(appId, type) {
     let opened = gMap.getChannelCountByAppIdType(appId, type);
     let limit = SE.MAX_CHANNELS_ALLOWED_PER_SESSION;
     // UICC basic channel is not accessible see comment in se_consts.js
     limit = type === SE.TYPE_UICC ? limit - 1 : limit;
     return opened < limit;
@@ -352,21 +382,21 @@ SecureElementManager.prototype = {
         debug("Failed to close channel with token: " + msg.channelToken +
               ", reason: "+ reason);
         callback({ error: SE.ERROR_BADSTATE, reason: reason });
       }
     });
   },
 
   _handleGetSEReadersRequest: function(msg, target, callback) {
-    // TODO: Bug 1118101 Get supported readerTypes based on the permissions
-    // available for the given application.
-    let seReaderTypes = this._getAvailableReaderTypes();
-    gMap.registerSecureElementTarget(msg.appId, seReaderTypes, target);
-    callback({ readerTypes: seReaderTypes, error: SE.ERROR_NONE });
+    gMap.registerSecureElementTarget(msg.appId, target);
+    let readers = Object.keys(this._sePresence).map(type => {
+      return { type: type, isPresent: this._sePresence[type] };
+    });
+    callback({ readers: readers, error: SE.ERROR_NONE });
   },
 
   _handleChildProcessShutdown: function(target) {
     let channels = gMap.getChannelsByTarget(target);
 
     let createCb = (seType, channelNumber) => {
       return {
         notifyCloseChannelSuccess: () => {
--- a/dom/secureelement/gonk/UiccConnector.js
+++ b/dom/secureelement/gonk/UiccConnector.js
@@ -15,17 +15,17 @@
 
 /* Copyright © 2014, Deutsche Telekom, Inc. */
 
 "use strict";
 
 /* globals Components, XPCOMUtils, SE, dump, libcutils, Services,
    iccProvider, iccService, SEUtils */
 
-const { interfaces: Ci, utils: Cu } = Components;
+const { interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/systemlibs.js");
 
 XPCOMUtils.defineLazyGetter(this, "SE", function() {
   let obj = {};
   Cu.import("resource://gre/modules/se_consts.js", obj);
@@ -68,27 +68,29 @@ const PREFERRED_UICC_CLIENTID =
  * 'UiccConnector' object is a wrapper over iccProvider's channel management
  * related interfaces that implements nsISecureElementConnector interface.
  */
 function UiccConnector() {
   this._init();
 }
 
 UiccConnector.prototype = {
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsISecureElementConnector]),
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsISecureElementConnector,
+                                         Ci.nsIIccListener]),
   classID: UICCCONNECTOR_CID,
   classInfo: XPCOMUtils.generateCI({
     classID: UICCCONNECTOR_CID,
     contractID: UICCCONNECTOR_CONTRACTID,
     classDescription: "UiccConnector",
     interfaces: [Ci.nsISecureElementConnector,
                  Ci.nsIIccListener,
                  Ci.nsIObserver]
   }),
 
+  _SEListeners: [],
   _isPresent: false,
 
   _init: function() {
     Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
     let icc = iccService.getIccByServiceId(PREFERRED_UICC_CLIENTID);
     icc.registerListener(this);
 
     // Update the state in order to avoid race condition.
@@ -108,18 +110,28 @@ UiccConnector.prototype = {
       Ci.nsIIcc.CARD_STATE_UNKNOWN,
       Ci.nsIIcc.CARD_STATE_ILLEGAL,
       Ci.nsIIcc.CARD_STATE_PERSONALIZATION_IN_PROGRESS,
       Ci.nsIIcc.CARD_STATE_PERMANENT_BLOCKED,
       Ci.nsIIcc.CARD_STATE_UNDETECTED
     ];
 
     let cardState = iccService.getIccByServiceId(PREFERRED_UICC_CLIENTID).cardState;
-    this._isPresent = cardState !== null &&
+    let uiccPresent = cardState !== null &&
                       uiccNotReadyStates.indexOf(cardState) == -1;
+
+    if (this._isPresent === uiccPresent) {
+      return;
+    }
+
+    debug("Uicc presence changed " + this._isPresent + " -> " + uiccPresent);
+    this._isPresent = uiccPresent;
+    this._SEListeners.forEach((listener) => {
+      listener.notifySEPresenceChanged(SE.TYPE_UICC, this._isPresent);
+    });
   },
 
   // See GP Spec, 11.1.4 Class Byte Coding
   _setChannelToCLAByte: function(cla, channel) {
     if (channel < SE.LOGICAL_CHANNEL_NUMBER_LIMIT) {
       // b7 = 0 indicates the first interindustry class byte coding
       cla = (cla & 0x9C) & 0xFF | channel;
     } else if (channel < SE.SUPPLEMENTARY_LOGICAL_CHANNEL_NUMBER_LIMIT) {
@@ -300,26 +312,44 @@ UiccConnector.prototype = {
               ", Rejected with Reason : " + reason);
         if (callback) {
           callback.notifyError(reason);
         }
       }
     });
   },
 
+  registerListener: function(listener) {
+    if (this._SEListeners.indexOf(listener) !== -1) {
+      throw Cr.NS_ERROR_UNEXPECTED;
+    }
+
+    this._SEListeners.push(listener);
+    // immediately notify listener about the current state
+    listener.notifySEPresenceChanged(SE.TYPE_UICC, this._isPresent);
+  },
+
+  unregisterListener: function(listener) {
+    let idx = this._SEListeners.indexOf(listener);
+    if (idx !== -1) {
+      this._listeners.splice(idx, 1);
+    }
+  },
+
   /**
    * nsIIccListener interface methods.
    */
   notifyStkCommand: function() {},
 
   notifyStkSessionEnd: function() {},
 
   notifyIccInfoChanged: function() {},
 
   notifyCardStateChanged: function() {
+    debug("Card state changed, updating UICC presence.");
     this._updatePresenceState();
   },
 
   /**
    * nsIObserver interface methods.
    */
 
   observe: function(subject, topic, data) {
--- a/dom/secureelement/gonk/nsISecureElementConnector.idl
+++ b/dom/secureelement/gonk/nsISecureElementConnector.idl
@@ -41,17 +41,23 @@ interface nsISEChannelCallback : nsISupp
    * Callback function to notify error
    *
    * @param error
    *        Error describing the reason for failure.
    */
   void notifyError(in DOMString error);
 };
 
-[scriptable, uuid(88e23684-0de3-4792-83a0-0eb67a6ca448)]
+[scriptable, uuid(417f59ee-f582-45b9-9a4e-e9dcefecb4f7)]
+interface nsISEListener : nsISupports
+{
+  void notifySEPresenceChanged(in DOMString seType, in boolean isPresent);
+};
+
+[scriptable, uuid(3cef313a-1d01-432d-9cd2-6610a80911f3)]
 interface nsISecureElementConnector : nsISupports
 {
    /**
     * Open a logical communication channel with the specific secure element type
     *
     * @param aid
     *        Application Identifier of the Card Applet on the secure element.
     * @param callback
@@ -96,9 +102,23 @@ interface nsISecureElementConnector : ns
     *
     * @param channel
     *        Channel to be closed.
     * @param callback
     *        callback to notify the result of the operation.
     */
    void closeChannel(in long channel,
                      in nsISEChannelCallback callback);
+
+   /**
+    * Register a Secure Element listener
+    *
+    * @param listener
+    */
+   void registerListener(in nsISEListener listener);
+
+   /**
+    * Unregister a Secure Element listener
+    *
+    * @param listener
+    */
+   void unregisterListener(in nsISEListener listener);
 };
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -395,31 +395,33 @@ this.GECKO_PREFERRED_NETWORK_TYPE_GSM_ON
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY = "wcdma";
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_AUTO = "wcdma/gsm-auto";
 this.GECKO_PREFERRED_NETWORK_TYPE_CDMA_EVDO = "cdma/evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_CDMA_ONLY = "cdma";
 this.GECKO_PREFERRED_NETWORK_TYPE_EVDO_ONLY = "evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_CDMA_EVDO = "wcdma/gsm/cdma/evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO = "lte/cdma/evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM = "lte/wcdma/gsm";
+this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA = "lte/wcdma";
 this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO = "lte/wcdma/gsm/cdma/evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY = "lte";
 this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM,
   GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_AUTO,
   GECKO_PREFERRED_NETWORK_TYPE_CDMA_EVDO,
   GECKO_PREFERRED_NETWORK_TYPE_CDMA_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_EVDO_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_CDMA_EVDO,
   GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO,
   GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM,
   GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO,
-  GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY
+  GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY,
+  GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA
 ];
 
 this.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT = "gsm,wcdma";
 // Index-item pair must be in sync with nsIMobileConnection.MOBILE_NETWORK_TYPE_*
 this.GECKO_SUPPORTED_NETWORK_TYPES = [
   "gsm",
   "wcdma",
   "cdma",
--- a/dom/tests/mochitest/notification/NotificationTest.js
+++ b/dom/tests/mochitest/notification/NotificationTest.js
@@ -39,16 +39,29 @@ var NotificationTest = (function () {
         }
       } catch (e) {
         ok(false, "Test threw exception!");
         finishTest();
       }
     })(tests);
   }
 
+  function fakeApp(aManifest) {
+    var aApp = {
+      "origin": "{mochitest}",
+      "manifestURL": aManifest
+    };
+
+    SpecialPowers.injectApp("{mochitest}", aApp);
+  }
+
+  function unfakeApp() {
+    SpecialPowers.rejectApp("{mochitest}");
+  }
+
   var fakeCustomData = (function () {
     var buffer = new ArrayBuffer(2);
     var dv = new DataView(buffer).setInt16(0, 42, true);
     var canvas = document.createElement("canvas");
     canvas.width = canvas.height = 100;
     var context = canvas.getContext("2d");
 
     var map = new Map();
@@ -102,16 +115,20 @@ var NotificationTest = (function () {
         detail: {
           title: title
         }
       }));
     },
 
     info: info,
 
+    fakeApp: fakeApp,
+
+    unfakeApp: unfakeApp,
+
     customDataMatches: function(dataObj) {
       var url = "http://www.domain.com";
       try {
         return (JSON.stringify(dataObj.primitives) ===
                 JSON.stringify(fakeCustomData.primitives)) &&
                (dataObj.date.toDateString() ===
                 fakeCustomData.date.toDateString()) &&
                (dataObj.regexp.exec(url)[0].substr(7) === "www") &&
--- a/dom/tests/mochitest/notification/mochitest.ini
+++ b/dom/tests/mochitest/notification/mochitest.ini
@@ -5,8 +5,11 @@ support-files =
   NotificationTest.js
 
 [test_notification_basics.html]
 [test_notification_storage.html]
 skip-if = toolkit == 'android' || toolkit == 'gonk' #bug 960762
 [test_bug931307.html]
 skip-if = (toolkit == 'gonk' && debug) #debug-only timeout
 [test_notification_resend.html]
+skip-if = e10s # On e10s, faking the app seems to be failing
+[test_notification_noresend.html]
+skip-if = (toolkit == 'gonk') # Mochitest on Gonk registers an app manifest that messes with the logic
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/notification/test_notification_noresend.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Testing mozResendAllNotifications() resend behavior for Pages</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="MockServices.js"></script>
+  <script type="text/javascript" src="NotificationTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1159128">Bug 1159128</a>
+<p id="display"></p>
+<div id="content" style="display: none"></div>
+<pre id="test"></pre>
+<script type="text/javascript">
+  var info = NotificationTest.info;
+  var notifications = [];
+
+  SimpleTest.requestFlakyTimeout("untriaged");
+
+  var steps = [
+    function (done) {
+      if (window.Notification) {
+        SpecialPowers.pushPrefEnv({"set": [
+          ["dom.ignore_webidl_scope_checks", true],
+          ]}, done);
+      } else {
+        ok(true, "Notifications are not enabled on the platform.");
+        done();
+      }
+    },
+
+    function (done) {
+      info("Test that we have mozChromeNotifications API");
+      ok(('mozChromeNotifications' in navigator), "should have mozChromeNotifications API");
+      ok(('mozResendAllNotifications' in navigator.mozChromeNotifications), "should have mozResendAllNotifications()");
+      done();
+    },
+
+    function (done) {
+      info("Making sure we have no previous notification pending");
+      var promise = Notification.get();
+      promise.then(function (notifications) {
+        is(notifications.length, 0, "notifications are all cleaned");
+        done();
+      });
+    },
+
+    // The notification is expected to be created and living properly
+    // so it will be accessible via Notification.get(), but NotificationStorage
+    // should not have sent it to NotificationDB.
+    function (done) {
+      info("Sending one notification");
+      var notif = new Notification("title");
+      ok(notif, "Notification object is valid");
+      notifications.push(notif);
+
+      var promise = Notification.get();
+      promise.then(function (notifications) {
+        is(notifications.length, 1, "one notification has been sent");
+        done();
+      });
+    },
+
+    // mozResendAllNotifications will poke directly NotificationDB, so we
+    // expect our notification to NOT have been put there and thus not being
+    // resent.
+    function (done) {
+      info("Trying to resend the notification");
+      var notif = notifications.pop();
+      notif.onclose = function() {
+        done();
+      };
+
+      navigator.mozChromeNotifications.mozResendAllNotifications(function(number) {
+        is(number, 0, "No notification resent");
+        notif.close();
+      });
+    }
+  ];
+
+  MockServices.register();
+  NotificationTest.run(steps, function () {
+    MockServices.unregister();
+  });
+</script>
+</body>
+</html>
--- a/dom/tests/mochitest/notification/test_notification_resend.html
+++ b/dom/tests/mochitest/notification/test_notification_resend.html
@@ -1,12 +1,12 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-  <title>Testing mozResendAllNotifications() resend behavior</title>
+  <title>Testing mozResendAllNotifications() resend behavior for Apps</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="MockServices.js"></script>
   <script type="text/javascript" src="NotificationTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=967475">Bug 967475</a>
 <p id="display"></p>
@@ -17,41 +17,42 @@
   var now = new Date().getTime();
   var notifications = [];
   var manifestURL;
 
   SimpleTest.requestFlakyTimeout("untriaged");
 
   var steps = [
     function (done) {
-      if (window.Notification) {
-        SpecialPowers.pushPrefEnv({"set": [
-          ["dom.ignore_webidl_scope_checks", true],
-          ]}, done);
-      } else {
-        ok(true, "Notifications are not enabled on the platform.");
-        done();
-      }
-    },
-
-    function (done) {
       info("Set manifestURL");
       var request = window.navigator.mozApps.getSelf();
       request.onsuccess = function() {
         if (request.result) {
           manifestURL = request.result.manifestURL;
         } else {
           manifestURL = window.location.origin;
         }
         info("Value of manifestURL is: " + manifestURL);
         done();
       };
     },
 
     function (done) {
+      if (window.Notification) {
+        NotificationTest.fakeApp(manifestURL);
+        SpecialPowers.pushPrefEnv({"set": [
+          ["dom.ignore_webidl_scope_checks", true],
+          ]}, done);
+      } else {
+        ok(true, "Notifications are not enabled on the platform.");
+        done();
+      }
+    },
+
+    function (done) {
       info("Test that we have mozChromeNotifications API");
       ok(('mozChromeNotifications' in navigator), "should have mozChromeNotifications API");
       ok(('mozResendAllNotifications' in navigator.mozChromeNotifications), "should have mozResendAllNotifications()");
       done();
     },
 
     function (done) {
       info("Making sure we have no previous notification pending");
@@ -189,18 +190,19 @@
         scContainer.initFromBase64(notif.data, 4);
 
         var dataObj = scContainer.deserializeToVariant().SpecialPowers_wrappedObject;
         ok(NotificationTest.customDataMatches(dataObj),
            "Notification data is valid");
 
         notif2.close();
       });
-    }
+    },
   ];
 
   MockServices.register();
   NotificationTest.run(steps, function () {
+    NotificationTest.unfakeApp();
     MockServices.unregister();
   });
 </script>
 </body>
 </html>
--- a/dom/webidl/MozMobileConnection.webidl
+++ b/dom/webidl/MozMobileConnection.webidl
@@ -4,17 +4,17 @@
 
 enum MobileNetworkSelectionMode {"automatic", "manual"};
 enum MobileRadioState {"enabling", "enabled", "disabling", "disabled"};
 enum MobileNetworkType {"gsm", "wcdma", "cdma", "evdo", "lte"};
 enum MobilePreferredNetworkType {"wcdma/gsm", "gsm", "wcdma", "wcdma/gsm-auto",
                                  "cdma/evdo", "cdma", "evdo",
                                  "wcdma/gsm/cdma/evdo", "lte/cdma/evdo",
                                  "lte/wcdma/gsm", "lte/wcdma/gsm/cdma/evdo",
-                                 "lte"};
+                                 "lte", "lte/wcdma"};
 enum MobileRoamingMode {"home", "affiliated", "any"};
 
 [Pref="dom.mobileconnection.enabled"]
 interface MozMobileConnection : EventTarget
 {
   const long ICC_SERVICE_CLASS_VOICE      = 0x01; // (1 << 0)
   const long ICC_SERVICE_CLASS_DATA       = 0x02; // (1 << 1)
   const long ICC_SERVICE_CLASS_FAX        = 0x04; // (1 << 2)
@@ -182,17 +182,17 @@ interface MozMobileConnection : EventTar
    * Query current preferred network type.
    *
    * @return a DOMRequest.
    *
    * If successful, the request's onsuccess will be called. And the request's
    * result will be a string indicating the current preferred network type.
    * The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
    * 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
-   * 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
+   * 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo', 'lte' or 'lte/wcdma'.
    *
    * Otherwise, the request's onerror will be called, and the request's error
    * will be either 'RadioNotAvailable', 'RequestNotSupported',
    * 'IllegalSIMorME', or 'GenericFailure'.
    */
   [Throws, CheckPermissions="mobileconnection"]
   DOMRequest getPreferredNetworkType();
 
--- a/dom/webidl/SecureElement.webidl
+++ b/dom/webidl/SecureElement.webidl
@@ -10,16 +10,17 @@ enum SEType {
 };
 
 enum SEError {
   "SESecurityError",            // Requested operation does not match the access control rules of the application.
   "SEIoError",                  // I/O Error while communicating with the secure element.
   "SEBadStateError",            // Error occuring as a result of bad state.
   "SEInvalidChannelError",      // Opening a channel failed because no channel is available.
   "SEInvalidApplicationError",  // The requested application was not found on the secure element.
+  "SENotPresentError",          // Secure Element is not present
   "SEGenericError"              // Generic failures.
 };
 
 enum SEChannelType {
   "basic",
   "logical"
 };
 
--- a/testing/specialpowers/content/SpecialPowersObserverAPI.js
+++ b/testing/specialpowers/content/SpecialPowersObserverAPI.js
@@ -370,16 +370,43 @@ SpecialPowersObserverAPI.prototype = {
             }
           case "debug-customizations":
             {
               let scope = {};
               Components.utils.import("resource://gre/modules/UserCustomizations.jsm", scope);
               scope.UserCustomizations._debug = aMessage.json.value;
               return;
             }
+          case "inject-app":
+	    {
+              let aAppId = aMessage.json.appId;
+	      let aApp   = aMessage.json.app;
+
+              let keys = Object.keys(Webapps.DOMApplicationRegistry.webapps);
+	      let exists = keys.indexOf(aAppId) !== -1;
+	      if (exists) {
+                return false;
+	      }
+
+              Webapps.DOMApplicationRegistry.webapps[aAppId] = aApp;
+	      return true;
+	    }
+	  case "reject-app":
+	    {
+              let aAppId = aMessage.json.appId;
+
+              let keys = Object.keys(Webapps.DOMApplicationRegistry.webapps);
+	      let exists = keys.indexOf(aAppId) !== -1;
+	      if (!exists) {
+                return false;
+	      }
+
+              delete Webapps.DOMApplicationRegistry.webapps[aAppId];
+	      return true;
+	    }
           default:
             throw new SpecialPowersError("Invalid operation for SPWebAppsService");
         }
         return undefined;	// See comment at the beginning of this function.
       }
 
       case "SPObserverService": {
         switch (aMessage.json.op) {
--- a/testing/specialpowers/content/specialpowersAPI.js
+++ b/testing/specialpowers/content/specialpowersAPI.js
@@ -1130,16 +1130,33 @@ SpecialPowersAPI.prototype = {
   // Restore the launchable property to its default value.
   flushAllAppsLaunchable: function() {
     this._sendSyncMessage("SPWebAppService", {
       op: "set-launchable",
       launchable: false
     });
   },
 
+  // Force-registering an app in the registry
+  injectApp: function(aAppId, aApp) {
+    this._sendSyncMessage("SPWebAppService", {
+      op: "inject-app",
+      appId: aAppId,
+      app: aApp
+    });
+  },
+
+  // Removing app from the registry
+  rejectApp: function(aAppId) {
+    this._sendSyncMessage("SPWebAppService", {
+      op: "reject-app",
+      appId: aAppId
+    });
+  },
+
   _proxiedObservers: {
     "specialpowers-http-notify-request": function(aMessage) {
       let uri = aMessage.json.uri;
       Services.obs.notifyObservers(null, "specialpowers-http-notify-request", uri);
     },
   },
 
   _addObserverProxy: function(notification) {
deleted file mode 100644
--- a/testing/taskcluster/tasks/branches/cypress/job_flags.yml
+++ /dev/null
@@ -1,49 +0,0 @@
----
-# For complete sample of all build and test jobs,
-# see <gecko>/testing/taskcluster/tasks/job_flags.yml
-
-$inherits:
-  from: tasks/branches/mozilla-central/job_flags.yml
-
-builds:
-  flame-kk:
-    platforms:
-      - b2g
-    types:
-      opt:
-        task: tasks/builds/b2g_flame_kk_opt.yml
-  flame-kk-eng:
-    platforms:
-      - b2g
-    types:
-      opt:
-        task: tasks/builds/b2g_flame_kk_eng.yml
-  aries-nightly:
-    platforms:
-      - b2g
-    types:
-      opt:
-        task: tasks/builds/b2g_aries_lightsaber_nightly_opt.yml
-      debug:
-        task: tasks/builds/b2g_aries_lightsaber_nightly_debug.yml
-  aries-eng:
-    platforms:
-      - b2g
-    types:
-      opt:
-        task: tasks/builds/b2g_aries_lightsaber_eng.yml
-
-tests:
-  gaia-build:
-    allowed_build_tasks:
-      tasks/builds/b2g_flame_kk_opt.yml:
-        task: tasks/tests/b2g_build_test.yml
-      tasks/builds/b2g_flame_kk_eng.yml:
-        task: tasks/tests/b2g_build_test.yml
-  gaia-linter:
-    allowed_build_tasks:
-      tasks/builds/b2g_flame_kk_opt.yml:
-        task: tasks/tests/b2g_linter.yml
-      tasks/builds/b2g_flame_kk_eng.yml:
-        task: tasks/tests/b2g_linter.yml
-
--- a/testing/taskcluster/tasks/branches/mozilla-central/job_flags.yml
+++ b/testing/taskcluster/tasks/branches/mozilla-central/job_flags.yml
@@ -47,16 +47,30 @@ builds:
   emulator:
     platfoms:
       - b2g
     types:
       opt:
         task: tasks/builds/b2g_emulator_ics_opt.yml
       debug:
         task: tasks/builds/b2g_emulator_ics_debug.yml
+  aries-nightly:
+    platforms:
+      - b2g
+    types:
+      opt:
+        task: tasks/builds/b2g_aries_lightsaber_nightly_opt.yml
+      debug:
+        task: tasks/builds/b2g_aries_lightsaber_nightly_debug.yml
+  aries-eng:
+    platforms:
+      - b2g
+    types:
+      opt:
+        task: tasks/builds/b2g_aries_lightsaber_eng.yml
 
 tests:
   cppunit:
     allowed_build_tasks:
       tasks/builds/b2g_emulator_ics_opt.yml:
         task: tasks/tests/b2g_emulator_cpp_unit.yml
       tasks/builds/b2g_emulator_ics_debug.yml:
         task: tasks/tests/b2g_emulator_cpp_unit.yml
--- a/testing/taskcluster/tasks/build.yml
+++ b/testing/taskcluster/tasks/build.yml
@@ -20,18 +20,18 @@ task:
   routes:
     - 'index.gecko.v1.{{project}}.revision.linux.{{head_rev}}.{{build_name}}.{{build_type}}'
     - 'index.gecko.v1.{{project}}.latest.linux.{{build_name}}.{{build_type}}'
   scopes:
     # Nearly all of our build tasks use tc-vcs so just include the scope across
     # the board.
     - 'docker-worker:cache:tc-vcs'
     - 'docker-worker:image:{{#docker_image}}builder{{/docker_image}}'
-    - 'queue:define-task:aws-provisioner/build-c4-2xlarge'
-    - 'queue:create-task:aws-provisioner/build-c4-2xlarge'
+    - 'queue:define-task:aws-provisioner-v1/build-c4-2xlarge'
+    - 'queue:create-task:aws-provisioner-v1/build-c4-2xlarge'
 
 
   payload:
     image: '{{#docker_image}}builder{{/docker_image}}'
 
     # Two hours is long but covers edge cases (and matches bb based infra)
     maxRunTime: 7200
 
--- a/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_eng.yml
@@ -20,16 +20,19 @@ task:
       GAIA_OPTIMIZE: '1'
       B2G_SYSTEM_APPS: '1'
     command:
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
         buildbot_step 'Build' ./build-lightsaber.sh $HOME/workspace
   extra:
+    treeherderEnv:
+      - production
+      - staging
     treeherder:
       symbol: Be
       groupSymbol: Aries
       groupName: Aries Device Image
       machine:
         platform: b2g-device-image
     locations:
       img: 'private/build/aries.zip'
--- a/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_nightly_base.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_nightly_base.yml
@@ -13,16 +13,19 @@ task:
       DEBUG: 0
     command:
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
         buildbot_step 'Build' ./build-lightsaber-nightly.sh $HOME/workspace
 
   extra:
+    treeherderEnv:
+      - production
+      - staging
     treeherder:
       symbol: B
       groupSymbol: Aries
       groupName: Aries Device Image
       machine:
         platform: b2g-device-image
     locations:
       img: 'private/build/aries.zip'
--- a/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_nightly_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_nightly_debug.yml
@@ -1,18 +1,21 @@
 $inherits:
   from: 'tasks/builds/b2g_aries_lightsaber_nightly_base.yml'
   variables:
     build_name: 'aries'
-    build_type: 'nightly-debug'
+    build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Aries Nightly (userdebug)'
   scopes:
     - 'docker-worker:cache:build-aries-lightsaber-nightly-debug'
-
+  extra:
+    treeherder:
+      collection:
+        debug: true
   payload:
     cache:
       build-aries-lightsaber-nightly-debug: /home/worker/workspace
     env:
       VARIANT: userdebug
       B2G_DEBUG: 1
 
--- a/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_nightly_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_lightsaber_nightly_opt.yml
@@ -1,13 +1,13 @@
 $inherits:
   from: 'tasks/builds/b2g_aries_lightsaber_nightly_base.yml'
   variables:
     build_name: 'aries'
-    build_type: 'nightly-user'
+    build_type: 'opt'
 task:
   metadata:
     name: '[TC] B2G Aries Nightly (user)'
   scopes:
     - 'docker-worker:cache:build-aries-lightsaber-nightly-user'
 
   payload:
     cache:
--- a/testing/taskcluster/tasks/phone_test.yml
+++ b/testing/taskcluster/tasks/phone_test.yml
@@ -8,17 +8,17 @@ task:
   tags:
     createdForUser: {{owner}}
   workerType: b2gtest
   provisionerId: aws-provisioner-v1
   schedulerId: task-graph-scheduler
 
   scopes:
     - 'docker-worker:image:{{#docker_image}}tester-device{{/docker_image}}'
-    - 'queue:create-task:aws-provisioner/testdroid-device'
+    - 'queue:create-task:aws-provisioner-v1/testdroid-device'
     - 'docker-worker:cache:tc-vcs'
 
   payload:
     image: '{{#docker_image}}tester-device{{/docker_image}}'
     maxRunTime: 3600
     cache:
       tc-vcs: '/home/worker/.tc-vcs'
     env:
--- a/testing/taskcluster/tasks/test.yml
+++ b/testing/taskcluster/tasks/test.yml
@@ -8,18 +8,18 @@ task:
   tags:
     createdForUser: {{owner}}
   workerType: b2gtest
   provisionerId: aws-provisioner-v1
   schedulerId: task-graph-scheduler
 
   scopes:
     - 'docker-worker:image:{{#docker_image}}tester{{/docker_image}}'
-    - 'queue:define-task:aws-provisioner/test-c4-2xlarge'
-    - 'queue:create-task:aws-provisioner/test-c4-2xlarge'
+    - 'queue:define-task:aws-provisioner-v1/test-c4-2xlarge'
+    - 'queue:create-task:aws-provisioner-v1/test-c4-2xlarge'
     - 'docker-worker:cache:tc-vcs'
     - 'docker-worker:cache:linux-cache'
     - 'docker-worker:capability:device:loopbackVideo'
     - 'docker-worker:capability:device:loopbackAudio'
 
   payload:
     capabilities:
       devices: