Back out 1d4d44ecd75c and 823cd2815483 (bug 709230) on suspicion of causing intermittent startup crashes
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 30 Jan 2012 16:53:14 -0800
changeset 88600 365277d89057e868cbbd97d611a1dc0d0f8e902c
parent 88599 543a3ea8cbc81949781512cd12f5e105e2d8a96a
child 88601 c3d1e9d47da338983a6a4dd40b5294ad6f74ccdd
push id129
push userffxbld
push dateFri, 20 Apr 2012 19:40:49 +0000
treeherdermozilla-release@5bcfa0da3be9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs709230
milestone12.0a1
backs out1d4d44ecd75c705e3d7049d3248c183eb8161664
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
Back out 1d4d44ecd75c and 823cd2815483 (bug 709230) on suspicion of causing intermittent startup crashes
config/android-common.mk
mobile/android/base/GeckoAppShell.java
mobile/android/base/Makefile.in
mobile/android/config/proguard.cfg
--- a/config/android-common.mk
+++ b/config/android-common.mk
@@ -43,17 +43,16 @@ endif
 
 ifndef JAVA_CLASSPATH
   $(error JAVA_CLASSPATH must be defined before including android-common.mk)
 endif
 
 DX=$(ANDROID_PLATFORM_TOOLS)/dx
 AAPT=$(ANDROID_PLATFORM_TOOLS)/aapt
 APKBUILDER=$(ANDROID_SDK)/../../tools/apkbuilder
-PROGUARD=java -jar $(ANDROID_SDK)/../../tools/proguard/lib/proguard.jar
 ZIPALIGN=$(ANDROID_SDK)/../../tools/zipalign
 
 ifdef JARSIGNER
   APKBUILDER_FLAGS += -u
 endif
 
 # For Android, this defaults to $(ANDROID_SDK)/android.jar
 ifndef JAVA_BOOTCLASSPATH
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -249,17 +249,17 @@ public class GeckoAppShell
                 }
             }
         } catch (Exception e) {
             Log.e(LOGTAG, "exception while stating cache dir: ", e);
         }
         return sFreeSpace;
     }
 
-    private static boolean moveFile(File inFile, File outFile)
+    static boolean moveFile(File inFile, File outFile)
     {
         Log.i(LOGTAG, "moving " + inFile + " to " + outFile);
         if (outFile.isDirectory())
             outFile = new File(outFile, inFile.getName());
         try {
             if (inFile.renameTo(outFile))
                 return true;
         } catch (SecurityException se) {
@@ -288,17 +288,17 @@ public class GeckoAppShell
             } catch (SecurityException se) {
                 Log.w(LOGTAG, "error trying to delete file", se);
             }
             return false;
         }
         return true;
     }
 
-    private static boolean moveDir(File from, File to) {
+    static boolean moveDir(File from, File to) {
         try {
             to.mkdirs();
             if (from.renameTo(to))
                 return true;
         } catch (SecurityException se) {
             Log.w(LOGTAG, "error trying to rename file", se);
         }
         File[] files = from.listFiles();
@@ -508,17 +508,17 @@ public class GeckoAppShell
                 GeckoAppShell.sendEventToGecko(new GeckoEvent(event));
                 return true;
             }
         });
 
         layerController.notifyLayerClientOfGeometryChange();
     }
 
