Fix issue where TermuxService was stopped and Termux notification canceled, if background tasks were still running but all sessions had been closed.

This commit is contained in:
agnostic-apollo 2021-04-12 14:43:39 +05:00
parent 24a5493ea5
commit f888f35e35
1 changed files with 1 additions and 7 deletions

View File

@ -555,13 +555,7 @@ public final class TermuxService extends Service implements TermuxTask.TermuxTas
mTermuxSessionClient.termuxSessionListNotifyUpdated();
}
if (mTermuxSessions.isEmpty() && mWakeLock == null) {
// Finish if there are no TermuxSessions left and the wake lock is not held, otherwise keep the service alive if
// holding wake lock since there may be daemon processes (e.g. sshd) running.
requestStopService();
} else {
updateNotification();
}
updateNotification();
}