bug 970300 - singly-stringify JSON message; correct apkPackageName property name; r=mfinkle
authorMyk Melez <myk@mozilla.org>
Thu, 13 Mar 2014 12:01:55 -0700
changeset 173441 471e30a53c711b88c86fb8ad3a7bb4d6cfcd7b93
parent 173440 63249d900cfb12cd995ddbbfed0c1ed3b6481496
child 173442 6247f65027932bb4ec3163730288495666ebec65
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmfinkle
bugs970300
milestone30.0a1
bug 970300 - singly-stringify JSON message; correct apkPackageName property name; 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
@@ -110,17 +110,17 @@ public class EventListener implements Ge
                 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")) {
                 JSONObject obj = new JSONObject();
                 obj.put("versions", getApkVersions(GeckoAppShell.getGeckoInterface().getActivity(),
-                                                   message.getJSONArray("packageNames")).toString());
+                                                   message.getJSONArray("packageNames")));
                 EventDispatcher.sendResponse(message, obj);
             }
         } catch (Exception e) {
             Log.e(LOGTAG, "Exception handling message \"" + event + "\":", e);
         }
     }
 
     // Not used by MOZ_ANDROID_SYNTHAPKS.
--- a/mobile/android/modules/WebappManager.jsm
+++ b/mobile/android/modules/WebappManager.jsm
@@ -270,28 +270,28 @@ this.WebappManager = {
     try {
       let installedApps = yield this._getInstalledApps();
       if (installedApps.length === 0) {
         return;
       }
 
       // Map APK names to APK versions.
       let apkNameToVersion = yield this._getAPKVersions(installedApps.map(app =>
-        app.packageName).filter(packageName => !!packageName)
+        app.apkPackageName).filter(apkPackageName => !!apkPackageName)
       );
 
       // Map manifest URLs to APK versions, which is what the service needs
       // in order to tell us which apps are outdated; and also map them to app
       // objects, which the downloader/installer uses to download/install APKs.
       // XXX Will this cause us to update apps without packages, and if so,
       // does that satisfy the legacy migration story?
       let manifestUrlToApkVersion = {};
       let manifestUrlToApp = {};
       for (let app of installedApps) {
-        manifestUrlToApkVersion[app.manifestURL] = apkNameToVersion[app.packageName] || 0;
+        manifestUrlToApkVersion[app.manifestURL] = apkNameToVersion[app.apkPackageName] || 0;
         manifestUrlToApp[app.manifestURL] = app;
       }
 
       let outdatedApps = yield this._getOutdatedApps(manifestUrlToApkVersion, userInitiated);
 
       if (outdatedApps.length === 0) {
         // If the user asked us to check for updates, tell 'em we came up empty.
         if (userInitiated) {