I currently have an application that uses android's TelecomManager to implement calls on a custom interface on a tablet. When accepting a call via addNewIncomingCall, a pop-up of the default android phone call interface loads in front of the app interface. The first two solutions I tried after looking at the TelecomManager documentation, setting the TelecomManager.METADATA_IN_CALL_SERVICE_UI flag and calling the showInCallScreen(false) function, don't do anything. Nothing else in the documentation seems like it would do what I'm trying to do. Am I missing something here? What's the correct way to either hide or exit this screen automatically?
Asked
Active
Viewed 69 times
1 Answers
0
Have you tried setting your app as the default Phone app in the device settings?

user496854
- 6,461
- 10
- 47
- 84
-
The default app settings on this device doesn't have a phone section, probably because it's a tablet. I've tried to set the activity as the default phone app in AndroidManifest, but that isn't working either. – Jacob Z Oct 21 '22 at 20:06
-
In that case, there shouldn't be a phone app installed either, so how would the default Phone Call interface even come up? That's a part of the default Google Phone (or your manufacturer's phone app). Did you install that app on your tablet? And if that's the case, uninstall it, and see what happens – user496854 Oct 22 '22 at 04:00
-
I can't delete the pre-installed phone app, and the default apps screen still does not have a tab for "calls", just "Browser app", "Digital assistant app", "Home app" and "Opening Links". I can post screenshots if you don't believe me. Deleting the phone app is a bit hacky and not something I can expect all of my end users to do anyway. Maybe I should rephrase the question, is there any way I can automatically change the visibility of this window, or the priority it has relative to my app? When I close the call in my app it also closes the popup, so just making it invisible would also work – Jacob Z Oct 23 '22 at 17:50
-
You can make sure that you followed all of the steps in this guide: https://www.gsrikar.com/2019/02/set-android-app-default-dialer.html, which shows how to make an app the default Phone App. At the end, it has an intent that launches the user choice dialog to have them set your app as the default – user496854 Oct 23 '22 at 21:28
-
What is the setPhoneDefault() function in this article? – Jacob Z Oct 27 '22 at 14:45
-
It's the code segment that calls te ACTION_CHANGE_DEFAULT_DIALER intent – user496854 Oct 27 '22 at 23:03
-
Apologies for the late response, this project ended up getting sidelined for some other things but the fact that I never figured this out is still bothering me. startActivityForResult has been depreciated and I'm not sure how to work around that. My current attempt at just using startActivity: `context.startActivity(new Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER).putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME,context.getPackageName()));` Is still resulting in a null result to telecomManager.getDefaultDialerPackage(); – Jacob Z Nov 10 '22 at 20:27