public static int getMaxCpuFreq() {
String kCpuInfoMaxFreqFilePath = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
int result = 1600000;
FileReader fr = null;
BufferedReader br = null;
try {
fr = new FileReader(kCpuInfoMaxFreqFilePath);
br = new BufferedReader(fr);
String text = br.readLine();
result = Integer.parseInt(text.trim());
} catch (FileNotFoundException e) {
// e.printStackTrace();
return 1600000;
} catch (IOException e) {
// e.printStackTrace();
return result;
} finally {
if (fr != null)
try {
fr.close();
} catch (IOException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
return result;
}
if (br != null)
try {
br.close();
} catch (IOException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
return result;
}
}
return result;
}