cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq を使用して現在の周波数を抽出しています。しかし、このコマンドを実行すると常に最大周波数が設定されますが、DDMS からプルすると、ファイルには異なる周波数が表示されます。エラーの原因を教えてください。
私のコード:
public String getCurrentCPU()
{
Process process;
try{
Runtime rt = Runtime.getRuntime();
process=rt.exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq");
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
int read;
char[] buffer = new char[4096];
StringBuffer output = new StringBuffer();
while ((read = reader.read(buffer)) > 0) {
output.append(buffer, 0, read);
}
reader.close();
process.destroy();
//process.waitFor();
return output.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
}