[Optimus V Android Development] Whyzor:
GPS battery drain bug?

I'm using the 0725 build with kernel r1, running ondemand governor 245-600 CPU. I noticed that after a fresh charge & reboot, the battery drain is extremely well (about 0.5%/hour idling with wifi, GPS, BT all off (Just 3G data on). This accounted for about 14 hours of the graph (Section 1, the dip in the middle was from a speedtest run)

Then when I turned on the GPS, used Mapdroyd to lock location, and turned off the GPS and exited the app, the phone went into a high drain mode. (section 2 of graph). I believe there's a bug in the ROM, kernel, or CM7. If I reboot the phone, it has light drain again (section 3). I made a logcat at the end of section 3, where I turned on GPS, and tried to get location (it never did lock though), then turned off the GPS and the phone went back to the high drain mode (end of section 3). This happened yesterday when I used Google Navigation with GPS too, thought it was an app issue, but today used MapDroyd & exited the app properly. The common component is the GPS.

http://pastebin.com/aRKHUGrH

Is anyone else experiencing this? To reproduce (takes about 2 hours idling):

1. Turn off all phone functions except cell data (or go into airplane mode).

2. Reboot

3. Don't use the phone for 1 hour.

4. Turn on GPS, use an app to lock location, turn off GPS & exit app.

5. Don't use the phone for another hour.

6. Go into Settings - About Phone - Battery Use - Graph

If the most recent 2 hours have different slopes, then this bug is confirmed. I believe the only workaround right now is turning off GPS and rebooting the phone to go back to the low-drain mode.

Here's a 'dumpsys power' from after the GPS toggle, compared to a run before the GPS toggle, it had 'mPowerState=7' and mUserState=7. Not sure what that means.

Power Manager State:
mIsPowered=false mPowerState=3 mScreenOffTime=7779399 ms
mPartialCount=0
mWakeLockState=
mUserState=SCREEN_BRIGHT_BIT SCREEN_ON_BIT
mPowerState=SCREEN_BRIGHT_BIT SCREEN_ON_BIT
mLocks.gather=
mNextTimeout=660872 now=654949 5s from now
mDimScreen=true mStayOnConditions=0
mScreenOffReason=2 mUserState=3
mBroadcastQueue={-1,-1,-1}
mBroadcastWhy={0,0,0}
mPokey=0 mPokeAwakeonSet=false
mKeyboardVisible=false mUserActivityAllowed=true
mKeylightDelay=6000 mDimDelay=47000 mScreenOffDelay=7000
mPreventScreenOn=false mScreenBrightnessOverride=-1 mButtonBrightnessOverride=-1
mScreenOffTimeoutSetting=60000 mMaximumScreenOffTimeout=2147483647
mLastScreenOnTime=7393007
mBroadcastWakeLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mStayOnWhilePluggedInScreenDimLock=UnsynchronizedWakeLock(mFlags=0x6 mCount=0 mHeld=false)
mStayOnWhilePluggedInPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mPreventScreenOnPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mProximityPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mProximityWakeLockCount=0
mProximitySensorEnabled=false
mProximitySensorActive=false
mProximityPendingValue=-1
mLastProximityEventTime=0
mLightSensorEnabled=false
mLightSensorValue=-1.0 mLightSensorPendingValue=-1.0
mLightSensorScreenBrightness=-1 mLightSensorButtonBrightness=-1 mLightSensorKeyboardBrightness=-1
mUseSoftwareAutoBrightness=false
mAutoBrightessEnabled=true
mScreenBrightness: animating=false targetValue=20 curValue=20.0 delta=1.3333334

mLocks.size=0:

mPokeLocks.size=0: