[Android] Util: bring back /proc/cpuinfo scraping

Edward Wang git at videolan.org
Mon Aug 27 23:23:22 CEST 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Mon Aug 27 17:22:06 2012 -0400| [7debf53d89aac07e3cac685add29ad83e9301b0c] | committer: Edward Wang

Util: bring back /proc/cpuinfo scraping

Some devices (notably Google TV) have "none" in their CPU_ABI fields.

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7debf53d89aac07e3cac685add29ad83e9301b0c
---

 vlc-android/src/org/videolan/vlc/Util.java |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 777c6c5..ca059c3 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -281,6 +281,17 @@ public class Util {
             BufferedReader br = new BufferedReader(fileReader);
             String line;
             while((line = br.readLine()) != null) {
+                if(!hasArmV7 && line.contains("ARMv7")) {
+                    hasArmV7 = true;
+                    hasArmV6 = true; /* Armv7 is backwards compatible to < v6 */
+                }
+                if(!hasArmV7 && !hasArmV6 && line.contains("ARMv6"))
+                    hasArmV6 = true;
+                // "clflush size" is a x86-specific cpuinfo tag.
+                // (see kernel sources arch/x86/kernel/cpu/proc.c)
+                if(!(hasArmV6 || hasArmV7 || hasX86) && line.contains("clflush size"))
+                    hasX86 = true;
+                // TODO: MIPS - "microsecond timers"; see arch/mips/kernel/proc.c
                 if(!hasNeon && line.contains("neon"))
                     hasNeon = true;
                 if(!hasFpu && line.contains("vfp"))



More information about the Android mailing list