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

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#hasProp() . 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: Thermal.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static boolean hasThermald() {
    return Utils.hasProp(THERMALD);
}
 
Example 2
Source File: CPUHotplug.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static boolean hasMpdecision() {
    return Utils.hasProp(HOTPLUG_MPDEC);
}
 
Example 3
Source File: Thermal.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static boolean hasThermald() {
    return Utils.hasProp(THERMALD);
}
 
Example 4
Source File: Thermald.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static boolean supported() {
    return Utils.hasProp(THERMALD);
}
 
Example 5
Source File: MPDecision.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static boolean supported() {
    return Utils.hasProp(HOTPLUG_MPDEC);
}
 
Example 6
Source File: ApplyOnBoot.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
private static List<String> getApplyCpu(CPUFreq.ApplyCpu applyCpu, RootUtils.SU su, Context context) {
    List<String> commands = new ArrayList<>();
    boolean cpulock = Utils.existFile(CPUFreq.CPU_LOCK_FREQ, su);
    if (cpulock) {
        commands.add(Control.write("0", CPUFreq.CPU_LOCK_FREQ));
    }
    boolean mpdecision = Utils.hasProp(MPDecision.HOTPLUG_MPDEC, su)
            && Utils.isPropRunning(MPDecision.HOTPLUG_MPDEC, su);
    if (mpdecision) {
        commands.add(Control.stopService(MPDecision.HOTPLUG_MPDEC));
    }
    for (int i = applyCpu.getMin(); i <= applyCpu.getMax(); i++) {
        boolean offline = !Utils.existFile(Utils.strFormat(applyCpu.getPath(), i), su);

        List<Integer> bigCpuRange = applyCpu.getBigCpuRange();
        List<Integer> LITTLECpuRange = applyCpu.getLITTLECpuRange();
        String coreCtlMinPath = null;
        String msmPerformanceMinPath = null;
        if (offline) {

            if (applyCpu.isBigLITTLE()) {
                if (Utils.existFile(Utils.strFormat(CoreCtl.CORE_CTL, i), su)) {
                    coreCtlMinPath = Utils.strFormat(CoreCtl.CORE_CTL + CoreCtl.MIN_CPUS, i);
                    commands.add(Control.write(String.valueOf(bigCpuRange.size()), coreCtlMinPath));
                }

                if (Utils.existFile(MSMPerformance.MAX_CPUS, su)) {
                    msmPerformanceMinPath = MSMPerformance.MAX_CPUS;
                    commands.add(Control.write(LITTLECpuRange.size() + ":" + bigCpuRange.size(),
                            msmPerformanceMinPath));
                }
            }

            commands.add(Control.write("1", Utils.strFormat(CPUFreq.CPU_ONLINE, i)));
        }
        commands.add(Control.chmod("644", Utils.strFormat(applyCpu.getPath(), i)));
        commands.add(Control.write(applyCpu.getValue(), Utils.strFormat(applyCpu.getPath(), i)));
        commands.add(Control.chmod("444", Utils.strFormat(applyCpu.getPath(), i)));
        if (offline) {

            if (coreCtlMinPath != null) {
                commands.add(Control.write(String.valueOf(context == null ?
                                CPUFreq.getInstance().mCoreCtlMinCpu :
                                AppSettings.getCoreCtlMinCpusBig(context)),
                        coreCtlMinPath));
            }
            if (msmPerformanceMinPath != null) {
                commands.add(Control.write("-1:-1", msmPerformanceMinPath));
            }

            commands.add(Control.write("0", Utils.strFormat(CPUFreq.CPU_ONLINE, i)));
        }
    }
    if (mpdecision) {
        commands.add(Control.startService(MPDecision.HOTPLUG_MPDEC));
    }
    if (cpulock) {
        commands.add(Control.write("1", CPUFreq.CPU_LOCK_FREQ));
    }
    return commands;
}