bug 671092 - Crash after failed attempt to extract libraries after update r=dougt
authorBrad Lassey <blassey@mozilla.com>
Mon, 18 Jul 2011 14:25:20 -0400
changeset 72981 2c726694069d1fbbf322d151ff2d745c9b964fd1
parent 72980 70341a11ed2127327960ace46c915588a4103544
child 72982 7751e4f57ce6928a9691cdbb0ea8d665f759b3cf
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs671092
milestone8.0a1
bug 671092 - Crash after failed attempt to extract libraries after update r=dougt
embedding/android/GeckoApp.java
--- a/embedding/android/GeckoApp.java
+++ b/embedding/android/GeckoApp.java
@@ -257,22 +257,31 @@ abstract public class GeckoApp
 
             }});
         File cacheFile = GeckoAppShell.getCacheDir();
         File libxulFile = new File(cacheFile, "libxul.so");
 
         if (GeckoAppShell.getFreeSpace() > GeckoAppShell.kFreeSpaceThreshold &&
             (!libxulFile.exists() ||
              new File(getApplication().getPackageResourcePath()).lastModified()
-             >= libxulFile.lastModified()))
+             >= libxulFile.lastModified())) {
             surfaceView.mSplashStatusMsg =
                 getResources().getString(R.string.splash_screen_installing_libs);
-        else
+            File[] libs = cacheFile.listFiles(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".so");
+                }
+            });
+            for (int i = 0; i < libs.length; i++) {
+                libs[i].delete();
+            }
+        } else {
             surfaceView.mSplashStatusMsg =
                 getResources().getString(R.string.splash_screen_loading);
+        }
         mLibLoadThread.start();
     }
 
     @Override
     protected void onNewIntent(Intent intent) {
         if (checkLaunchState(LaunchState.GeckoExiting)) {
             // We're exiting and shouldn't try to do anything else just incase
             // we're hung for some reason we'll force the process to exit