Java Code Examples for com.grarak.kerneladiutor.utils.Utils#stringToInt()

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#stringToInt() . 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: CPUVoltage.java    From KA27 with Apache License 2.0 6 votes vote down vote up
public static void setGlobalOffset(String voltage, Context context) {
    int adjust = Utils.stringToInt(voltage);
    String command = String.valueOf(adjust);

    switch (CPU_VOLTAGE_FILE) {
        case CPU_VDD_VOLTAGE:
        case CPU_FAUX_VOLTAGE:
            if (CPU_VOLTAGE_FILE.equals(CPU_FAUX_VOLTAGE))
                command = String.valueOf(adjust * 1000);
            if (adjust > 0) command = "+" + command;
            break;
        default:
            command = "";
            for (String volt: getVoltages())
                if (volt != null)
                    command += command.isEmpty() ? (Utils.stringToInt(volt) + adjust) :
                    " " + (Utils.stringToInt(volt) + adjust);
            break;
    }

    Control.runCommand(command, CPU_VOLTAGE_FILE, Control.CommandType.GENERIC, context);
}
 
Example 2
Source File: CPU.java    From KA27 with Apache License 2.0 5 votes vote down vote up
public static int getMinFreq(int core, boolean forceRead) {
    if (forceRead && core > 0)
        while (!Utils.existFile(String.format(Locale.US, CPU_MIN_FREQ, core)))
            activateCore(core, true, null);
    if (Utils.existFile(String.format(Locale.US, CPU_MIN_FREQ, core))) {
        String value = Utils.readFile(String.format(Locale.US, CPU_MIN_FREQ, core));
        if (value != null) return Utils.stringToInt(value);
    }
    return 0;
}
 
Example 3
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getMsmHotplugHistorySize() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_MSM_HISTORY_SIZE));
}
 
Example 4
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getAutoHotplugDisableLoadTreshold() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_AUTO_HOTPLUG_DISABLE_LOAD_THRESHOLD));
}
 
Example 5
Source File: GPU.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static boolean hasGPUMinPowerLevel() {
    if (Utils.existFile(GPU_NUM_POWER_LEVELS)) {
        mGPU_Min_Pwr = Utils.stringToInt(Utils.readFile(GPU_NUM_POWER_LEVELS)) - 1;
    }
        return Utils.existFile(GPU_MIN_POWER_LEVEL);
}
 
Example 6
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getThunderPlughpstyle() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_THUNDER_HP_STYLE));
}
 
Example 7
Source File: Thermal.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getAllowedMaxLow() {
    return Utils.stringToInt(Utils.readFile(CONF_ALLOWED_MAX_LOW));
}
 
Example 8
Source File: CoreControl.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getMaxLittle() {
    return Utils.stringToInt(Utils.readFile(MAXLITTLE));
}
 
Example 9
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getBluPlugUpTimerCnt() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_BLU_PLUG_UP_TIMER_CNT));
}
 
Example 10
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getAutoSmpCpufreqUp() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_AUTOSMP_CPUFREQ_UP));
}
 
Example 11
Source File: Wake.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getDT2WFeatherX() {
    return Utils.stringToInt(Utils.readFile(WAKE_DT2W_FEATHERX));
}
 
Example 12
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getMakoHotplugCoresOnTouch() {
    return Utils.stringToInt(Utils.readFile(MAKO_HOTPLUG_CORES_ON_TOUCH));
}
 
Example 13
Source File: CoreControl.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getMinLittle() {
    return Utils.stringToInt(Utils.readFile(MINLITTLE));
}
 
Example 14
Source File: WakeLock.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getWlanrxWakelockDivider() {
    int value = Utils.stringToInt(Utils.readFile(WLAN_RX_WAKELOCK_DIVIDER));
    if (value == 0) value = 16;
    return value - 1;
}
 
Example 15
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getMBHotplugMaxCpus() {
    return Utils.stringToInt(Utils.readFile(MB_HOTPLUG_MAX_CPUS_FILE));
}
 
Example 16
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getMsmHotplugSuspendDeferTime() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_MSM_SUSPEND_DEFER_TIME));
}
 
Example 17
Source File: CPUHotplug.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getAutoSmpCpufreqDown() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_AUTOSMP_CPUFREQ_DOWN));
}
 
Example 18
Source File: WakeLock.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static int getBCMDHDWakelockDivider() {
    int value = Utils.stringToInt(Utils.readFile(BCMDHD_WAKELOCK_DIVIDER));
    return value - 1;
}
 
Example 19
Source File: Battery.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getChargeLevelControlAC() {
    return Utils.stringToInt(Utils.readFile(AC_CHARGE_LEVEL));
}
 
Example 20
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static int getDynPlugMinOnline() {
    return Utils.stringToInt(Utils.readFile(HOTPLUG_DYN_PLUG_MIN_ONLINE));
}