1
0
mirror of https://github.com/termux/termux-app synced 2024-06-18 07:07:08 +00:00

Fix review findings #2

* fix stop_delay constant
* terminate all appshells with matching name
This commit is contained in:
Christian Landvogt 2024-02-09 20:10:23 +01:00
parent e5299dbb9b
commit 81fb1c1670
2 changed files with 3 additions and 2 deletions

View File

@ -372,8 +372,9 @@ public final class TermuxService extends Service implements AppShell.AppShellCli
int gracePeriod = IntentUtils.getIntegerExtraIfSet(intent, TERMUX_SERVICE.EXTRA_TERMINATE_GRACE_PERIOD, 5000);
AppShell appShell = getTermuxTaskForShellName(shellName);
if (appShell != null) {
while (appShell != null) {
appShell.terminateIfExecuting(getApplicationContext(), gracePeriod, true);
appShell = getTermuxTaskForShellName(shellName);
}
}

View File

@ -1051,7 +1051,7 @@ public final class TermuxConstants {
public static final String EXTRA_RESULT_FILES_SUFFIX = TERMUX_PACKAGE_NAME + ".execute.result_files_suffix"; // Default: "com.termux.execute.result_files_suffix"
/** Intent {@code long} extra for graceperiod between SIGTERM and SIGKILL
* for the TERMUX_SERVICE.ACTION_SERVICE_STOP intent */
public static final String EXTRA_TERMINATE_GRACE_PERIOD = TERMUX_PACKAGE_NAME + ".execute.stop.delay"; // Default: "com.termux.execute.stop.delay"
public static final String EXTRA_TERMINATE_GRACE_PERIOD = TERMUX_PACKAGE_NAME + ".execute.stop_delay"; // Default: "com.termux.execute.stop_delay"