summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-06-24 16:07:56 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-06-24 16:07:56 +0200
commit04994e322b88df30ce711c59f2a2975c2aae5612 (patch)
treeb025cb8f46c86ca27ea82f8a408d87129127e229
parent7447187f8debeb920ec37c18286226a2d24a0edb (diff)
downloadpackages_apps_Settings-04994e322b88df30ce711c59f2a2975c2aae5612.tar.gz
packages_apps_Settings-04994e322b88df30ce711c59f2a2975c2aae5612.tar.bz2
packages_apps_Settings-04994e322b88df30ce711c59f2a2975c2aae5612.zip
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--src/com/android/settings/DeviceInfoSettings.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index 23fa672fd..91be9a457 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -416,15 +416,24 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
private String getCPUInfo() {
String result = null;
+ String line = null;
+ BufferedReader reader = null;
try {
/* The expected /proc/cpuinfo output is as follows:
* Processor : ARMv7 Processor rev 2 (v7l)
* BogoMIPS : 272.62
*/
- String firstLine = readLine(FILENAME_PROC_CPUINFO);
- if (firstLine != null) {
- result = firstLine.split(":")[1].trim();
+
+ reader = new BufferedReader(new FileReader(FILENAME_PROC_CPUINFO), 256);
+
+ try {
+ while ((line = reader.readLine()) != null) {
+ if (line.split(":")[0].trim().equals("model name") || line.split(":")[0].trim().equals("Processor"))
+ result = line.split(":")[1].trim();
+ }
+ } finally {
+ reader.close();
}
} catch (IOException e) {}