-    public static void sendPendingEventsToGecko() {
+    static void sendPendingEventsToGecko() {
         try {
             while (!gPendingEvents.isEmpty()) {
                 GeckoEvent e = gPendingEvents.removeFirst();
                 notifyGeckoOfEvent(e);
             }
         } catch (NoSuchElementException e) {}
     }
 
@@ -574,18 +574,18 @@ public class GeckoAppShell
 
     // Signal the Java thread that it's time to wake up
     public static void acknowledgeEventSync() {
         CountDownLatch tmp = sGeckoPendingAcks;
         if (tmp != null)
             tmp.countDown();
     }
 
-    private static Sensor gAccelerometerSensor = null;
-    private static Sensor gOrientationSensor = null;
+    static Sensor gAccelerometerSensor = null;
+    static Sensor gOrientationSensor = null;
 
     public static void enableDeviceMotion(boolean enable) {
         LayerView v = GeckoApp.mAppContext.getLayerController().getView();
         SensorManager sm = (SensorManager) v.getContext().getSystemService(Context.SENSOR_SERVICE);
 
         if (gAccelerometerSensor == null || gOrientationSensor == null) {
             gAccelerometerSensor = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
             gOrientationSensor   = sm.getDefaultSensor(Sensor.TYPE_ORIENTATION);
@@ -634,39 +634,37 @@ public class GeckoAppShell
     public static void moveTaskToBack() {
         GeckoApp.mAppContext.moveTaskToBack(true);
     }
 
     public static void returnIMEQueryResult(String result, int selectionStart, int selectionLength) {
         mInputConnection.returnIMEQueryResult(result, selectionStart, selectionLength);
     }
 
-    public static void onXreExit() {
+    static void onXreExit() {
         // mLaunchState can only be Launched or GeckoRunning at this point
         GeckoApp.setLaunchState(GeckoApp.LaunchState.GeckoExiting);
         Log.i(LOGTAG, "XRE exited");
         if (gRestartScheduled) {
             GeckoApp.mAppContext.doRestart();
         } else {
             Log.i(LOGTAG, "we're done, good bye");
             GeckoApp.mAppContext.finish();
         }
 
         Log.w(LOGTAG, "Killing via System.exit()");
         System.exit(0);
     }
-
-    public static void scheduleRestart() {
+    static void scheduleRestart() {
         Log.i(LOGTAG, "scheduling restart");
         gRestartScheduled = true;
     }
 
     // "Installs" an application by creating a shortcut
-    public static void createShortcut(String aTitle, String aURI,
-                                      String aIconData, String aType) {
+    static void createShortcut(String aTitle, String aURI, String aIconData, String aType) {
         byte[] raw = Base64.decode(aIconData.substring(22), Base64.DEFAULT);
         Bitmap bitmap = BitmapFactory.decodeByteArray(raw, 0, raw.length);
         createShortcut(aTitle, aURI, bitmap, aType);
     }
 
     public static void createShortcut(final String aTitle, final String aURI, final Bitmap aIcon, final String aType) {
         getHandler().post(new Runnable() {
             public void run() {
@@ -762,32 +760,32 @@ public class GeckoAppShell
                                        kIconSize/2 + aSource.getWidth()/2,
                                        kIconSize/2 + aSource.getHeight()/2),
                               null);
         }
 
         return bitmap;
     }
 
-    public static String[] getHandlersForMimeType(String aMimeType, String aAction) {
+    static String[] getHandlersForMimeType(String aMimeType, String aAction) {
         Intent intent = getIntentForActionString(aAction);
         if (aMimeType != null && aMimeType.length() > 0)
             intent.setType(aMimeType);
         return getHandlersForIntent(intent);
     }
 
-    public static String[] getHandlersForURL(String aURL, String aAction) {
+    static String[] getHandlersForURL(String aURL, String aAction) {
         // aURL may contain the whole URL or just the protocol
         Uri uri = aURL.indexOf(':') >= 0 ? Uri.parse(aURL) : new Uri.Builder().scheme(aURL).build();
         Intent intent = getIntentForActionString(aAction);
         intent.setData(uri);
         return getHandlersForIntent(intent);
     }
 
-    private static String[] getHandlersForIntent(Intent intent) {
+    static String[] getHandlersForIntent(Intent intent) {
         PackageManager pm = GeckoApp.mAppContext.getPackageManager();
         List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
         int numAttr = 4;
         String[] ret = new String[list.size() * numAttr];
         for (int i = 0; i < list.size(); i++) {
             ResolveInfo resolveInfo = list.get(i);
             ret[i * numAttr] = resolveInfo.loadLabel(pm).toString();
             if (resolveInfo.isDefault)
@@ -795,29 +793,29 @@ public class GeckoAppShell
             else
                 ret[i * numAttr + 1] = "";
             ret[i * numAttr + 2] = resolveInfo.activityInfo.applicationInfo.packageName;
             ret[i * numAttr + 3] = resolveInfo.activityInfo.name;
         }
         return ret;
     }
 
-    private static Intent getIntentForActionString(String aAction) {
+    static Intent getIntentForActionString(String aAction) {
         // Default to the view action if no other action as been specified.
         if (aAction != null && aAction.length() > 0)
             return new Intent(aAction);
         else
             return new Intent(Intent.ACTION_VIEW);
     }
 
-    public static String getExtensionFromMimeType(String aMimeType) {
+    static String getExtensionFromMimeType(String aMimeType) {
         return MimeTypeMap.getSingleton().getExtensionFromMimeType(aMimeType);
     }
 
-    public static String getMimeTypeFromExtensions(String aFileExt) {
+    static String getMimeTypeFromExtensions(String aFileExt) {
         MimeTypeMap mtm = MimeTypeMap.getSingleton();
         StringTokenizer st = new StringTokenizer(aFileExt, "., ");
         String type = null;
         String subType = null;
         while (st.hasMoreElements()) {
             String ext = st.nextToken();
             String mt = mtm.getMimeTypeFromExtension(ext);
             if (mt == null)
@@ -832,18 +830,18 @@ public class GeckoAppShell
         }
         if (type == null)
             type = "*";
         if (subType == null)
             subType = "*";
         return type + "/" + subType;
     }
 
-    public static boolean openUriExternal(String aUriSpec, String aMimeType, String aPackageName,
-                                          String aClassName, String aAction, String aTitle) {
+    static boolean openUriExternal(String aUriSpec, String aMimeType, String aPackageName,
+                                   String aClassName, String aAction, String aTitle) {
         Intent intent = getIntentForActionString(aAction);
         if (aAction.equalsIgnoreCase(Intent.ACTION_SEND)) {
             intent.putExtra(Intent.EXTRA_TEXT, aUriSpec);
             intent.putExtra(Intent.EXTRA_SUBJECT, aTitle);
             if (aMimeType != null && aMimeType.length() > 0)
                 intent.setType(aMimeType);
         } else if (aMimeType.length() > 0) {
             intent.setDataAndType(Uri.parse(aUriSpec), aMimeType);
@@ -884,26 +882,26 @@ public class GeckoAppShell
         try {
             GeckoApp.mAppContext.startActivity(intent);
             return true;
         } catch(ActivityNotFoundException e) {
             return false;
         }
     }
 
-    private static final SynchronousQueue<String> sClipboardQueue =
+    static SynchronousQueue<String> sClipboardQueue =
         new SynchronousQueue<String>();
-    private static final String EMPTY_STRING = new String();
+    private static String EMPTY_STRING = new String();
 
     // On some devices, access to the clipboard service needs to happen
     // on a thread with a looper, so dispatch this to our looper thread
     // Note: the main looper won't work because it may be blocked on the
     // gecko thread, which is most likely this thread
-    public static String getClipboardText() {
-        getHandler().post(new Runnable() {
+    static String getClipboardText() {
+        getHandler().post(new Runnable() { 
             @SuppressWarnings("deprecation")
             public void run() {
                 Context context = GeckoApp.mAppContext;
                 String text = null;
                 if (android.os.Build.VERSION.SDK_INT >= 11) {
                     android.content.ClipboardManager cm = (android.content.ClipboardManager)
                         context.getSystemService(Context.CLIPBOARD_SERVICE);
                     if (cm.hasPrimaryClip()) {
@@ -925,18 +923,18 @@ public class GeckoAppShell
             }});
         try {
             String ret = sClipboardQueue.take();
             return (EMPTY_STRING.equals(ret) ? null : ret);
         } catch (InterruptedException ie) {}
         return null;
     }
 
-    public static void setClipboardText(final String text) {
-        getHandler().post(new Runnable() {
+    static void setClipboardText(final String text) {
+        getHandler().post(new Runnable() { 
             @SuppressWarnings("deprecation")
             public void run() {
                 Context context = GeckoApp.mAppContext;
                 if (android.os.Build.VERSION.SDK_INT >= 11) {
                     android.content.ClipboardManager cm = (android.content.ClipboardManager)
                         context.getSystemService(Context.CLIPBOARD_SERVICE);
                     cm.setPrimaryClip(ClipData.newPlainText("Text", text));
                 } else {
@@ -1233,24 +1231,24 @@ public class GeckoAppShell
                 return true;
             }            
         }
         GeckoPidCallback visitor = new GeckoPidCallback();            
         EnumerateGeckoProcesses(visitor);
         return visitor.otherPidExist;
     }
 
-    private interface GeckoProcessesVisitor{
+    interface GeckoProcessesVisitor{
         boolean callback(int pid);
     }
 
-    private static int sPidColumn = -1;
-    private static int sUserColumn = -1;
+    static int sPidColumn = -1;
+    static int sUserColumn = -1;
+    private static void EnumerateGeckoProcesses(GeckoProcessesVisitor visiter) {
 
-    private static void EnumerateGeckoProcesses(GeckoProcessesVisitor visiter) {
         try {
 
             // run ps and parse its output
             java.lang.Process ps = Runtime.getRuntime().exec("ps");
             BufferedReader in = new BufferedReader(new InputStreamReader(ps.getInputStream()),
                                                    2048);
 
             String headerOutput = in.readLine();
@@ -1410,39 +1408,38 @@ public class GeckoAppShell
             Log.i(LOGTAG, "class not found", cnfe);
         } catch (android.content.pm.PackageManager.NameNotFoundException nnfe) {
             Log.i(LOGTAG, "package not found", nnfe);
         }
         Log.e(LOGTAG, "couldn't find class");
         return null;
     }
 
-    private static native void executeNextRunnable();
+    static native void executeNextRunnable();
 
-    private static class GeckoRunnableCallback implements Runnable {
+    static class GeckoRunnableCallback implements Runnable {
         public void run() {
             Log.i(LOGTAG, "run GeckoRunnableCallback");
             GeckoAppShell.executeNextRunnable();
         }
     }
 
     public static void postToJavaThread(boolean mainThread) {
         Log.i(LOGTAG, "post to " + (mainThread ? "main " : "") + "java thread");
         getMainHandler().post(new GeckoRunnableCallback());
     }
-
-    private static android.hardware.Camera sCamera = null;
-
-    private static native void cameraCallbackBridge(byte[] data);
+    
+    public static android.hardware.Camera sCamera = null;
+    
+    static native void cameraCallbackBridge(byte[] data);
 
-    private static final int kPreferedFps = 25;
-    private static byte[] sCameraBuffer = null;
+    static int kPreferedFps = 25;
+    static byte[] sCameraBuffer = null;
 
-    public static int[] initCamera(String aContentType, int aCamera,
-                                   int aWidth, int aHeight) {
+    static int[] initCamera(String aContentType, int aCamera, int aWidth, int aHeight) {
         Log.i(LOGTAG, "initCamera(" + aContentType + ", " + aWidth + "x" + aHeight + ") on thread " + Thread.currentThread().getId());
 
         getMainHandler().post(new Runnable() {
                 public void run() {
                     try {
                         GeckoApp.mAppContext.enableCameraView();
                     } catch (Exception e) {}
                 }
@@ -1528,34 +1525,34 @@ public class GeckoAppShell
             Log.i(LOGTAG, "Camera preview started");
         } catch(RuntimeException e) {
             Log.e(LOGTAG, "initCamera RuntimeException : ", e);
             result[0] = result[1] = result[2] = result[3] = 0;
         }
         return result;
     }
 
-    public static synchronized void closeCamera() {
+    static synchronized void closeCamera() {
         Log.i(LOGTAG, "closeCamera() on thread " + Thread.currentThread().getId());
         getMainHandler().post(new Runnable() {
                 public void run() {
                     try {
                         GeckoApp.mAppContext.disableCameraView();
                     } catch (Exception e) {}
                 }
             });
         if (sCamera != null) {
             sCamera.stopPreview();
             sCamera.release();
             sCamera = null;
             sCameraBuffer = null;
         }
     }
 
-    public static SynchronousQueue<String> sPromptQueue = null;
+    static SynchronousQueue<String> sPromptQueue = null;
 
     public static void registerGeckoEventListener(String event, GeckoEventListener listener) {
         if (mEventListeners == null)
             mEventListeners = new HashMap<String, ArrayList<GeckoEventListener>>();
 
         if (!mEventListeners.containsKey(event))
             mEventListeners.put(event, new ArrayList<GeckoEventListener>());
 
@@ -1659,29 +1656,29 @@ public class GeckoAppShell
         }
         return gPromptService;
     }
 
     public static double[] getCurrentBatteryInformation() {
         return GeckoBatteryManager.getCurrentInformation();
     }
 
-    public static void checkUriVisited(String uri) {   // invoked from native JNI code
+    static void checkUriVisited(String uri) {   // invoked from native JNI code
         GlobalHistory.getInstance().checkUriVisited(uri);
     }
 
-    public static void markUriVisited(final String uri) {    // invoked from native JNI code
+    static void markUriVisited(final String uri) {    // invoked from native JNI code
         getHandler().post(new Runnable() { 
             public void run() {
                 GlobalHistory.getInstance().add(uri);
             }
         });
     }
 
-    public static void hideProgressDialog() {
+    static void hideProgressDialog() {
         // unused stub
     }
 
     /*
      * WebSMS related methods.
      */
     public static int getNumberOfMessagesForText(String aText) {
         if (SmsManager.getInstance() == null) {
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -581,23 +581,17 @@ include $(topsrcdir)/config/android-comm
 # Instead of on the .class files, since more than one .class file might be produced per .java file
 # Sync dependencies are provided in a single jar. Sync classes themselves are delivered as source,
 # because Android resource classes must be compiled together in order to avoid overlapping resource
 # indices.
 classes.dex: $(FENNEC_JAVA_FILES) $(FENNEC_PP_JAVA_FILES) $(SYNC_JAVA_FILES) $(SYNC_PP_JAVA_FILES) $(SYNC_THIRDPARTY_JAVA_FILES) R.java
 	$(NSINSTALL) -D classes
 	$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(SYNC_THIRDPARTY_JAVA_FILES))
 	$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes -classpath classes $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
-	$(PROGUARD) @$(topsrcdir)/mobile/android/config/proguard.cfg \
-			-injars classes \
-			-outjars classes-proguarded \
-			-libraryjars $(ANDROID_SDK)/android.jar
-	# ProGuard may optimize away local variables, so dx --no-locals to ignore
-	# debug symbols for missing local variables.
-	$(DX) --dex --output=$@ --no-locals classes-proguarded
+	$(DX) --dex --output=$@ classes
 
 PP_RES_XML=$(SYNC_PP_RES_XML)
 
 $(PP_RES_XML): $(subst res/,$(srcdir)/resources/, $(PP_RES_XML).in)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
              $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
 
 # AndroidManifest.xml includes these files, so they need to be marked as dependencies.
deleted file mode 100644
--- a/mobile/android/config/proguard.cfg
+++ /dev/null
@@ -1,98 +0,0 @@
-#
-# Rules from Google's example proguard.cfg in the Android SDK:
-# android-sdk-macosx/tools/lib/proguard.cfg
-#
-
-# TODO: We can remove -dontskipnonpubliclibraryclasses for ProGuard >= 4.5
-# because it is enabled by default.
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
-
-# Preserve all fundamental application classes.
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
-
-# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
-# Preserve all classes that have special context constructors, and the
-# constructors themselves.
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
-# Preserve all classes that have special context constructors, and the
-# constructors themselves.
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
-   public void *(android.view.View);
-}
-
-# Preserve the special static methods that are required in all enumeration
-# classes.
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
-#
-# Rules from ProGuard's Android example:
-# http://proguard.sourceforge.net/manual/examples.html#androidapplication
-#
-
-# Switch off some optimizations that trip older versions of the Dalvik VM.
-# https://code.google.com/p/android/issues/detail?id=964
--optimizations !code/simplification/cast
-
-# Preserve all View implementations, their special context constructors, and
-# their setters.
--keep public class * extends android.view.View {
-    public <init>(android.content.Context);
-    public <init>(android.content.Context, android.util.AttributeSet);
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-    public void set*(...);
-}
-
-# Preserve the special fields of all Parcelable implementations.
--keepclassmembers class * implements android.os.Parcelable {
-    static android.os.Parcelable$Creator CREATOR;
-}
-
-# Preserve static fields of inner classes of R classes that might be accessed
-# through introspection.
--keepclassmembers class **.R$* {
-    public static <fields>;
-}
-
-#
-# Mozilla-specific rules
-#
-
-# Preserve public classes and methods accessed from C++ JNI.
--keep public class org.mozilla.gecko.** { public *; }
-
-# Google defaults to 5 passes, but Fennec benefits from up to 9-10 passes.
--optimizationpasses 10
-
-# Disable obfuscation because it makes exception stack traces more
-# difficult to debug. Plus Firefox's code is already open-source.
--dontobfuscate
-
-# Silence warnings about "Note: duplicate definition of library class".
--dontnote **,!org.mozilla.**
-
-# Allow private members to be made public to improve method inlining.
-# TODO: Enable -allowaccessmodification optimizations for ProGuard >= 4.6.
-# These optimizations trigger a ProGuard 4.4 bug when inlining private methods.
-##-allowaccessmodification