From 2c5534e2c1fc90ee2cd35099b39151b45d6ebc52 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Tue, 9 Jun 2020 16:06:56 +0300 Subject: [PATCH] RunCommandService: update information about usage --- .../java/com/termux/app/RunCommandService.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/termux/app/RunCommandService.java b/app/src/main/java/com/termux/app/RunCommandService.java index d3a601f2..42174657 100644 --- a/app/src/main/java/com/termux/app/RunCommandService.java +++ b/app/src/main/java/com/termux/app/RunCommandService.java @@ -18,17 +18,15 @@ import java.util.Properties; * When allow-external-apps property is set to "true", Termux is able to process execute intents * sent by third-party applications. * - * Third-party program must declare com.termux.permission.RUN_COMMAND permission. + * Third-party program must declare com.termux.permission.RUN_COMMAND permission and it should be + * granted by user. * - * Intent expects following configuration: - * - * Action: com.termux.RUN_COMMAND - * Program/script path (string): com.termux.RUN_COMMAND_PATH - * Program/script arguments (string): com.termux.RUN_COMMAND_ARGUMENTS - * Session working directory (string): com.termux.RUN_COMMAND_WORKDIR - * - * Sample intent for launching program "top" in equivalent of ADB command: - * am startservice -a com.termux.RUN_COMMAND --es com.termux.RUN_COMMAND_PATH /data/data/com.termux/files/usr/bin/top + * Sample code to run command "top": + * Intent intent = new Intent(); + * intent.setClassName("com.termux", "com.termux.app.RunCommandService"); + * intent.setAction("com.termux.RUN_COMMAND"); + * intent.putExtra("com.termux.RUN_COMMAND_PATH", "/data/data/com.termux/files/usr/bin/top"); + * startService(intent); */ public class RunCommandService extends Service {