Java Code Examples for com.grarak.kerneladiutor.utils.root.Control

The following examples show how to use com.grarak.kerneladiutor.utils.root.Control. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: kernel_adiutor   Source File: CPU.java    License: Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 2
Source Project: KernelAdiutor   Source File: IntelliPlug.java    License: GNU General Public License v3.0 5 votes vote down vote up
public void setIntelliPlugScreenOffMax(int position, Context context) {
    String file = HOTPLUG_INTELLI_PLUG_SCREEN_OFF_MAX;
    if (mUseVersion5) file = HOTPLUG_INTELLI_PLUG_5_SCREEN_OFF_MAX;

    String command = position == 0 ? String.valueOf(1L << 32 - 1) : String.valueOf(
            CPUFreq.getInstance(context).getFreqs().get(position - 1));
    run(Control.write(command, file), file, context);
}
 
Example 3
Source Project: kernel_adiutor   Source File: Thermal.java    License: Apache License 2.0 4 votes vote down vote up
public static void setCoreTempHysteresisDegC(int value, Context context) {
    Control.runCommand(String.valueOf(value), getThermalFile(PARAMETERS_CORE_TEMP_HYSTERESIS_DEGC), Control.CommandType.GENERIC, context);
}
 
Example 4
Source Project: KernelAdiutor   Source File: KSM.java    License: GNU General Public License v3.0 4 votes vote down vote up
public void setSleepMilliseconds(int ms, Context context) {
    run(Control.write(String.valueOf(ms), PARENT + SLEEP_MILLISECONDS), PARENT + SLEEP_MILLISECONDS, context);
}
 
Example 5
Source Project: KernelAdiutor   Source File: MSMThermal.java    License: GNU General Public License v3.0 4 votes vote down vote up
public void setAllowedMidFreq(int value, Context context) {
    run(Control.write(String.valueOf(value), CONF_ALLOWED_MID_FREQ), CONF_ALLOWED_MID_FREQ, context);
}
 
Example 6
Source Project: KA27   Source File: Wake.java    License: Apache License 2.0 4 votes vote down vote up
public static void setDT2WFeatherX(int value, Context context) {
    Control.runCommand(String.valueOf(value), WAKE_DT2W_FEATHERX, Control.CommandType.GENERIC, context);
}
 
Example 7
Source Project: kernel_adiutor   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void setStateHelperMaxCpusEco(int value, Context context) {
    Control.runCommand(String.valueOf(value), STATE_HELPER_MAX_CPU_ECO, Control.CommandType.GENERIC, context);
}
 
Example 8
Source Project: KA27   Source File: Battery.java    License: Apache License 2.0 4 votes vote down vote up
public static void activateForceFastCharge(boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", FORCE_FAST_CHARGE, Control.CommandType.GENERIC, context);
}
 
Example 9
Source Project: KA27   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void setAutoSmpCycleUp(int value, Context context) {
    Control.runCommand(String.valueOf(value), HOTPLUG_AUTOSMP_CYCLE_UP, Control.CommandType.GENERIC, context);
}
 
Example 10
Source Project: KernelAdiutor   Source File: BluPlug.java    License: GNU General Public License v3.0 4 votes vote down vote up
private static void run(String command, String id, Context context) {
    Control.runSetting(command, ApplyOnBootFragment.CPU_HOTPLUG, id, context);
}
 
Example 11
Source Project: kernel_adiutor   Source File: VM.java    License: Apache License 2.0 4 votes vote down vote up
public static void setExtraFreeKbytes(String value, Context context) {
    Control.runCommand(value, VM_EXTRA_FREE_KBYTES, Control.CommandType.GENERIC, context);
}
 
Example 12
Source Project: kernel_adiutor   Source File: IO.java    License: Apache License 2.0 4 votes vote down vote up
public static void activaterotational (boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", IO_ROTATIONAL, Control.CommandType.GENERIC, context);
}
 
Example 13
Source Project: kernel_adiutor   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void activateAutoHotplug(boolean active, Context context) {
    Control.runCommand(active ? "Y" : "N", HOTPLUG_AUTO_HOTPLUG_ENABLE, Control.CommandType.GENERIC, context);
    if (active) togglehotplugs("AutoHotplug", context);
}
 
Example 14
Source Project: kernel_adiutor   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void setMBHotplugMaxCpusOnlineSusp(int value, Context context) {
    Control.runCommand(String.valueOf(value), Utils.getsysfspath(MB_HOTPLUG_ARRAY) + "/" + MB_CPUS_ONLINE_SUSP, Control.CommandType.GENERIC, context);
}
 
Example 15
Source Project: KA27   Source File: Battery.java    License: Apache License 2.0 4 votes vote down vote up
public static void activateBclHotplug(boolean active, Context context) {
    if (active && Battery.hasBcl() && !Battery.isBclActive()) {
        Battery.activateBcl(true, context);
    }
    Control.runCommand(active ? "Y" : "N", BCL_HOTPLUG, Control.CommandType.ASTERISK, context);
}
 
