Skip to content

Commit

Permalink
Tasker: Run receiver commands inside a thread
Browse files Browse the repository at this point in the history
Signed-off-by: Lennoard <lennoardrai@gmail.com>
  • Loading branch information
Lennoard authored and sunilpaulmathew committed Apr 29, 2020
1 parent be05bda commit 8899a8f
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit 8899a8f

Please sign in to comment.