diff --git a/app/src/main/java/com/jens/automation2/Actions.java b/app/src/main/java/com/jens/automation2/Actions.java index 3021ce0..52fcd6b 100644 --- a/app/src/main/java/com/jens/automation2/Actions.java +++ b/app/src/main/java/com/jens/automation2/Actions.java @@ -2287,7 +2287,18 @@ public class Actions public static void startPhoneCall(Context context, String phoneNumber) { - Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + Uri.encode(phoneNumber))); + Intent intent; + + /* + Bug in Android 14 makes it necessary to add double quotes around MMI code. + More precisely it's required for codes containing the # character. + */ + + if(Build.VERSION.SDK_INT >= 34) + intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + Uri.encode("\"" + phoneNumber + "\""))); + else + 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); intent.addFlags(Intent.FLAG_FROM_BACKGROUND);