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

The following examples show how to use com.grarak.kerneladiutor.utils.root.Control. 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 File: IntelliPlug.java    From KernelAdiutor with 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 #2
Source File: CPU.java    From kernel_adiutor with 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 #3
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void activateStateHelperDebug(boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", STATE_HELPER_DEBUG_MASK, Control.CommandType.GENERIC, context);
}
 
Example #4
Source File: Misc.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void enableArchPower(boolean enable, Context context) {
    run(Control.write(enable ? "1" : "0", ARCH_POWER), ARCH_POWER, context);
}
 
Example #5
Source File: Misc.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void enableVibration(boolean enable, Context context) {
    run(Control.write(enable ? "0" : "1", VIBRATION), VIB_VIBRATION, context);
}
 
Example #6
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void setIntelliPlugSuspendDeferTime(int value, Context context) {
    Control.runCommand(String.valueOf(value), HOTPLUG_INTELLI_PLUG_5_SUSPEND_DEFER_TIME, Control.CommandType.GENERIC, context);
}
 
Example #7
Source File: VM.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setDirtySuspendWriteback(int value, Context context) {
    Control.runCommand(String.valueOf(value), VM_DIRTY_WRITEBACK_SUSPEND_CENTISECS, Control.CommandType.GENERIC, context);
}
 
Example #8
Source File: Screen.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void setBlueNegative(String value, Context context) {
    Control.runCommand(value, DSI_PANEL_BN, Control.CommandType.GENERIC, context);
}
 
Example #9
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setDynPlugUpThreshold(int value, Context context) {
    Control.runCommand(String.valueOf(value), HOTPLUG_DYN_PLUG_UP_THRESHOLD, Control.CommandType.GENERIC, context);
}
 
Example #10
Source File: Misc.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void enableMasterSequence(boolean enable, Context context) {
    run(Control.write(enable ? "1" : "0", MASTER_SEQUENCE), MASTER_SEQUENCE, context);
}
 
Example #11
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void activateBluPlug(boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", HOTPLUG_BLU_PLUG_ENABLE, Control.CommandType.GENERIC, context);
    if (active) togglehotplugs("BluPlug", context);
}
 
Example #12
Source File: AlucardHotplug.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static void setAlucardHotplugSamplingRate(int value, Context context) {
    run(Control.write(String.valueOf(value), ALUCARD_HOTPLUG_SAMPLING_RATE),
            ALUCARD_HOTPLUG_SAMPLING_RATE, context);
}
 
Example #13
Source File: Screen.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setBlueGreys(String value, Context context) {
    Control.runCommand(value, GAMMACONTROL_BLUE_GREYS, Control.CommandType.GENERIC, context);
}
 
Example #14
Source File: KSM.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void enableDeferredTimer(boolean enable, Context context) {
    run(Control.write(enable ? "1" : "0", PARENT + DEFERRED_TIMER), PARENT + DEFERRED_TIMER, context);
}
 
Example #15
Source File: GPU.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setGpuGovernor(String governor, Context context) {
    if (GPU_SCALING_GOVERNOR != null)
        Control.runCommand(governor, GPU_SCALING_GOVERNOR, Control.CommandType.GENERIC, context);
}
 
Example #16
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void activateBluPlugPowersaverMode(boolean active, Context context) {
    Control.runCommand(active ? "Y" : "N", HOTPLUG_BLU_PLUG_POWERSAVER_MODE, Control.CommandType.GENERIC, context);
}
 
Example #17
Source File: Thermal.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void activateVddRestriction(boolean active, Context context) {
    Control.runCommand(active ? "1" : "0", getThermalFile(VDD_RESTRICTION_ENABLED), Control.CommandType.GENERIC, context);
}
 
Example #18
Source File: MSMThermal.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void setAllowedMaxHigh(int value, Context context) {
    run(Control.write(String.valueOf(value), CONF_ALLOWED_MAX_HIGH), CONF_ALLOWED_MAX_HIGH, context);
}
 
Example #19
Source File: Screen.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setGammaSaturation(String value, Context context) {
    Control.runCommand(value, GAMMACONTROL_SATURATION, Control.CommandType.GENERIC, context);
}
 
Example #20
Source File: KSM.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setCpuUse(int percent, Context context) {
    Control.runCommand(String.valueOf(percent), getKsmFile(UKSM_CPU_USE), Control.CommandType.GENERIC, context);
}
 
Example #21
Source File: Dt2w.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void set(int value, Context context) {
    run(Control.write(String.valueOf(value), FILE), FILE, context);
}
 
Example #22
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static void setMBHotplugStartDelay(int value, Context context) {
    Control.runCommand(String.valueOf(value), Utils.getsysfspath(MB_HOTPLUG_ARRAY) + "/" + MB_STARTDELAY, Control.CommandType.GENERIC, context);
}
 
Example #23
Source File: IntelliPlug.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void setIntelliPlugSuspendDeferTime(int value, Context context) {
    run(Control.write(String.valueOf(value), HOTPLUG_INTELLI_PLUG_5_SUSPEND_DEFER_TIME),
            HOTPLUG_INTELLI_PLUG_5_SUSPEND_DEFER_TIME, context);
}
 
Example #24
Source File: IO.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void setScheduler(StorageType type, String scheduler, Context context) {
    Control.runCommand(scheduler, type == StorageType.INTERNAL ? IO_INTERNAL_SCHEDULER :
            IO_EXTERNAL_SCHEDULER, Control.CommandType.GENERIC, context);
}
 
Example #25
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void setMsmHotplugOfflineLoad(int value, Context context) {
    Control.runCommand(String.valueOf(value), HOTPLUG_MSM_OFFLINE_LOAD, Control.CommandType.GENERIC, context);
}
 
Example #26
Source File: GPU.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static void setGpu2dGovernor(String governor, Context context) {
    if (GPU_2D_SCALING_GOVERNOR != null)
        Control.runCommand(governor, GPU_2D_SCALING_GOVERNOR, Control.CommandType.GENERIC, context);
}
 
Example #27
Source File: ThunderPlug.java    From KernelAdiutor with 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 #28
Source File: MSMThermal.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void setPollMs(int value, Context context) {
    run(Control.write(String.valueOf(value), getParent(PARAMETERS_POLL_MS)),
            getParent(PARAMETERS_POLL_MS), context);
}
 
Example #29
Source File: IntelliPlug.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public void setIntelliPlugHysteresis(int value, Context context) {
    String file = HOTPLUG_INTELLI_PLUG_HYSTERESIS;
    if (mUseVersion5) file = HOTPLUG_INTELLI_PLUG_5_HYSTERESIS;
    run(Control.write(String.valueOf(value), file), file, context);
}
 
Example #30
Source File: ThunderPlug.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static void setThunderPlugEnduranceLevel(int value, Context context) {
    run(Control.write(String.valueOf(value), HOTPLUG_THUNDER_PLUG_ENDURANCE_LEVEL),
            HOTPLUG_THUNDER_PLUG_ENDURANCE_LEVEL, context);
}