Bug 617181 - Remove CPU detection code from Android Java wrapper. r=mwu a=blassey
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 06 Dec 2010 16:28:04 -0800
changeset 59019 befa46c6032aa0c0a2eb2ef50be733a94ceb5c66
parent 59018 ebac1eeb81928adabf70b0ce3ef0b859ff23e062
child 59020 a199802e18b5cf7fbc7b5baa1686edcbe38a6547
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersmwu, blassey
bugs617181
milestone2.0b8pre
Bug 617181 - Remove CPU detection code from Android Java wrapper. r=mwu a=blassey
embedding/android/App.java.in
embedding/android/GeckoApp.java
embedding/android/strings.xml.in
--- a/embedding/android/App.java.in
+++ b/embedding/android/App.java.in
@@ -42,13 +42,10 @@ import org.mozilla.gecko.GeckoApp;
 
 public class App extends GeckoApp {
     public String getAppName() {
 	return "@MOZ_APP_NAME@";
     }
     public String getContentProcessName() {
         return "@MOZ_CHILD_PROCESS_NAME@";
     }
-    public int getMinCPUVersion() {
-        return @MOZ_MIN_CPU_VERSION@;
-    }
 };
 
--- a/embedding/android/GeckoApp.java
+++ b/embedding/android/GeckoApp.java
@@ -178,57 +178,20 @@ abstract public class GeckoApp
                                                   ViewGroup.LayoutParams.FILL_PARENT));
 
         if (!checkAndSetLaunchState(LaunchState.PreLaunch,
                                     LaunchState.Launching))
             return;
 
         checkAndLaunchUpdate();
 
-        if (!checkCPUCompatability())
-            return;
         // Load our JNI libs
         GeckoAppShell.loadGeckoLibs(getApplication().getPackageResourcePath());
     }
 
-
-    boolean checkCPUCompatability() {
-        try {
-            BufferedReader reader =
-                new BufferedReader(new FileReader("/proc/cpuinfo"));
-            String line;
-            while ((line = reader.readLine()) != null) {
-                int index = line.indexOf("Processor");
-                if (index == -1)
-                    continue;
-
-                int version = 5;
-                if (line.indexOf("(v8l)") != -1)
-                    version = 8;
-                if (line.indexOf("(v7l)") != -1)
-                    version = 7;
-                if (line.indexOf("(v6l)") != -1)
-                    version = 6;
-                
-                if (version < getMinCPUVersion()) {
-                    showErrorDialog(
-                        getString(R.string.incompatable_cpu_error));
-                    return false;
-                }
-                else {
-                    break;
-                }
-            }
-        } catch (Exception ex) {
-            // Not much we can do here, just continue assuming we're okay
-            Log.i("GeckoApp", "exception: " + ex);
-        }
-        return true;
-    }
-
     @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
             System.exit(0);
             return;
         }
@@ -444,17 +407,16 @@ abstract public class GeckoApp
             default:
                 break;
         }
         return false;
     }
 
     abstract public String getAppName();
     abstract public String getContentProcessName();
-    abstract public int getMinCPUVersion();
 
     protected void unpackComponents()
         throws IOException, FileNotFoundException
     {
         ZipFile zip;
         InputStream listStream;
 
         File componentsDir = new File("/data/data/org.mozilla." + getAppName() +
--- a/embedding/android/strings.xml.in
+++ b/embedding/android/strings.xml.in
@@ -1,17 +1,16 @@
 #filter substitution
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE resources [
 #includesubst @BRANDPATH@
 #includesubst @STRINGSPATH@
 ]>
 <resources>
   <string name="splash_screen_label">&splash_screen_label;</string>
-  <string name="incompatable_cpu_error">&incompatable_cpu_error;</string>
   <string name="no_space_to_start_error">&no_space_to_start_error;</string>
   <string name="error_loading_file">&error_loading_file;</string>
   <string name="crash_message">&crash_message;</string>
   <string name="crash_help_message">&crash_help_message;</string>
   <string name="crash_send_report_message">&crash_send_report_message;</string>
   <string name="crash_include_url">&crash_include_url;</string>
   <string name="crash_close_label">&crash_close_label;</string>
   <string name="crash_restart_label">&crash_restart_label;</string>