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

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#isPropRunning() . 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: Thermald.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isThermaldEnabled() {
    return Utils.isPropRunning(THERMALD);
}
 
Example 2
Source File: MPDecision.java    From KernelAdiutor with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isMpdecisionEnabled() {
    return Utils.isPropRunning(HOTPLUG_MPDEC);
}
 
Example 3
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;
}