How to change the clock frequency in Android?

I am new to Android software development.

I want to make an application like SetCPU that can control the processor frequency in Android.

But I could not find some related API or materials.

I want to sincerely know the following two things.

  • Is there an API for changing the frequency of the processor in Android?
  • If not, do some APIs exist on Linux?
+3
source share
3 answers

Some teams in ADB

Set regulator:

adb shell echo "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Set the frequency in kHz:

adb shell su -c "echo "702000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
//min frequency
adb shell su -c "echo "384000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"  
//MAX frequency
adb shell su -c "echo "384000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" 

Get the current processor frequency:

adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq

Show available controls:

adb shell su -c "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"

Disable a service that overwrites the cpu network file:

adb shell su -c "stop mpdecision" 

, . mp , .

:

adb shell su -c "echo "0" > /sys/devices/system/cpu/cpu3/online"

:

& chmod 444 /sys/devices/system/cpu/cpu1/online 
+8

Java API Android-. - .

+2

It looks like you need to shorten your device

http://www.pokedev.com/setcpu/

0
source

Source: https://habr.com/ru/post/1776091/


All Articles