• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root LocationManagerService wakelock

ClutchFan

Newbie
Using a Samsung Galaxy S3 Mini on AT&T, rooted

About a week ago, after returning from a trip abroad and having airplane mode active the entire time, my battery life started turning to crap. I did some research and discovered wakelock detector, which led me to LocationManagerService doing a near-constant wakelock. For example right now I'm at:

2h 32 m on battery-
-awake 90%
-Android System = 1h 58m
-- LocationManagerService = 1h 48m

I've done a decent amount of googling and it seems this is a common problem with no real solution.

I've disabled GPS and location services, and I used TiBa to freeze a few worthless system apps, but haven't found the one causing the problem.

I read this page (Et-Setera » Pinpointing Android LocationManagerService Battery Drain) which led me to do a dumpsys command, but I can't make heads or tails of that stuff. I do know that I don't have the same situation as the author of that post - there's no line in my dumpsys reading "mMinTime=0 mMinDistance=0.0"

Can anyone please help me figure this out? I'm going nuts, I use my phone as my alarm clock and the damn thing barely makes it through the night. I miss my dumb phone!
 
Hey ClutchFan, sorry to hear you having problems with your battery drain.

I don't think I'd get hung-up on the "mMinTime=0 mMinDistance=0.0" line that the article referenced since that might not necessarily be your problem (i.e., constant updates), but rather trying to identify the processes that are using the location service.

A couple of notes / observations:

1. I'm guessing that the actual output/format of the dumpsys command has changed since September 2012, since the output I get on my N5 doesn't exactly match / correspond with what the article shows.

I tried firing-up an app that I know should be using the location services, but I was unable to tie their know process-id, package name, or user-id to the output I saw/see in the dumpsys output :(, so it's possible that you can't easily identify a location listener via this article's method anymore :( :dontknow:.

2. You can actually just dump the location service via the "adb shell dumpsys location" command (i.e., vs. doing a full dump). If you don't see anything relevant / interesting in that output, you don't have to wade through all of the other stuff.

3. You might have better luck by continuing to search for user apps that you can freeze to see if they might be culprits (I'd be very careful about freezing your system apps since you could very well get yourself into a sticky situation).

4. I assume you've done a reboot and/or battery pull and restart (if your device has a removable battery that is), but since you didn't say, I thought I'd ask to officially rule that our as a starting point.

Best of luck and sorry I don't have a specific solution for you.

edit/P.S., how would you feel about us moving your thread over to the "Samsung Galaxy S3 Mini on AT&T" all-things-root area?
 
thanks for the suggestions! yea I wouldn't mind moving the thread, I was thinking about posting it there but I wasn't sure if it was better to put it here

anyway, no I haven't pulled the battery but I have rebooted. Should I pull the battery too?

I did a dump location command, not sure if there's a smoking gun here, can you make sense of it?



Current Location Manager state:
Location Listeners:
Reciever[427c5b10 listener UpdateRecord[network LocationManagerService(1000) Request[POWER_LOW network requested=0 fastest=0 num=1]]]
Reciever[429c2ab8 listener UpdateRecord[passive android(1000) Request[POWER_NONE passive fastest=0]]]
Reciever[419e4000 listener UpdateRecord[passive android(1000) Request[POWER_NONE passive fastest=0]]]
Reciever[4226dc58 listener UpdateRecord[passive com.google.android.gms(10022) Request[POWER_NONE passive fastest=0]]]
Records by Provider:
passive:
UpdateRecord[passive android(1000) Request[POWER_NONE passive fastest=0]]
UpdateRecord[passive android(1000) Request[POWER_NONE passive fastest=0]]
UpdateRecord[passive com.google.android.gms(10022) Request[POWER_NONE passive fastest=0]]
network:
UpdateRecord[network LocationManagerService(1000) Request[POWER_LOW network requested=0 fastest=0 num=1]]
Last Known Locations:
Geofences:
Enabled Providers:
passive
fused
mWhitelist=[com.google.android.gms] mBlacklist=[com.google., com.semaphoremobile.zagat.android]
fudger: offset: 88, 258 (meters)
passive Internal State:
mReportLocation=true
gps Internal State:
mFixInterval=1000
mEngineCapabilities=0x0 ()
nullnetwork Internal State (com.google.android.location):
REMOTE SERVICE name=network pkg=com.google.android.location version=1
com.google.android.location
elapsedRealtime 84340069 is time 05-20 22:06:59.263
NLP-Period is currently 2147483647

fused Internal State (com.android.location.fused):
REMOTE SERVICE name=fused pkg=com.android.location.fused version=0
mEnabled=false null
fused=null
gps Location[ 0.000000,0.000000 acc=340282346638529000000000000000000000000 t=?!? et=?!?]
UNAVAILABLE ---
net Location[ 0.000000,0.000000 acc=340282346638529000000000000000000000000 t=?!? et=?!?]
UNAVAILABLE ---
 
ClutchFan,

Yeah, your output looks very similar to mine, but I do see this in your output:

com.semaphoremobile.zagat.android

in the

mWhitelist=[com.google.android.gms] mBlacklist=[com.google., com.semaphoremobile.zagat.android]​

line

Isn't Zagat a restaurant review app? I'd imagine they'd have/use location services in that app, no?

A battery pull might not hurt, but take another scan through your app list again and see if there are any other possible candidates.

Hope that helps!

:)
 
that's weird, I don't have a zagat app, but you're right that's definitely what zagat is.. I looked through my apps but couldn't find anything in particular

Get this though -- in desperation I just tried turning all location services on - GPS, wifi, and I went into google maps and enabled location settings there. I rebooted and let the phone sit for 10 minutes. So far, no locationmanager wakelocks at all! Phone has been awake for 27% instead of 90%.

I'm wondering if the phone was trying to re-establish it's location after I was traveling abroad?

I'm going to disable all location services now (which is how I normally have it set) and see if the wakelocks come back. I'll disable one at a time and reboot between each disable..
 
Hmm, wondering if that (that zagat app) is a pre-installed app? (i.e., by your carrier) :dontknow:

(I did your your thread to the S3 Mini all-things-root area, principally since you mentioned that you had use TiBu to freeze things; I'm guessing that little tidbit might simply be a side note in your eventual debugging and resolution though, so if any other staff thinks it belongs better in the main S3 area or back in the AL, no skin off my nose :))

Lemme know how it goes, ClutchFan--I'm certainly intrigued now :).
 
well I figured it out - I started by disabling GPS and then wifi, with reboots between each and waited 10 minutes then checked wakelock detector. Disabling them didn't trigger the location manager to go nuts.

But when I went into Settings > Location Services and turned off the "access to my location" setting, after a reboot, location manager started doing doing a constant wakelock again.

So I'll just leave location services on, and turn off wifi and GPS when not in use. I believe with those turned off, location services can't really do anything anyway so it's probably the same as disabling it, right? I only disabled it in the first place to save battery life (same as GPS and wifi).

I didn't touch the location setting in google maps, so for now that's enabled. I'm not sure if turning it off will cause the location manager wakelock issue as well
 
Back
Top Bottom