mirror of
https://github.com/termux/termux-app
synced 2024-06-23 09:37:08 +00:00
Changed: Update TERMUX_APP__AM_SOCKET_SERVER_ENABLED
environment variable value if termux-am-socket
server state changes
This commit is contained in:
parent
afc06cfd0a
commit
ebdab0e59c
|
@ -92,6 +92,7 @@ public class TermuxAmSocketServer {
|
|||
// exported in shell sessions and tasks and if state is changed, then env of older shells will
|
||||
// retain invalid value. User should force stop the app to update state after changing prop.
|
||||
TERMUX_APP_AM_SOCKET_SERVER_ENABLED = enabled;
|
||||
TermuxAppShellEnvironment.updateTermuxAppAMSocketServerEnabled(context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -161,4 +161,12 @@ public class TermuxAppShellEnvironment {
|
|||
}
|
||||
}
|
||||
|
||||
/** Update {@link #ENV_TERMUX_APP__AM_SOCKET_SERVER_ENABLED} value in {@code environment}. */
|
||||
public synchronized static void updateTermuxAppAMSocketServerEnabled(@NonNull Context currentPackageContext) {
|
||||
if (termuxAppEnvironment == null) return;
|
||||
termuxAppEnvironment.remove(ENV_TERMUX_APP__AM_SOCKET_SERVER_ENABLED);
|
||||
ShellEnvironmentUtils.putToEnvIfSet(termuxAppEnvironment, ENV_TERMUX_APP__AM_SOCKET_SERVER_ENABLED,
|
||||
TermuxAmSocketServer.getTermuxAppAMSocketServerEnabled(currentPackageContext));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user