I'm using location
& activity recognition
features of android. Used for realtime location tracking. Currently using the latest ConnectionLess
APIs. I have encountered the following problem:
After starting the location, activity services, once in a while, the battery starts to get drained. The behavior is pretty strange as the entire drain is showed under Google Play Services
. The drain persists even if the app is stopped, killed, etc. To my surprise, the drain persisted even when the app was uninstalled and it took a couple of full battery re-charges to come out of the situation.
I'm more or less sure that the drain is triggered by my app as multiple devices have recorded the issue and these devices are from different manufacturers and across multiple android OS versions. In ADB shell, I find com.google.android.gms
taking up 126% CPU permanently as seen below:
Next, I listed all the threads under that process. Result attached below:
As seen there's one thread, CastSocketMulti
running. All other threads are sleeping.Didn't get much on castSocketMulti
other than some basic information like it is related to casting in android, etc. We aren't using anything related to casting in our app.
After, killing the process, the drain stops. Note: I found same question here, however unanswered.
Edit: Every time the battery drain happens, as above, com.google.android.gms
is listed as the number one process taking 100%+ CPU and the castSocketMulti
, the only thread of that process in R
status
Update: I have opened an issue here. Pls leave a star so that it may go high on priority