1. Download our Official Android App: Forums for Android!

Apps Grant SU to app before it accesses root

Discussion in 'Android Development' started by mcohen3, Jun 5, 2011.

  1. mcohen3

    mcohen3 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jun 5, 2011

    Jun 5, 2011
    1
    0
    5
    I am trying to create an application that takes advantage of Dynamic Voltage and Frequency Scaling (DVFS). My phone is rooted and I can successfully scale my device with the following command:

    psProc = Runtime.getRuntime().exec(new String[]{"su", "-c", "echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"});

    However, this command is executed frequently since it appears within the repaint method of a game. I would like to execute "echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed 300000", without using "su", "-c", since switching to the root user may be slow. Can I grant an entire application super user privileges before hand so that I may omit "su", "-c", in my execution?
     

    Advertisement

Share This Page

Loading...