Beispiel #1
0
 public static void setCpuBoostInputFreq(int value, int core, Context context) {
   if (Utils.readFile(CPU_BOOST_INPUT_BOOST_FREQ).contains(":"))
     Control.runCommand(
         core + ":" + value, CPU_BOOST_INPUT_BOOST_FREQ, Control.CommandType.GENERIC, context);
   else
     Control.runCommand(
         String.valueOf(value), CPU_BOOST_INPUT_BOOST_FREQ, Control.CommandType.GENERIC, context);
 }
Beispiel #2
0
 public static void setMaxFreq(Control.CommandType command, int freq, Context context) {
   if (command == Control.CommandType.CPU
       && Utils.existFile(CPU_MSM_CPUFREQ_LIMIT)
       && freq > Utils.stringToInt(Utils.readFile(CPU_MSM_CPUFREQ_LIMIT)))
     Control.runCommand(
         String.valueOf(freq), CPU_MSM_CPUFREQ_LIMIT, Control.CommandType.GENERIC, context);
   if (Utils.existFile(String.format(CPU_ENABLE_OC, 0)))
     Control.runCommand("1", CPU_ENABLE_OC, Control.CommandType.CPU, context);
   if (getMinFreq(command == Control.CommandType.CPU ? getBigCore() : getLITTLEcore(), true)
       > freq) setMinFreq(command, freq, context);
   if (Utils.existFile(String.format(CPU_MAX_FREQ_KT, 0)))
     Control.runCommand(String.valueOf(freq), CPU_MAX_FREQ_KT, command, context);
   else Control.runCommand(String.valueOf(freq), CPU_MAX_FREQ, command, context);
 }
Beispiel #3
0
 public static void activateGesture(boolean active, int gesture, Context context) {
   Control.runCommand(
       GESTURE_STRING_VALUES[gesture] + "=" + active,
       GESTURE_CRTL,
       Control.CommandType.GENERIC,
       GESTURE_STRING_VALUES[gesture],
       context);
 }
Beispiel #4
0
 public static void setSpeakerGain(String value, Context context) {
   Control.runCommand(
       value + " " + value,
       SPEAKER_GAIN_FILE,
       SPEAKER_GAIN_FILE.equals(SPEAKER_GAIN)
           ? Control.CommandType.FAUX_GENERIC
           : Control.CommandType.GENERIC,
       context);
 }
Beispiel #5
0
 public static void activateCore(int core, boolean active, Context context) {
   if (context != null)
     Control.runCommand(
         active ? "1" : "0",
         String.format(CPU_CORE_ONLINE, core),
         Control.CommandType.GENERIC,
         context);
   else
     RootUtils.runCommand(
         String.format("echo %s > " + String.format(CPU_CORE_ONLINE, core), active ? "1" : "0"));
 }
Beispiel #6
0
 public static void setCpuBoostInputMs(int value, Context context) {
   Control.runCommand(
       String.valueOf(value), CPU_BOOST_INPUT_MS, Control.CommandType.GENERIC, context);
 }
Beispiel #7
0
 public static void activateCpuBoostHotplug(boolean active, Context context) {
   Control.runCommand(active ? "Y" : "N", CPU_BOOST_HOTPLUG, Control.CommandType.GENERIC, context);
 }
Beispiel #8
0
 public static void activateCpuBoostDebugMask(boolean active, Context context) {
   Control.runCommand(
       active ? "1" : "0", CPU_BOOST_DEBUG_MASK, Control.CommandType.GENERIC, context);
 }
Beispiel #9
0
 public static void setHeadphonePowerAmpGain(String value, Context context) {
   Control.runCommand(
       value + " " + value, HEADPHONE_POWERAMP_GAIN, Control.CommandType.FAUX_GENERIC, context);
 }
Beispiel #10
0
 public static void setVolumeGain(String value, Context context) {
   Control.runCommand(value, VOLUME_BOOST, Control.CommandType.GENERIC, context);
 }
Beispiel #11
0
 public static void activateSoundControl(boolean active, Context context) {
   Control.runCommand(
       active ? "Y" : "N", SOUND_CONTROL_ENABLE, Control.CommandType.GENERIC, context);
 }
Beispiel #12
0
 public static void setCamMicrophoneGain(String value, Context context) {
   Control.runCommand(value, CAM_MICROPHONE_GAIN, Control.CommandType.FAUX_GENERIC, context);
 }
Beispiel #13
0
 public static void setGovernor(Control.CommandType command, String governor, Context context) {
   Control.runCommand(governor, CPU_SCALING_GOVERNOR, command, context);
 }
Beispiel #14
0
 public static void activatePowerSavingWq(boolean active, Context context) {
   String command = active ? "Y" : "N";
   Control.runCommand(command, CPU_WQ_POWER_SAVING, Control.CommandType.GENERIC, context);
 }
Beispiel #15
0
 public static void setMcPowerSaving(int value, Context context) {
   Control.runCommand(
       String.valueOf(value), CPU_MC_POWER_SAVING, Control.CommandType.GENERIC, context);
 }
Beispiel #16
0
 public static void setCFSScheduler(String value, Context context) {
   Control.runCommand(value, CPU_CURRENT_CFS_SCHEDULER, Control.CommandType.GENERIC, context);
 }
Beispiel #17
0
 public static void activateCpuQuiet(boolean active, Context context) {
   Control.runCommand(active ? "1" : "0", CPU_QUIET_ENABLE, Control.CommandType.GENERIC, context);
 }
Beispiel #18
0
 public static void setCpuQuietGovernor(String value, Context context) {
   Control.runCommand(value, CPU_QUIET_CURRENT_GOVERNOR, Control.CommandType.GENERIC, context);
 }
Beispiel #19
0
 public static void activateCpuBoost(boolean active, Context context) {
   String command = active ? "1" : "0";
   if (CPU_BOOST_ENABLE_FILE.equals(CPU_BOOST_ENABLE_2)) command = active ? "Y" : "N";
   Control.runCommand(command, CPU_BOOST_ENABLE_FILE, Control.CommandType.GENERIC, context);
 }
Beispiel #20
0
 public static void setWakeTimeout(int value, Context context) {
   Control.runCommand(
       String.valueOf(value), WAKE_TIMEOUT_FILE, Control.CommandType.GENERIC, context);
 }
Beispiel #21
0
 public static void runCommand(
     final String value, final String file, final CommandType command, final Context context) {
   runCommand(value, file, command, null, context);
 }
Beispiel #22
0
 public static void setMaxScreenOffFreq(Control.CommandType command, int freq, Context context) {
   Control.runCommand(String.valueOf(freq), CPU_MAX_SCREEN_OFF_FREQ, command, context);
 }
Beispiel #23
0
 public static void setHandsetMicrophoneGain(String value, Context context) {
   Control.runCommand(value, HANDSET_MICROPONE_GAIN, Control.CommandType.FAUX_GENERIC, context);
 }
Beispiel #24
0
 public static void setMinFreq(Control.CommandType command, int freq, Context context) {
   if (getMaxFreq(command == Control.CommandType.CPU ? getBigCore() : getLITTLEcore(), true)
       < freq) setMaxFreq(command, freq, context);
   Control.runCommand(String.valueOf(freq), CPU_MIN_FREQ, command, context);
 }
Beispiel #25
0
 public static void activateHighPerfMode(boolean active, Context context) {
   Control.runCommand(
       active ? "1" : "0", HIGHPERF_MODE_ENABLE, Control.CommandType.GENERIC, context);
 }
Beispiel #26
0
 public static void activatePowerKeySuspend(boolean active, Context context) {
   Control.runCommand(active ? "1" : "0", POWER_KEY_SUSPEND, Control.CommandType.GENERIC, context);
 }
Beispiel #27
0
 public static void setMicrophoneGain(String value, Context context) {
   Control.runCommand(value, MIC_BOOST, Control.CommandType.GENERIC, context);
 }
Beispiel #28
0
 public static void activateCpuBoostWakeup(boolean active, Context context) {
   Control.runCommand(active ? "Y" : "N", CPU_BOOST_WAKEUP, Control.CommandType.GENERIC, context);
 }
Beispiel #29
0
 public static void setDt2w(int value, Context context) {
   Control.runCommand(String.valueOf(value), DT2W_FILE, Control.CommandType.GENERIC, context);
 }
Beispiel #30
0
 public static void setCpuBoostSyncThreshold(int value, Context context) {
   Control.runCommand(
       String.valueOf(value), CPU_BOOST_SYNC_THRESHOLD, Control.CommandType.GENERIC, context);
 }