From 47898e84eafc709e74f13d88ceecde8714dac699 Mon Sep 17 00:00:00 2001 From: jens Date: Thu, 14 Dec 2023 17:46:55 +0100 Subject: [PATCH] Comment added --- app/src/main/java/com/jens/automation2/Actions.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/com/jens/automation2/Actions.java b/app/src/main/java/com/jens/automation2/Actions.java index 1603725..d20eb8e 100644 --- a/app/src/main/java/com/jens/automation2/Actions.java +++ b/app/src/main/java/com/jens/automation2/Actions.java @@ -2286,6 +2286,13 @@ public class Actions public static void startPhoneCall(Context context, String phoneNumber) { + /* + You can use Intent.ACTION_DIAL instead of Intent.ACTION_CALL. + This shows the dialer with the number already entered, but + allows the user to decide whether to actually make the call or not. + ACTION_DIAL does not require the CALL_PHONE permission. + */ + Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + Uri.encode(phoneNumber))); // intent.setClassName("com.android.phone","com.android.phone.OutgoingCallBroadcaster"); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);