mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-19 23:41:18 +01:00
Added: Init TermuxShellEnvironment at app startup
This will currently cache `TermuxAppShellEnvironment` so that its not regenerated for each shell started since it contains some slightly expensive operations.
This commit is contained in:
parent
150b1ff99c
commit
f76c20d036
2 changed files with 8 additions and 0 deletions
|
|
@ -60,6 +60,9 @@ public class TermuxApplication extends Application {
|
|||
}
|
||||
|
||||
TermuxAmSocketServer.setupTermuxAmSocketServer(context);
|
||||
|
||||
// Init TermuxShellEnvironment constants and caches after everything has been setup including termux-am-socket server
|
||||
TermuxShellEnvironment.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ public class TermuxShellEnvironment extends AndroidShellEnvironment {
|
|||
shellCommandShellEnvironment = new TermuxShellCommandShellEnvironment();
|
||||
}
|
||||
|
||||
/** Init {@link TermuxShellEnvironment} constants and caches. */
|
||||
public synchronized static void init(@NonNull Context currentPackageContext) {
|
||||
TermuxAppShellEnvironment.setTermuxAppEnvironment(currentPackageContext);
|
||||
}
|
||||
|
||||
/** Get shell environment for Termux. */
|
||||
@NonNull
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue