mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-16 05:51:15 +01:00
TermuxSession, TermuxTask and TermuxSessionClientBase have been moved to termux-shared. They are now not dependent on TermuxService anymore and have become abstract so that they can be called from anywhere. TermuxSession.TermuxSessionClient and TermuxTask.TermuxTaskClient interfaces have been created for callbacks, which the TermuxService now implements. The TermuxTask now also supports synchronous command execution as well to run shell commands from anywhere for internal use by termux app and its plugins. TermuxTask now also supports killing the process being run by sending it a SIGKILL. This is used by TermuxService to kill all the TermuxTasks (in addition to TermuxSessions) it manages when it is destroyed, either by user exiting it or by android killing it. Only the tasks that were started by a plugin which **expects** the result back via a pending intent will be killed, but the remaining background tasks will keep on running until the termux app process is killed by android, like by OOM. Check TermuxService.killAllTermuxExecutionCommands() for more details on how TermuxService kills TermuxTasks and TermuxSessions. Fixed null pointer exception when getting terminal transcript if TerminalEmulator not initialized.
71 lines
1.6 KiB
Java
71 lines
1.6 KiB
Java
package com.termux.shared.shell;
|
|
|
|
import com.termux.shared.logger.Logger;
|
|
import com.termux.terminal.TerminalSession;
|
|
import com.termux.terminal.TerminalSessionClient;
|
|
|
|
public class TermuxSessionClientBase implements TerminalSessionClient {
|
|
|
|
public TermuxSessionClientBase() {
|
|
}
|
|
|
|
@Override
|
|
public void onTextChanged(TerminalSession changedSession) {
|
|
}
|
|
|
|
@Override
|
|
public void onTitleChanged(TerminalSession updatedSession) {
|
|
}
|
|
|
|
@Override
|
|
public void onSessionFinished(final TerminalSession finishedSession) {
|
|
}
|
|
|
|
@Override
|
|
public void onClipboardText(TerminalSession session, String text) {
|
|
}
|
|
|
|
@Override
|
|
public void onBell(TerminalSession session) {
|
|
}
|
|
|
|
@Override
|
|
public void onColorsChanged(TerminalSession changedSession) {
|
|
}
|
|
|
|
@Override
|
|
public void logError(String tag, String message) {
|
|
Logger.logError(tag, message);
|
|
}
|
|
|
|
@Override
|
|
public void logWarn(String tag, String message) {
|
|
Logger.logWarn(tag, message);
|
|
}
|
|
|
|
@Override
|
|
public void logInfo(String tag, String message) {
|
|
Logger.logInfo(tag, message);
|
|
}
|
|
|
|
@Override
|
|
public void logDebug(String tag, String message) {
|
|
Logger.logDebug(tag, message);
|
|
}
|
|
|
|
@Override
|
|
public void logVerbose(String tag, String message) {
|
|
Logger.logVerbose(tag, message);
|
|
}
|
|
|
|
@Override
|
|
public void logStackTraceWithMessage(String tag, String message, Exception e) {
|
|
Logger.logStackTraceWithMessage(tag, message, e);
|
|
}
|
|
|
|
@Override
|
|
public void logStackTrace(String tag, Exception e) {
|
|
Logger.logStackTrace(tag, e);
|
|
}
|
|
|
|
}
|