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 /api | |
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 'api')
-rw-r--r-- | api/current.xml | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/api/current.xml b/api/current.xml index d2e1f05..d1dfc09 100644 --- a/api/current.xml +++ b/api/current.xml @@ -84326,6 +84326,8 @@ > <parameter name="uid" type="int"> </parameter> +<parameter name="ws" type="android.os.WorkSource"> +</parameter> </method> <method name="onDisable" return="void" @@ -84455,6 +84457,8 @@ > <parameter name="uid" type="int"> </parameter> +<parameter name="ws" type="android.os.WorkSource"> +</parameter> </method> <method name="onRequiresCell" return="boolean" @@ -84516,6 +84520,8 @@ > <parameter name="minTime" type="long"> </parameter> +<parameter name="ws" type="android.os.WorkSource"> +</parameter> </method> <method name="onSupportsAltitude" return="boolean" @@ -101636,6 +101642,19 @@ <parameter name="refCounted" type="boolean"> </parameter> </method> +<method name="setWorkSource" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="ws" type="android.os.WorkSource"> +</parameter> +</method> </class> </package> <package name="android.opengl" @@ -128447,6 +128466,19 @@ <parameter name="value" type="boolean"> </parameter> </method> +<method name="setWorkSource" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="ws" type="android.os.WorkSource"> +</parameter> +</method> </class> <class name="Process" extends="java.lang.Object" @@ -129595,6 +129627,134 @@ </parameter> </method> </class> +<class name="WorkSource" + extends="java.lang.Object" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<implements name="android.os.Parcelable"> +</implements> +<constructor name="WorkSource" + type="android.os.WorkSource" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</constructor> +<constructor name="WorkSource" + type="android.os.WorkSource" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="orig" type="android.os.WorkSource"> +</parameter> +</constructor> +<method name="add" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="other" type="android.os.WorkSource"> +</parameter> +</method> +<method name="clear" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="describeContents" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="diff" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="other" type="android.os.WorkSource"> +</parameter> +</method> +<method name="remove" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="other" type="android.os.WorkSource"> +</parameter> +</method> +<method name="set" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="other" type="android.os.WorkSource"> +</parameter> +</method> +<method name="writeToParcel" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="dest" type="android.os.Parcel"> +</parameter> +<parameter name="flags" type="int"> +</parameter> +</method> +<field name="CREATOR" + type="android.os.Parcelable.Creator" + transient="false" + volatile="false" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> </package> <package name="android.os.storage" > |