这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit becc67c

Browse files
Fixed: Fix background tasks not working for older versions of Termux app that did not support TERMUX_SERVICE.EXTRA_RUNNER due to 10cc047
Closes #118
1 parent 1c0912d commit becc67c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/java/com/termux/tasker/FireReceiver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ public void onReceive(final Context context, final Intent intent) {
190190
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_STDIN, executionCommand.stdin);
191191
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_SESSION_ACTION, executionCommand.sessionAction);
192192
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_BACKGROUND_CUSTOM_LOG_LEVEL, DataUtils.getStringFromInteger(executionCommand.backgroundCustomLogLevel, null));
193-
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_RUNNER, executionCommand.runner);
193+
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_RUNNER, executionCommand.runner); // Runner extra will be prioritized over background extra.
194+
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_BACKGROUND, ExecutionCommand.Runner.APP_SHELL.getName().equals(executionCommand.runner)); // Backward compatibility for runner.
194195
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_PLUGIN_API_HELP, context.getString(R.string.plugin_api_help, TermuxConstants.TERMUX_TASKER_GITHUB_REPO_URL));
195196

196197
// Send execution intent to TERMUX_SERVICE

0 commit comments

Comments
 (0)