Fix MakePhoneCall in Android 11+
Add the UsesQueries annotation to declare that we make phone calls.
Fixes
@@ -26,6 +26,7 @@ import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.UsesPermissions;
+import com.google.appinventor.components.annotations.UsesQueries;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.EndedStatus;
import com.google.appinventor.components.common.PropertyTypeConstants;
@@ -34,6 +35,10 @@ import com.google.appinventor.components.common.YaVersion;
import com.google.appinventor.components.runtime.util.BulkPermissionRequest;
import com.google.appinventor.components.runtime.util.PhoneCallUtil;
+import com.google.appinventor.components.annotations.androidmanifest.ActionElement;
+import com.google.appinventor.components.annotations.androidmanifest.ActivityElement;
+import com.google.appinventor.components.annotations.androidmanifest.IntentFilterElement;
+
/**
* ![PhoneCall component icon](images/phonecall.png)
*
@@ -80,6 +85,11 @@ import com.google.appinventor.components.runtime.util.PhoneCallUtil;
nonVisible = true,
iconName = "images/phoneCall.png")
@SimpleObject
+@UsesQueries(intents = {
+ @IntentFilterElement(
+ actionElements = {@ActionElement(name = Intent.ACTION_DIAL)}
+ )
+ })
public class PhoneCall extends AndroidNonvisibleComponent implements Component, OnDestroyListener,
ActivityResultListener {
