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); }
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); }
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); }
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); }
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")); }
public static void setHandsetMicrophoneGain(String value, Context context) { Control.runCommand(value, HANDSET_MICROPONE_GAIN, Control.CommandType.FAUX_GENERIC, context); }
public static void setCamMicrophoneGain(String value, Context context) { Control.runCommand(value, CAM_MICROPHONE_GAIN, Control.CommandType.FAUX_GENERIC, context); }
public static void setCFSScheduler(String value, Context context) { Control.runCommand(value, CPU_CURRENT_CFS_SCHEDULER, Control.CommandType.GENERIC, context); }
public static void setSleepMilliseconds(int ms, Context context) { run( Control.write(String.valueOf(ms), PARENT + SLEEP_MILLISECONDS), PARENT + SLEEP_MILLISECONDS, context); }
public static void setGovernor(Control.CommandType command, String governor, Context context) { Control.runCommand(governor, CPU_SCALING_GOVERNOR, command, context); }
public static void setHeadphonePowerAmpGain(String value, Context context) { Control.runCommand( value + " " + value, HEADPHONE_POWERAMP_GAIN, Control.CommandType.FAUX_GENERIC, context); }
public static void setVolumeGain(String value, Context context) { Control.runCommand(value, VOLUME_BOOST, Control.CommandType.GENERIC, context); }
public static void activateCpuBoostHotplug(boolean active, Context context) { Control.runCommand(active ? "Y" : "N", CPU_BOOST_HOTPLUG, Control.CommandType.GENERIC, context); }
public static void activateCpuBoostWakeup(boolean active, Context context) { Control.runCommand(active ? "Y" : "N", CPU_BOOST_WAKEUP, Control.CommandType.GENERIC, context); }
public static void setMcPowerSaving(int value, Context context) { Control.runCommand( String.valueOf(value), CPU_MC_POWER_SAVING, Control.CommandType.GENERIC, context); }
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); }
public static void setMaxScreenOffFreq(Control.CommandType command, int freq, Context context) { Control.runCommand(String.valueOf(freq), CPU_MAX_SCREEN_OFF_FREQ, command, context); }
public static void activateSoundControl(boolean active, Context context) { Control.runCommand( active ? "Y" : "N", SOUND_CONTROL_ENABLE, Control.CommandType.GENERIC, context); }
public static void activateHighPerfMode(boolean active, Context context) { Control.runCommand( active ? "1" : "0", HIGHPERF_MODE_ENABLE, Control.CommandType.GENERIC, context); }
public static void setCpuBoostInputMs(int value, Context context) { Control.runCommand( String.valueOf(value), CPU_BOOST_INPUT_MS, Control.CommandType.GENERIC, context); }
public static void setMicrophoneGain(String value, Context context) { Control.runCommand(value, MIC_BOOST, Control.CommandType.GENERIC, context); }
public static void enableDeferredTimer(boolean enable, Context context) { run( Control.write(enable ? "1" : "0", PARENT + DEFERRED_TIMER), PARENT + DEFERRED_TIMER, context); }
private static void run(String command, String id, Context context) { Control.runSetting(command, ApplyOnBootFragment.KSM, id, context); }
public static void activatePowerSavingWq(boolean active, Context context) { String command = active ? "Y" : "N"; Control.runCommand(command, CPU_WQ_POWER_SAVING, Control.CommandType.GENERIC, context); }
public static void enableKsm(boolean enable, Context context) { run(Control.write(enable ? "1" : "0", PARENT + RUN), PARENT + RUN, context); }
public static void setCpuMinFreq(int freq, int cpu, Context context) { run(Control.write(cpu + ":" + freq, CPU_MIN_FREQ), CPU_MIN_FREQ + cpu, context); }
public static void setMaxCpuPercentage(int value, Context context) { run(Control.write(String.valueOf(value), MAX_CPU_PERCENTAGE), MAX_CPU_PERCENTAGE, context); }
public static void setCpuMaxFreq(int freq, int cpu, Context context) { run(Control.write(cpu + ":" + freq, CPU_MAX_FREQ_FILE), CPU_MAX_FREQ_FILE + cpu, context); }
public static void setPagesToScan(int pages, Context context) { run( Control.write(String.valueOf(pages), PARENT + PAGES_TO_SCAN), PARENT + PAGES_TO_SCAN, context); }
public static void setMaxCpus(int big, int little, String category, Context context) { Control.runSetting(Control.write(little + ":" + big, MAX_CPUS), category, MAX_CPUS, context); }