0

i'm currently working on Android APP that acts as Default Dialer App in voice calls. The app has a service running in background, The fact is that once i changed from my app default dialer to Phone or "Stock Dialer App" my app is killed.

So the steps were: 1) My app set as Dialer App, 2) I went to Settings > Application > Manage Apps > Default Apps 3) Changing dialer from MYAPp to Phone app (default Android App) and then my app with his service being killed without crashes or relevant informations.

If anyone has suggestions about this is my hero C:

PiotrCa
  • 21
  • 1
  • 1
  • 5
  • What exactly is the problem? Is your `Service` set up to restart after being killed? Do you want to know why Android is killing the app? Please be more specific about what you want to know. – David Wasser Apr 20 '22 at 09:00
  • Service is set up to restart but this don't happen and then i want to know why android is killing app in order to avoid it. – PiotrCa Apr 20 '22 at 09:04
  • What devices are you using? There are some devices where you need to whitelist your app so that it will be restarted or allowed to run in the background. – David Wasser Apr 20 '22 at 09:56
  • It is possible that Android kills off the dialer app intentionally when you switch to another default dialer. If this is the case, you probably can't do anything to prevent this. I would try running the `Service` in a different OS process from your dialer app activities. In that case maybe Android will only kill off the OS process hosting the activities and leave your `Service` process alone. Try that and see what happens. – David Wasser Apr 20 '22 at 10:02
  • I'm using a Xiaomi Mi10 but this also happens on other android devices running Android >= 8 (my target). @DavidWasser so, u are suggesting to indicaate my default dialer as a certain activity of my app, so in case will be killed only the chosen activity as default dialer? (Actually I'm using the entire app trough his package name). Is it possible to choose a certain activity? – PiotrCa Apr 20 '22 at 13:26
  • Edit your question and post your manifest in the question. Basically, using `android:process=":foobar"` in the `` declaration will cause your `Service` to be hosted in a different OS process than the activities. This may fix your issue. – David Wasser Apr 20 '22 at 15:21
  • Excuse me for the late answer, the solution that you're proposing is not eligible at moment, i noticed that giving "call logs" and "sms" permissions to my app, this issue doesn't happen anymore, it's a weirdo thing, i can't explain this. I'll keep on searching for another solution in logcat to catch what OS is doing. – PiotrCa Apr 22 '22 at 09:33
  • [https://support.google.com/googleplay/android-developer/answer/10208820?visit_id=637862169088958335-2564127419&rd=1&hl=en-GB#intended&zippy=%2Cusi-consentiti-delle-autorizzazioni-sms-e-registro-chiamate%2Cpermitted-uses-of-the-sms-and-call-log-permissions] to anyone has my issue, it seems like set default dialer app includes authorizations to send sms, write and read call logs. – PiotrCa Apr 22 '22 at 10:23

0 Answers0