Example 16
Source Project: KernelAdiutor   Source File: Sound.java    License: GNU General Public License v3.0 4 votes vote down vote up
public void enableSoundControl(boolean enable, Context context) {
    run(Control.write(enable ? "Y" : "N", SOUND_CONTROL_ENABLE), SOUND_CONTROL_ENABLE, context);
}
 
Example 17
Source Project: kernel_adiutor   Source File: Screen.java    License: Apache License 2.0 4 votes vote down vote up
public static void setBackLightDimmerThreshold(int value, Context context) {
    Control.runCommand(String.valueOf(value), LM3630_BACKLIGHT_DIMMER_THRESHOLD, Control.CommandType.GENERIC, context);
}
 
Example 18
Source Project: kernel_adiutor   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void activateMSMSleeper (boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", MSM_SLEEPER_ENABLE, Control.CommandType.GENERIC, context);
    if (active) togglehotplugs("MSM_Sleeper", context);
}
 
Example 19
Source Project: KA27   Source File: Wake.java    License: Apache License 2.0 4 votes vote down vote up
public static void setSleepMisc(int value, Context context) {
    Control.runCommand(String.valueOf(value), SLEEP_MISC_FILE, Control.CommandType.GENERIC, context);
}
 
Example 20
Source Project: KA27   Source File: Wake.java    License: Apache License 2.0 4 votes vote down vote up
public static void setWakeMisc(int value, Context context) {
    Control.runCommand(String.valueOf(value), WAKE_MISC_FILE, Control.CommandType.GENERIC, context);
}
 
Example 21
Source Project: KA27   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void activateAlucardHotplugHpIoIsBusy(boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", ALUCARD_HOTPLUG_HP_IO_IS_BUSY, Control.CommandType.GENERIC, context);
}
 
Example 22
Source Project: kernel_adiutor   Source File: Screen.java    License: Apache License 2.0 4 votes vote down vote up
public static void setRedBlacks(String value, Context context) {
    Control.runCommand(value, GAMMACONTROL_RED_BLACKS, Control.CommandType.GENERIC, context);
}
 
Example 23
Source Project: kernel_adiutor   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void setBluPlugMaxFreqScreenOff(int position, Context context) {
    String command = position == 0 ? "0" : String.valueOf(CPU.getFreqs().get(position - 1));
    Control.runCommand(command, HOTPLUG_BLU_PLUG_MAX_FREQ_SCREEN_OFF, Control.CommandType.GENERIC, context);
}
 
Example 24
Source Project: KA27   Source File: VM.java    License: Apache License 2.0 4 votes vote down vote up
public static void setDirtyRatio(int value, Context context) {
    Control.runCommand(String.valueOf(value), VM_DIRTY_RATIO, Control.CommandType.GENERIC, context);
}
 
Example 25
Source Project: KernelAdiutor   Source File: MakoHotplug.java    License: GNU General Public License v3.0 4 votes vote down vote up
private static void run(String command, String id, Context context) {
    Control.runSetting(command, ApplyOnBootFragment.CPU_HOTPLUG, id, context);
}
 
Example 26
Source Project: KernelAdiutor   Source File: Misc.java    License: GNU General Public License v3.0 4 votes vote down vote up
public static void setCFSScheduler(String value, Context context) {
    run(Control.write(value, CPU_CURRENT_CFS_SCHEDULER), CPU_CURRENT_CFS_SCHEDULER, context);
}
 
Example 27
Source Project: kernel_adiutor   Source File: Screen.java    License: Apache License 2.0 4 votes vote down vote up
public static void setScreenHueKcal (String value, Context context) {
    Control.runCommand(value, SCREEN_KCAL_CTRL_HUE, Control.CommandType.GENERIC, context);
}
 
Example 28
Source Project: kernel_adiutor   Source File: GPU.java    License: Apache License 2.0 4 votes vote down vote up
public static void setAdrenoIdlerDownDiff(int value, Context context) {
    Control.runCommand(String.valueOf(value), ADRENO_IDLER_DOWNDIFFERENTIAL, Control.CommandType.GENERIC, context);
}
 
Example 29
Source Project: KernelAdiutor   Source File: IntelliPlug.java    License: GNU General Public License v3.0 4 votes vote down vote up
public void setIntelliPlugDownLockDuration(int value, Context context) {
    run(Control.write(String.valueOf(value), HOTPLUG_INTELLI_PLUG_5_DOWN_LOCK_DURATION),
            HOTPLUG_INTELLI_PLUG_5_DOWN_LOCK_DURATION, context);
}
 
Example 30
Source Project: kernel_adiutor   Source File: CPUHotplug.java    License: Apache License 2.0 4 votes vote down vote up
public static void setMsmHotplugMaxCpusOnlineSusp(int value, Context context) {
    Control.runCommand(String.valueOf(value), HOTPLUG_MSM_MAX_CPUS_ONLINE_SUSP, Control.CommandType.GENERIC, context);
}