bug 982182 - fix regressions that hang checking for updates for webapps; r=mfinkle
authorMyk Melez <myk@mozilla.org>
Wed, 12 Mar 2014 11:57:45 -0700
changeset 191431 0a6f7b7dbeec0089f91ba20afba7debad9a572ff
parent 191430 e1e6edb891a44988309a0f3a0694a3630659971b
child 191432 907d5bc3bd26ebb6db9fe95128c275cd94aaa698
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs982182
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 982182 - fix regressions that hang checking for updates for webapps; r=mfinkle
mobile/android/base/webapp/EventListener.java
mobile/android/modules/WebappManager.jsm
--- a/mobile/android/base/webapp/EventListener.java
+++ b/mobile/android/base/webapp/EventListener.java
@@ -107,17 +107,17 @@ public class EventListener implements Ge
             } else if (!AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("Webapps:Preinstall")) {
                 String name = message.getString("name");
                 String manifestURL = message.getString("manifestURL");
                 String origin = message.getString("origin");
 
                 JSONObject obj = new JSONObject();
                 obj.put("profile", preInstallWebapp(name, manifestURL, origin).toString());
                 EventDispatcher.sendResponse(message, obj);
-            } else if (event.equals("WebApps:GetApkVersions")) {
+            } else if (event.equals("Webapps:GetApkVersions")) {
                 JSONObject obj = new JSONObject();
                 obj.put("versions", getApkVersions(GeckoAppShell.getGeckoInterface().getActivity(),
                                                    message.getJSONArray("packageNames")).toString());
                 EventDispatcher.sendResponse(message, obj);
             }
         } catch (Exception e) {
             Log.e(LOGTAG, "Exception handling message \"" + event + "\":", e);
         }
--- a/mobile/android/modules/WebappManager.jsm
+++ b/mobile/android/modules/WebappManager.jsm
@@ -18,36 +18,33 @@ Cu.import("resource://gre/modules/FileUt
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
 Cu.import("resource://gre/modules/Webapps.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/PluralForm.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Notifications", "resource://gre/modules/Notifications.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "sendMessageToJava", "resource://gre/modules/Messaging.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "Strings", function() {
   return Services.strings.createBundle("chrome://browser/locale/webapp.properties");
 });
 
 function debug(aMessage) {
   // We use *dump* instead of Services.console.logStringMessage so the messages
   // have the INFO level of severity instead of the ERROR level.  And we don't
   // append a newline character to the end of the message because *dump* spills
   // into the Android native logging system, which strips newlines from messages
   // and breaks messages into lines automatically at display time (i.e. logcat).
 #ifdef DEBUG
   dump(aMessage);
 #endif
 }
 
-function sendMessageToJava(aMessage) {
-  return Services.androidBridge.handleGeckoMessage(JSON.stringify(aMessage));
-}
-
 this.WebappManager = {
   __proto__: DOMRequestIpcHelper.prototype,
 
   get _testing() {
     try {
       return Services.prefs.getBoolPref("browser.webapps.testing");
     } catch(ex) {
       return false;