Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bug 620584 - add ANDROID_PACKAGE_NAME rather than hard code org.mozil…

…la.@MOZ_APP_NAME@ r=ted,blassy a=stuart

--HG--
branch : GECKO20b8_20101214_RELBRANCH
extra : transplant_source : %CD%DD%FC9%9D%F3X%EE%40%E6Z%FB0%7ED%83%AE%5C%AD%A6
  • Loading branch information...
commit 3d196626bf505f248fb0d0fc090cd2500d7e6349 1 parent 1b50860
@michaelwu michaelwu authored
View
2  config/autoconf.mk.in
@@ -705,6 +705,8 @@ ANDROID_SDK = @ANDROID_SDK@
ANDROID_TOOLS = @ANDROID_TOOLS@
ANDROID_VERSION = @ANDROID_VERSION@
+ANDROID_PACKAGE_NAME = @ANDROID_PACKAGE_NAME@
+
JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
# We only want to do the pymake sanity on Windows, other os's can cope
View
4 configure.in
@@ -330,6 +330,9 @@ if test "$target" = "arm-android-eabi" ; then
ANDROID_SDK="${android_sdk}"
ANDROID_TOOLS="${android_tools}"
ANDROID_VERSION="${android_version}"
+ if test -z "$ANDROID_PACKAGE_NAME" ; then
+ ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
+ fi
AC_DEFINE(ANDROID)
AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
@@ -344,6 +347,7 @@ AC_SUBST(ANDROID_TOOLCHAIN)
AC_SUBST(ANDROID_PLATFORM)
AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_TOOLS)
+AC_SUBST(ANDROID_PACKAGE_NAME)
dnl ========================================================
dnl Checks for compilers.
View
2  embedding/android/AlertNotification.java
@@ -82,7 +82,7 @@ public void updateProgress(String aAlertText, long aProgress, long aProgressMax)
// Custom view
int layout = aAlertText.length() > 0 ? R.layout.notification_progress_text : R.layout.notification_progress;
- RemoteViews view = new RemoteViews("org.mozilla." + GeckoApp.mAppContext.getAppName(), layout);
+ RemoteViews view = new RemoteViews(GeckoApp.mAppContext.getPackageName(), layout);
view.setImageViewResource(R.id.notificationImage, mIcon);
view.setTextViewText(R.id.notificationTitle, mTitle);
contentView = view;
View
4 embedding/android/AndroidManifest.xml.in
@@ -1,7 +1,7 @@
#filter substitution
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.mozilla.@MOZ_APP_NAME@"
+ package="@ANDROID_PACKAGE_NAME@"
android:installLocation="auto"
android:versionCode="1"
android:versionName="@MOZ_APP_VERSION@"
@@ -76,7 +76,7 @@
<activity android:name="Restarter"
android:theme="@android:style/Theme.Light.NoTitleBar">
<intent-filter>
- <action android:name="org.mozilla.gecko.restart@MOZ_APP_NAME@"
+ <action android:name="org.mozilla.gecko.restart"
android:process="@MOZ_APP_NAME@Restarter"/>
</intent-filter>
</activity>
View
6 embedding/android/App.java.in
@@ -36,13 +36,13 @@
* ***** END LICENSE BLOCK ***** */
#filter substitution
-package org.mozilla.@MOZ_APP_NAME@;
+package @ANDROID_PACKAGE_NAME@;
import org.mozilla.gecko.GeckoApp;
public class App extends GeckoApp {
- public String getAppName() {
- return "@MOZ_APP_NAME@";
+ public String getPackageName() {
+ return "@ANDROID_PACKAGE_NAME@";
}
public String getContentProcessName() {
return "@MOZ_CHILD_PROCESS_NAME@";
View
10 embedding/android/CrashReporter.java.in
@@ -36,7 +36,7 @@
* ***** END LICENSE BLOCK ***** */
#filter substitution
-package org.mozilla.@MOZ_APP_NAME@;
+package @ANDROID_PACKAGE_NAME@;
import android.app.*;
@@ -108,7 +108,7 @@ public class CrashReporter extends Activity
String passedMinidumpPath = getIntent().getStringExtra("minidumpPath");
File passedMinidumpFile = new File(passedMinidumpPath);
File pendingDir =
- new File("/data/data/org.mozilla.@MOZ_APP_NAME@/mozilla/Crash Reports/pending");
+ new File("/data/data/@ANDROID_PACKAGE_NAME@/mozilla/Crash Reports/pending");
pendingDir.mkdirs();
mPendingMinidumpFile = new File(pendingDir, passedMinidumpFile.getName());
moveFile(passedMinidumpFile, mPendingMinidumpFile);
@@ -275,7 +275,7 @@ public class CrashReporter extends Activity
if (conn.getResponseCode() == conn.HTTP_OK) {
File submittedDir = new File(
- "/data/data/org.mozilla.@MOZ_APP_NAME@/mozilla/Crash Reports/submitted");
+ "/data/data/@ANDROID_PACKAGE_NAME@/mozilla/Crash Reports/submitted");
submittedDir.mkdirs();
minidumpFile.delete();
extrasFile.delete();
@@ -298,8 +298,8 @@ public class CrashReporter extends Activity
try {
String action = "android.intent.action.MAIN";
Intent intent = new Intent(action);
- intent.setClassName("org.mozilla.@MOZ_APP_NAME@",
- "org.mozilla.@MOZ_APP_NAME@.App");
+ intent.setClassName("@ANDROID_PACKAGE_NAME@",
+ "@ANDROID_PACKAGE_NAME@.App");
Log.i("GeckoCrashReporter", intent.toString());
startActivity(intent);
} catch (Exception e) {
View
18 embedding/android/GeckoApp.java
@@ -409,7 +409,7 @@ public boolean onKeyLongPress(int keyCode, KeyEvent event) {
return false;
}
- abstract public String getAppName();
+ abstract public String getPackageName();
abstract public String getContentProcessName();
protected void unpackComponents()
@@ -418,7 +418,7 @@ protected void unpackComponents()
ZipFile zip;
InputStream listStream;
- File componentsDir = new File("/data/data/org.mozilla." + getAppName() +
+ File componentsDir = new File("/data/data/" + getPackageName() +
"/components");
componentsDir.mkdir();
zip = new ZipFile(getApplication().getPackageResourcePath());
@@ -451,7 +451,7 @@ private void unpackFile(ZipFile zip, byte[] buf, ZipEntry fileEntry,
throw new FileNotFoundException("Can't find " + name + " in " +
zip.getName());
- File outFile = new File("/data/data/org.mozilla." + getAppName() +
+ File outFile = new File("/data/data/" + getPackageName() +
"/" + name);
if (outFile.exists() &&
outFile.lastModified() == fileEntry.getTime() &&
@@ -493,10 +493,10 @@ public void addEnvToIntent(Intent intent) {
public void doRestart() {
try {
- String action = "org.mozilla.gecko.restart" + getAppName();
+ String action = "org.mozilla.gecko.restart";
Intent intent = new Intent(action);
- intent.setClassName("org.mozilla." + getAppName(),
- "org.mozilla." + getAppName() + ".Restarter");
+ intent.setClassName(getPackageName(),
+ getPackageName() + ".Restarter");
addEnvToIntent(intent);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
@@ -530,7 +530,7 @@ private void checkAndLaunchUpdate() {
Log.i("GeckoAppJava", "Update is available!");
// Launch APK
- File updateFileToRun = new File(updateDir + getAppName() + "-update.apk");
+ File updateFileToRun = new File(updateDir + getPackageName() + "-update.apk");
try {
if (updateFile.renameTo(updateFileToRun)) {
String amCmd = "/system/bin/am start -a android.intent.action.VIEW " +
@@ -612,8 +612,8 @@ protected void onActivityResult(int requestCode, int resultCode,
File.createTempFile("tmp_" +
(int)Math.floor(1000 * Math.random()),
fileExt,
- new File("/data/data/org.mozilla." +
- getAppName()));
+ new File("/data/data/" +
+ getPackageName()));
FileOutputStream fos = new FileOutputStream(file);
InputStream is = cr.openInputStream(uri);
View
10 embedding/android/GeckoAppShell.java
@@ -109,8 +109,8 @@ public static void loadGeckoLibs(String apkName) {
Log.i("GeckoApp", "env"+ c +": "+ env);
}
- File f = new File("/data/data/org.mozilla." +
- GeckoApp.mAppContext.getAppName() +"/tmp");
+ File f = new File("/data/data/" +
+ GeckoApp.mAppContext.getPackageName() + "/tmp");
if (!f.exists())
f.mkdirs();
@@ -366,7 +366,7 @@ static void installWebApplication(String aURI, String aTitle, String aIconData)
// the intent to be launched by the shortcut
Intent shortcutIntent = new Intent("org.mozilla.fennec.WEBAPP");
shortcutIntent.setClassName(GeckoApp.mAppContext,
- "org.mozilla." + GeckoApp.mAppContext.getAppName() + ".App");
+ GeckoApp.mAppContext.getPackageName() + ".App");
shortcutIntent.putExtra("args", "--webapp=" + aURI);
Intent intent = new Intent();
@@ -521,7 +521,7 @@ public static void showAlertNotification(String aImageUrl, String aAlertTitle, S
// The intent to launch when the user clicks the expanded notification
Intent notificationIntent = new Intent(GeckoApp.ACTION_ALERT_CLICK);
notificationIntent.setClassName(GeckoApp.mAppContext,
- "org.mozilla." + GeckoApp.mAppContext.getAppName() + ".NotificationHandler");
+ GeckoApp.mAppContext.getPackageName() + ".NotificationHandler");
// Put the strings into the intent as an URI "alert:<name>#<cookie>"
Uri dataUri = Uri.fromParts("alert", aAlertName, aAlertCookie);
@@ -533,7 +533,7 @@ public static void showAlertNotification(String aImageUrl, String aAlertTitle, S
// The intent to execute when the status entry is deleted by the user with the "Clear All Notifications" button
Intent clearNotificationIntent = new Intent(GeckoApp.ACTION_ALERT_CLEAR);
clearNotificationIntent.setClassName(GeckoApp.mAppContext,
- "org.mozilla." + GeckoApp.mAppContext.getAppName() + ".NotificationHandler");
+ GeckoApp.mAppContext.getPackageName() + ".NotificationHandler");
clearNotificationIntent.setData(dataUri);
PendingIntent pendingClearIntent = PendingIntent.getActivity(GeckoApp.mAppContext, 0, clearNotificationIntent, 0);
View
1  embedding/android/Makefile.in
@@ -66,6 +66,7 @@ MIN_CPU_VERSION=5
endif
DEFINES += \
+ -DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
View
2  embedding/android/NotificationHandler.java.in
@@ -36,7 +36,7 @@
* ***** END LICENSE BLOCK ***** */
#filter substitution
-package org.mozilla.@MOZ_APP_NAME@;
+package @ANDROID_PACKAGE_NAME@;
import android.app.Activity;
import android.app.NotificationManager;
View
4 other-licenses/android/APKOpen.cpp
@@ -439,7 +439,7 @@ static void * mozload(const char * path, void *zip,
if (extractLibs) {
char fullpath[256];
- snprintf(fullpath, 256, "/data/data/org.mozilla.fennec/%s", path + 4);
+ snprintf(fullpath, 256, "/data/data/" ANDROID_PACKAGE_NAME "/%s", path + 4);
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "resolved %s to %s", path, fullpath);
extractFile(fullpath, entry, data);
handle = __wrap_dlopen(fullpath, RTLD_LAZY);
@@ -560,7 +560,7 @@ extern "C" void simple_linker_init(void);
static void
loadLibs(const char *apkName)
{
- chdir("/data/data/org.mozilla.fennec");
+ chdir("/data/data/" ANDROID_PACKAGE_NAME);
simple_linker_init();
View
1  other-licenses/android/Makefile.in
@@ -53,6 +53,7 @@ DEFINES += \
-DMOZ_LINKER \
-DLINKER_TEXT_BASE=0xB0001000 \
-DLINKER_AREA_SIZE=0x01000000 \
+ -DANDROID_PACKAGE_NAME='"$(ANDROID_PACKAGE_NAME)"' \
$(NULL)
CPPSRCS = \
View
1  toolkit/xre/Makefile.in
@@ -135,6 +135,7 @@ endif
ifeq ($(OS_TARGET),Android)
CPPSRCS += nsAndroidStartup.cpp
+DEFINES += -DANDROID_PACKAGE_NAME='"$(ANDROID_PACKAGE_NAME)"'
endif
SHARED_LIBRARY_LIBS += ../profile/src/$(LIB_PREFIX)profile_s.$(LIB_SUFFIX)
View
6 toolkit/xre/nsAndroidStartup.cpp
@@ -94,7 +94,7 @@ GeckoStart(void *data)
nsresult rv;
nsCOMPtr<nsILocalFile> appini;
- rv = NS_NewLocalFile(NS_LITERAL_STRING("/data/data/org.mozilla." MOZ_APP_NAME "/application.ini"),
+ rv = NS_NewLocalFile(NS_LITERAL_STRING("/data/data/" ANDROID_PACKAGE_NAME "/application.ini"),
PR_FALSE,
getter_AddRefs(appini));
if (NS_FAILED(rv)) {
@@ -105,12 +105,12 @@ GeckoStart(void *data)
nsXREAppData *appData;
rv = XRE_CreateAppData(appini, &appData);
if (NS_FAILED(rv)) {
- LOG("Failed to load application.ini from /data/data/org.mozilla." MOZ_APP_NAME "/application.ini\n");
+ LOG("Failed to load application.ini from /data/data/" ANDROID_PACKAGE_NAME "/application.ini\n");
return 0;
}
nsCOMPtr<nsILocalFile> xreDir;
- rv = NS_NewLocalFile(NS_LITERAL_STRING("/data/data/org.mozilla." MOZ_APP_NAME),
+ rv = NS_NewLocalFile(NS_LITERAL_STRING("/data/data/" ANDROID_PACKAGE_NAME),
PR_FALSE,
getter_AddRefs(xreDir));
if (NS_FAILED(rv)) {
View
2  toolkit/xre/nsXREDirProvider.cpp
@@ -1104,7 +1104,7 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsILocalFile** aFile, PRBool aLocal)
#elif defined(ANDROID)
// used for setting the patch to our profile
// XXX: investigate putting the profile somewhere else
- const char* homeDir = "/data/data/org.mozilla." MOZ_APP_NAME;
+ const char* homeDir = "/data/data/" ANDROID_PACKAGE_NAME;
rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), PR_TRUE,
getter_AddRefs(localDir));
Please sign in to comment.
Something went wrong with that request. Please try again.