I am writing and testing an android app where I need to restart app on multiple crashes. The restart code works fine, but after 2 crashes the service does not restart, and I see following message in the logs
06-13 02:31:02.098: W/ActivityManager(2117): Service crashed 2 times, stopping: ServiceRecord{42b5b6a0
Looks like service restart after 2 crashes is not being allowed by AcitivityManager.
Is there some API using which we can change this number from 2 to something else ?
A sample app to reproduce this is available here
https://github.com/devendram/servicecrashdemo
Logcat output available here
https://gist.github.com/devendram/5c5259d3f91fd8409e7b#file-gistfile1-txt-L1754