mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-03 07:31:09 +01:00
Use constant for intent extra key
This commit is contained in:
parent
34afb9de43
commit
4c93cb42f1
1 changed files with 2 additions and 1 deletions
|
|
@ -58,6 +58,7 @@ public final class TermuxService extends Service implements SessionChangedCallba
|
||||||
public static final String EXTRA_ARGUMENTS = "com.termux.execute.arguments";
|
public static final String EXTRA_ARGUMENTS = "com.termux.execute.arguments";
|
||||||
|
|
||||||
public static final String EXTRA_CURRENT_WORKING_DIRECTORY = "com.termux.execute.cwd";
|
public static final String EXTRA_CURRENT_WORKING_DIRECTORY = "com.termux.execute.cwd";
|
||||||
|
private static final String EXTRA_EXECUTE_IN_BACKGROUND = "com.termux.execute.background";
|
||||||
|
|
||||||
/** This service is only bound from inside the same process and never uses IPC. */
|
/** This service is only bound from inside the same process and never uses IPC. */
|
||||||
class LocalBinder extends Binder {
|
class LocalBinder extends Binder {
|
||||||
|
|
@ -126,7 +127,7 @@ public final class TermuxService extends Service implements SessionChangedCallba
|
||||||
String[] arguments = (executableUri == null ? null : intent.getStringArrayExtra(EXTRA_ARGUMENTS));
|
String[] arguments = (executableUri == null ? null : intent.getStringArrayExtra(EXTRA_ARGUMENTS));
|
||||||
String cwd = intent.getStringExtra(EXTRA_CURRENT_WORKING_DIRECTORY);
|
String cwd = intent.getStringExtra(EXTRA_CURRENT_WORKING_DIRECTORY);
|
||||||
|
|
||||||
if (intent.getBooleanExtra("com.termux.execute.background", false)) {
|
if (intent.getBooleanExtra(EXTRA_EXECUTE_IN_BACKGROUND, false)) {
|
||||||
BackgroundJob task = new BackgroundJob(cwd, executablePath, arguments, this);
|
BackgroundJob task = new BackgroundJob(cwd, executablePath, arguments, this);
|
||||||
mBackgroundTasks.add(task);
|
mBackgroundTasks.add(task);
|
||||||
updateNotification();
|
updateNotification();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue