0

Since getRunningServices() was deprecated in Android Oreo and after searching for a while it seems that there is no any other right way to obtain a list of services I' am wondering if it's safe to use this method for my own services and just suppress deprecation warnings. Because documentation says "Note: this method is only intended for debugging or implementing service management type user interfaces."

Ugnius V
  • 25
  • 6
  • Does it even work? [This](https://stackoverflow.com/questions/48506971/how-to-check-if-a-service-is-running-on-android-8-api-26) question mentioned it started returning empty list. – Pawel Sep 04 '18 at 14:19
  • @Pawel It does, but it returns only your own services. Documentation says "As of Build.VERSION_CODES.O, this method is no longer available to third party applications. For backwards compatibility, it will still return the caller's own services." – Ugnius V Sep 04 '18 at 14:28
  • Personally I stopped using it because this method had atrocious performance - but if you feel like service connection does not fill your requirements I don't see why not to use it. – Pawel Sep 04 '18 at 14:56

0 Answers0