Skip to content
This repository was archived by the owner on Oct 5, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ protected void addItems(List<RecyclerViewItem> items) {
if (Misc.hasCpuTouchBoost()) {
cpuTouchBoostInit(items);
}
if (Misc.hascpuinputboost()) {
cpuinputboostInit(items);
}
}

private void freqInit(List<RecyclerViewItem> items) {
Expand Down Expand Up @@ -529,6 +532,23 @@ private void cpuTouchBoostInit(List<RecyclerViewItem> items) {
items.add(touchBoost);
}

private void cpuinputboostInit(List<RecyclerViewItem> items) {
if (Misc.hascpuinputboost()) {
SwitchView cpuinputboost = new SwitchView();
cpuinputboost.setTitle(getString(R.string.cpu_input_boost));
cpuinputboost.setSummary(getString(R.string.cpu_input_boost_summary));
cpuinputboost.setChecked(Misc.iscpuinputboostEnabled());
cpuinputboost.addOnSwitchListener(new SwitchView.OnSwitchListener() {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
Misc.enablecpuinputboost(isChecked, getActivity());
}
});

items.add(cpuinputboost);
}
}

private float[] mCPUUsages;
private boolean[] mCPUStates;
private int[] mCPUFreqs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class Misc {
private static final String CPU_QUIET_CURRENT_GOVERNOR = CPU_QUIET + "/current_governor";

private static final String CPU_TOUCH_BOOST = "/sys/module/msm_performance/parameters/touchboost";
private static final String CPU_INPUT_BOOST = "/sys/kernel/cpu_input_boost/enabled";

private static String[] sAvailableCFSSchedulers;
private static String[] sCpuQuietAvailableGovernors;
Expand All @@ -62,6 +63,18 @@ public static boolean hasCpuTouchBoost() {
return Utils.existFile(CPU_TOUCH_BOOST);
}

public static void enablecpuinputboost(boolean enable, Context context) {
run(Control.write(enable ? "1" : "0", CPU_INPUT_BOOST), CPU_INPUT_BOOST, context);
}

public static boolean iscpuinputboostEnabled() {
return Utils.readFile(CPU_INPUT_BOOST).equals("1");
}

public static boolean hascpuinputboost() {
return Utils.existFile(CPU_INPUT_BOOST);
}

public static void setCpuQuietGovernor(String value, Context context) {
run(Control.write(value, CPU_QUIET_CURRENT_GOVERNOR), CPU_QUIET_CURRENT_GOVERNOR, context);
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@
<string name="hotplug_boost_summary">Hotplug Boost is similar to input boost but it occurs when CPUs go online.</string>
<string name="touch_boost">Touch Boost</string>
<string name="touch_boost_summary">This will boost your minimum CPU speed if you touch the screen or press a button.</string>
<string name="cpu_input_boost">CPU Input Boost</string>
<string name="cpu_input_boost_summary">Enable CPU Input Boost developed by Sultanxda.</string>

<!-- CPU Voltage -->
<string name="global_offset">Global Offset</string>
Expand Down