last day (16 days later) » 

7:48 PM
0
A: Writing cpu0/cpufreq/cpuinfo_min_freq: open failed: EACCES (Permission denied)

mrPjerInstead of changing the permissions on the system files to globally readable / writable (which you really shouldn't do), try writing the files directly using root access. You can easily do this by using echo instead of chmod in your su call. E.g. Runtime.getRuntime().exec("su -c \"echo 1234 > /...

 
Sounds like good advice. I tried Runtime.getRuntime().exec("su -c \"echo 594000 > /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq\""); and that executed without throwing any exceptions... but sadly when I read the file moments later to check it had worked, it was "384000". Maybe your answer gives the correct way to write the file, but somehow it is not enough to permanently set the min cpu speed :-(
The phone is rooted (100% sure). Whether that automatically means my app has root access or not I am less certain.
 
Can you confirm that the app has root access? Also, can you confirm the return code you get from executing that command? It's been a while since I did someting similar, but do check if you need to do anything extra if your CPU has multiple cores. Also, to make debugging easier, I'd suggest you first try getting a command that works by using adb shell. This will give you a standard shell in which you can try out commands which you can later put in the exec() call.
 
I can't see how to get a return code from "exec()". With regard "check if you need to do anything extra if your CPU has multiple cores" - I have no idea how to find out. I have been looking in lots of places with no luck. I will play with adb shell.
 
I can't test this now, but the return type of the exec call should be a Process object. Let's say you assign it with Process p = Runtime.getRuntime().exec(...). You can get the return code from that process object by calling int returnCode = p.waitFor();. Check if that is different than 0. Also, when running things in the ADB shell, you can check the return code of the last command by running echo $?. Also, the cpuinfo_min_freq file might be read only. See if you have the scaling_min_freq in the same directory.
 
Return code 127, which appears to be illegal command.
 
7:48 PM
Confirm you can actually run both su and echo with adb shell. Depending on how your system is set up, you may have to provide the full path to the binaries (something along /system/xbin/su). However, this won't work on all devices. For a more robust way, check out su.chainfire.eu.
 
See edit to OP. Bothe echo and su appear to execute without error even when I'm in the cpufreq directory.
 
Can you try seeing if the file scaling_min_freq is present and writable? I'm pretty sure that's the one that sets the minimum frequency, whule cpuinfo_min_freq is a read-only file.
 
 
3 hours later…
11:00 PM
Sorry I missed your chat invite while I was still at work 3 hours ago. But anyway I remember that scaling_min_freq was in the same directory as cpuinfo_min_freq, but whether it was writable or not, I have no idea and can't check till tomorrow.
 

  last day (16 days later) »