[Android Software/Hacking General [Developers Only]] arpruss:
I've been annoyed by Google Maps' NetworkLocationPassiveCollector, NetworkLocationBurstCollector and NetworkLocationActiveCollector wakelocks, which I think are used to collect location data when the device is asleep. I am not objecting to Google collecting this data, but I am objecting to their keeping my device up and running down battery to collect it. To that end, I've been working on a wakelock killer.

If you want to kill network location altogether, you can just disable it in your system settings and maybe then you don't need to bother my wake lock killing. But I like the idea of network location.

My initial experiment is a purely commandline beast. Download this (source included, of course; you may use it under the simpler BSD license). Install notify_wake_lock in /data/local (say), and do (from a terminal emulator, adb shell, or a script):

su
chmod 755 /data/local/notify_wake_lock
/data/local/notify_wake_lock &

What this does is watch for the three wake locks, and one is set, it releases it within a second. This uses the inotify API rather than polling. I don't know what resource usage it adds--you are welcome to collect and report data.

To terminate the wakelock killer, do:

su
killall notify_wake_lock

If something goes wrong, just reboot.

For fuller Google Maps taming, you might want to disable some of the background processes associated with the network location:

su
pm disable com.google.android.apps.maps/com.google.googlenav.networkinitiated.NetworkInitiatedService
pm disable com.google.android.apps.maps/com.google.googlenav.networkinitiated.NetworkInitiatedReceiver

Disabling these two processes still allows network location to work on demand, but it may decrease what happens in the background.

And of course killing Latitude completely may be a good idea:

su
pm disable com.google.android.apps.maps/com.google.googlenav.friend.android.ServiceReceiver
pm disable com.google.android.apps.maps/com.google.googlenav.friend.android.LocationFriendService
pm disable com.google.android.apps.maps/com.google.googlenav.friend.reporting.LocationReceiverService
pm disable com.google.android.apps.maps/com.google.googlenav.friend.reporting.LocationReportingService
pm disable com.google.android.apps.maps/com.google.googlenav.friend.checkins.CheckinNotificationService
pm disable com.google.android.apps.maps/com.google.googlenav.friend.reporting.LocationReportingIntentReceiver
pm disable com.google.android.apps.maps/com.google.googlenav.appwidget.friends.FriendsAppWidgetUpdateService
pm disable com.google.android.apps.maps/com.google.googlenav.friend.history.LocationHistoryIntentReceiver
pm disable com.google.android.apps.maps/com.google.googlenav.friend.reporting.LocationPrivacyService
pm disable com.google.android.apps.maps/com.google.googlenav.friend.OptInIntentService
pm disable com.google.android.apps.maps/com.google.googlenav.appwidget.friends.FriendsAppWidgetProvider
pm disable com.google.android.apps.maps/com.google.android.maps.LatitudeActivity

(The last of these removes the icon for it from your apps listing.)

These pm disable settings survive a reboot. If you change your mind about these, you need to do them again with "enable" in place of "disable".