bug 620811 - Crash on restarting fennec r=mwu a=stuart GECKO20b8_20101214_RELBRANCH
authorBrad Lassey <blassey@mozilla.com>
Tue, 21 Dec 2010 20:56:07 -0500
branchGECKO20b8_20101214_RELBRANCH
changeset 59590 b7643182c67d497557c3f65b9eeeab6e5513f712
parent 59568 79b3bdad1799eca8d1643c0159ff13ff836cec43
child 59591 88db8ccdd0de641731b8c007745b7f1d89b16ff8
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersmwu, stuart
bugs620811
milestone2.0b8
bug 620811 - Crash on restarting fennec r=mwu a=stuart
embedding/android/NotificationHandler.java.in
embedding/android/Restarter.java.in
toolkit/crashreporter/Makefile.in
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/embedding/android/NotificationHandler.java.in
+++ b/embedding/android/NotificationHandler.java.in
@@ -89,17 +89,17 @@ public class NotificationHandler
             // The app is not running, just cancel this notification
             NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
             notificationManager.cancel(notificationID);
         }
 
         if (App.ACTION_ALERT_CLICK.equals(action)) {
             // Start or bring to front the main activity
             Intent appIntent = new Intent(Intent.ACTION_MAIN);
-            appIntent.setClassName(this, "org.mozilla.@MOZ_APP_NAME@.App");
+            appIntent.setClassName(this, "@ANDROID_PACKAGE_NAME@.App");
             try {
                 startActivity(appIntent);
             } catch (ActivityNotFoundException e) {
                 Log.e("GeckoAppJava", "NotificationHandler Exception: " + e.getMessage());
             }
         }
     }
 }
--- a/embedding/android/Restarter.java.in
+++ b/embedding/android/Restarter.java.in
@@ -31,17 +31,17 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #filter substitution
-package org.mozilla.@MOZ_APP_NAME@;
+package @ANDROID_PACKAGE_NAME@;
 
 import android.app.*;
 import android.content.*;
 import android.util.*;
 import android.os.*;
 import java.io.*;
 
 public class Restarter extends Activity {
@@ -54,17 +54,17 @@ public class Restarter extends Activity 
             do {
                 stillRunning = false;
                 java.lang.Process p = Runtime.getRuntime().exec("/system/bin/ps");
                 BufferedReader psOut = new BufferedReader(new InputStreamReader(p.getInputStream()));
                 String line;
                 Log.i("Restarter", "pid: " + new Integer(android.os.Process.myPid()).toString());
                 while((line = psOut.readLine()) != null) {
                     Log.i("Restarter", "ps: " + line);
-                    if (line.contains("org.mozilla.@MOZ_APP_NAME@")){
+                    if (line.contains("@ANDROID_PACKAGE_NAME@")){
                         if (!line.contains(new Integer(android.os.Process.myPid()).toString())){
                             Log.i("Restarter", "app still running, wait a bit");
                             stillRunning = true;
                             Thread.sleep(500);
                             break; // don't need to look at the rest
                         } else {
                             Log.i("Restarter", "found ourselves");
                         }
@@ -76,18 +76,18 @@ public class Restarter extends Activity 
                     spinCountdown = 0;
             } while(spinCountdown != 0);
         } catch (Exception e) {
             Log.i("Restarter", e.toString());
         }
         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");
             Bundle b = getIntent().getExtras();
             if (b != null)
                 intent.putExtras(b);
             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             Log.i("GeckoAppJava", intent.toString());
             startActivity(intent);
         } catch (Exception e) {
             Log.i("Restarter", e.toString());
--- a/toolkit/crashreporter/Makefile.in
+++ b/toolkit/crashreporter/Makefile.in
@@ -68,17 +68,17 @@ DIRS += \
 endif
 
 ifeq ($(OS_ARCH),Linux)
 # There's no define for XP_LINUX normally.
 # MOZ_APP_NAME is needed on Android, where we
 # need to launch by package name.
 DEFINES += \
   -DXP_LINUX \
-  -DMOZ_APP_NAME=\"$(MOZ_APP_NAME)\" \
+  -DANDROID_PACKAGE_NAME=\"$(ANDROID_PACKAGE_NAME)\"
   $(NULL)
 DIRS += \
   google-breakpad/src/common \
   google-breakpad/src/common/linux \
   google-breakpad/src/client \
   google-breakpad/src/client/linux/crash_generation \
   google-breakpad/src/client/linux/handler \
   google-breakpad/src/client/linux/minidump_writer \
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -607,20 +607,20 @@ nsresult SetExceptionHandler(nsILocalFil
   crashReporterPath = ToNewUnicode(crashReporterPath_temp);
 #elif !defined(__ANDROID__)
   nsCString crashReporterPath_temp;
   exePath->GetNativePath(crashReporterPath_temp);
 
   crashReporterPath = ToNewCString(crashReporterPath_temp);
 #else
   // On Android, we launch using the application package name
-  // instead of a filename, so use MOZ_APP_NAME to do that here.
+  // instead of a filename, so use ANDROID_PACKAGE_NAME to do that here.
   //TODO: don't hardcode org.mozilla here, so other vendors can
   // ship XUL apps with different package names on Android?
-  nsCString package("org.mozilla." MOZ_APP_NAME "/.CrashReporter");
+  nsCString package(ANDROID_PACKAGE_NAME "/.CrashReporter");
   crashReporterPath = ToNewCString(package);
 #endif
 
   // get temp path to use for minidump path
 #if defined(XP_WIN32)
   nsString tempPath;
 
   // first figure out buffer size