diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-09-10 18:43:00 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-09-13 14:20:48 -0700 |
commit | 7e9f4eb2608148436cef36c9969bf8a599b39e72 (patch) | |
tree | 16351bff3017f948792a6308f4f6698e0a9d769c /core/res | |
parent | cc5494c9996f809e36539b24e8b6b67683383d29 (diff) | |
download | frameworks_base-7e9f4eb2608148436cef36c9969bf8a599b39e72.zip frameworks_base-7e9f4eb2608148436cef36c9969bf8a599b39e72.tar.gz frameworks_base-7e9f4eb2608148436cef36c9969bf8a599b39e72.tar.bz2 |
Track client requests through location manager.
This fixes a problem where applications could ask the location
manager to do very heavy-weight things (like... say... update
location every minute), which would get accounted against the
system instead of the application because ultimately it is the
system making the heavy calls (wake locks, etc).
To solve this, we introduce a new class WorkSource representing
the source of some work. Wake locks and Wifi locks allow you
to set the source to use (but only if you are system code and thus
can get the permission to do so), which is what will be reported
to the battery stats until the actual caller.
For the initial implementation, the location manager keeps track
of all clients requesting periodic updates, and tells its providers
about them as a WorkSource param when setting their min update time.
The network location provider uses this to set the source on the
wake and wifi locks it acquires, when doing work because of the
update period.
This should also be used elsewhere, such as in the GPS provider,
but this is a good start.
Change-Id: I2b6ffafad9e90ecf15d7c502e2db675fd52ae3cf
Diffstat (limited to 'core/res')
-rw-r--r-- | core/res/AndroidManifest.xml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index a9e4971..9b9b4be 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -930,7 +930,7 @@ <permission android:name="android.permission.UPDATE_DEVICE_STATS" android:label="@string/permlab_batteryStats" android:description="@string/permdesc_batteryStats" - android:protectionLevel="signature" /> + android:protectionLevel="signatureOrSystem" /> <!-- Allows an application to open windows that are for use by parts of the system user interface. Not for use by third party apps. --> |