diff --git a/app/src/main/java/com/smartpack/kernelmanager/services/profile/Tasker.java b/app/src/main/java/com/smartpack/kernelmanager/services/profile/Tasker.java index 4731f817d..57ec901f4 100644 --- a/app/src/main/java/com/smartpack/kernelmanager/services/profile/Tasker.java +++ b/app/src/main/java/com/smartpack/kernelmanager/services/profile/Tasker.java @@ -64,25 +64,26 @@ public void onReceive(Context context, Intent intent) { } if (cs.length > 1) { - for (int i = 1; i < cs.length; i++) { - if (cs[i].isEmpty()) { - continue; - } - synchronized (this) { - CPUFreq.ApplyCpu applyCpu; - if (cs[i].startsWith("#") && (applyCpu = - new CPUFreq.ApplyCpu(cs[i].substring(1))).toString() != null) { - for (String applyCpuCommand : ApplyOnBoot.getApplyCpu(applyCpu)) { - Log.i(TAG + ": " + getClass().getSimpleName(), "Run: " + applyCpuCommand); - RootUtils.runCommand(applyCpuCommand); + new Thread(() -> { + for (int i = 1; i < cs.length; i++) { + if (cs[i].isEmpty()) { + continue; + } + synchronized (this) { + CPUFreq.ApplyCpu applyCpu = new CPUFreq.ApplyCpu(cs[i].substring(1)); + if (cs[i].startsWith("#") && !applyCpu.toString().isEmpty()) { + for (String applyCpuCommand : ApplyOnBoot.getApplyCpu(applyCpu)) { + Log.i(TAG + ": " + getClass().getSimpleName(), "Run: " + applyCpuCommand); + RootUtils.runCommand(applyCpuCommand); + } + } else { + Log.i(TAG + ": " + getClass().getSimpleName(), "Run: " + cs[i]); + RootUtils.runCommand(cs[i]); } - } else { - Log.i(TAG + ": " + getClass().getSimpleName(), "Run: " + cs[i]); - RootUtils.runCommand(cs[i]); } } - } - RootUtils.closeSU(); + RootUtils.closeSU(); + }).start(); } } }