Page 1 of 1

Launch Default Apps

Posted: 13 Jun 2019 20:56
by Pepy
Is there a way I can launch the assigned default apps? Specifically, I would like to open my default Phone app to go back to the calling screen after leaving the app during the middle of a call.
I would prefer doing it this way since I won't have to update the corresponding Launch App action as well every time I change the default app.
I'm guessing the way to achieve this would probably be to send a key combination using the Automagic keyboard but I don't think there is a key on keyboards dedicated to opening up the Phone app.

Re: Launch Default Apps

Posted: 14 Jun 2019 02:15
by anuraag

Code: Select all

ctx=getContext();
tm=callJavaMethod(ctx, "android.content.Context", "getSystemService(java.lang.String)", "telecom");
defaultDialer=callJavaMethod(tm, "android.telecom.TelecomManager", "getDefaultDialerPackage()")
Use above code in a script action. defaultDialer will contain default dialer package name. Set Launch App Package Name to Variable defaultDialer.

Re: Launch Default Apps

Posted: 14 Jun 2019 22:22
by Pepy
I ended up using a Notification on Statusbar Displayed condition to toggle the speakerphone via an action button on an "on-going call" notification so the package name wasn't necessary anymore.
Thanks for the code though, it will definitely prove to be useful in the future!