Enable/Disable Location Service Setting
The location service (Settings > Location and Security > "Use Wireless Networks) is a major power hog. It polls for your location every minute. I would like to be able to enable/disable this service based on conditions (at work or home: disable). The preference is LocationManager.NETWORK_PROVIDER (I believe), can this be done?
This setting cannot be configured by third party apps such as Locale. This is because the location providers are secured settings, which only Android itself is allowed to change.
I think you might have some incorrect information regarding battery usage. The Android network location provider uses almost 0 power. Regardless of how frequently it updates, it uses information that is already available to the phone, such as which tower the device is connected to. Since that information is already available, the cost of the network location provider is almost free.
2 comments
-
jsimbol
commented
Carter,
While I believe the first part of your response (after looking into it), I still have to disagree about the power issue. Watch the logcat output of the phone for a few minutes while the screen is turned off and nothing is being used up front (wifi and gos can be turned off too). You'll see every minute that the OS issues a wakelock, does an injectGPSposition and then goes back to sleep. "D/libgps ( 1131): GpsInterface_inject_location( 41.xxxxx, −72.xxxxx, 3510.000)" The total of those calls is killing battery.
If you disable the location service (uncheck "use wireless networks") then the polling completely stops, the "partial wake usage" of the OS goes way down and battery life goes up. -
jsimbol
commented
Carter,
While I believe the first part of your response (after looking into it), I still have to disagree about the power issue. Watch the logcat output of the phone for a few minutes while the screen is turned off and nothing is being used up front (wifi and gos can be turned off too). You'll see every minute that the OS issues a wakelock, does an injectGPSposition and then goes back to sleep. "D/libgps ( 1131): GpsInterface_inject_location( 41.xxxxx, −72.xxxxx, 3510.000)" The total of those calls is killing battery.
If you disable the location service (uncheck "use wireless networks") then the polling completely stops, the "partial wake usage" of the OS goes way down and battery life goes up.