Bug 958356 - rename packageName to unambiguous name in app objects; r=wesj, fabrice

--HG--
extra : rebase_source : abde2ac924fd8265319f1ffa386f0447518fc46d
This commit is contained in:
Myk Melez 2014-01-22 13:09:47 -08:00
parent 87ea3f0338
commit 461b17725e
5 changed files with 12 additions and 12 deletions

View File

@ -71,7 +71,7 @@ this.AppsUtils = {
installOrigin: aApp.installOrigin,
origin: aApp.origin,
#ifdef MOZ_ANDROID_SYNTHAPKS
packageName: aApp.packageName,
apkPackageName: aApp.apkPackageName,
#endif
receipts: aApp.receipts ? JSON.parse(JSON.stringify(aApp.receipts)) : null,
installTime: aApp.installTime,

View File

@ -643,7 +643,7 @@ public abstract class GeckoApp
mCurrentResponse = GeckoAppShell.preInstallWebApp(name, manifestURL, origin).toString();
} else if (event.equals("WebApps:PostInstall")) {
if (AppConstants.MOZ_ANDROID_SYNTHAPKS) {
GeckoAppShell.postInstallWebApp(message.getString("packageName"), message.getString("origin"));
GeckoAppShell.postInstallWebApp(message.getString("apkPackageName"), message.getString("origin"));
} else {
String name = message.getString("name");
String manifestURL = message.getString("manifestURL");

View File

@ -81,7 +81,7 @@ public class InstallHelper implements GeckoEventListener {
GeckoProfile profile = GeckoProfile.get(mContext, profileName);
try {
message.put("packageName", mApkResources.getPackageName());
message.put("apkPackageName", mApkResources.getPackageName());
message.put("manifestUrl", mApkResources.getManifestUrl());
message.put("title", mApkResources.getAppName());
message.put("manifest", new JSONObject(mApkResources.getManifest(mContext)));

View File

@ -47,7 +47,7 @@ public class UninstallListener extends BroadcastReceiver {
JSONArray packageNames = new JSONArray();
try {
packageNames.put(packageName);
message.put("packages", packageNames);
message.put("apkPackageNames", packageNames);
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Webapps:AutoUninstall", message.toString()));
} catch (JSONException e) {
Log.e(LOGTAG, "JSON EXCEPTION " + e);
@ -84,7 +84,7 @@ public class UninstallListener extends BroadcastReceiver {
for (String packageName : uninstalledPackages) {
packageNames.put(packageName);
}
message.put("packages", packageNames);
message.put("apkPackageNames", packageNames);
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Webapps:AutoUninstall", message.toString()));
} catch (JSONException e) {
Log.e(LOGTAG, "JSON EXCEPTION " + e);

View File

@ -96,7 +96,7 @@ this.WebappManager = {
// aData.app.origin may now point to the app: url that hosts this app.
sendMessageToJava({
type: "WebApps:PostInstall",
packageName: aData.app.packageName,
apkPackageName: aData.app.apkPackageName,
origin: aData.app.origin,
});
@ -148,7 +148,7 @@ this.WebappManager = {
// Thus, we should take the APK as the source of truth.
message.app.manifestURL = aData.manifestUrl;
message.app.manifest = aData.manifest;
message.app.packageName = aData.packageName;
message.app.apkPackageName = aData.apkPackageName;
message.profilePath = aData.profilePath;
message.autoInstall = true;
message.mm = mm;
@ -172,12 +172,12 @@ this.WebappManager = {
dump("autoUninstall sendAsyncMessage " + aMessageName + ": " + JSON.stringify(aData));
}
};
let installedPackages = {};
DOMApplicationRegistry.doGetAll(installedPackages, mm);
let installed = {};
DOMApplicationRegistry.doGetAll(installed, mm);
for (let app in installedPackages.apps) {
if (aData.packages.indexOf(installedPackages.apps[app].packageName) > -1) {
let appToRemove = installedPackages.apps[app];
for (let app in installed.apps) {
if (aData.apkPackageNames.indexOf(installed.apps[app].apkPackageName) > -1) {
let appToRemove = installed.apps[app];
dump("should remove: " + appToRemove.name);
DOMApplicationRegistry.uninstall(appToRemove.manifestURL, function() {
dump(appToRemove.name + " uninstalled");