diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-06-10 12:19:19 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-06-10 14:38:58 -0700 |
commit | 438d0595121a7a2cdf19741e76e3c0e21a5c173d (patch) | |
tree | d4a76171b2eb52c472c2900eb6947ff073bed81a /api | |
parent | 8f1bfb001b522a370a65c8e4545183b7611f672b (diff) | |
download | frameworks_base-438d0595121a7a2cdf19741e76e3c0e21a5c173d.zip frameworks_base-438d0595121a7a2cdf19741e76e3c0e21a5c173d.tar.gz frameworks_base-438d0595121a7a2cdf19741e76e3c0e21a5c173d.tar.bz2 |
Introduce "StrictMode"
This is a new public API for developers to opt-in to strict rules
about what they're allowed to do on certain threads. (this is the
public face of the @hide dalvik.system.BlockGuard, added recently...)
In practice this will be used for developers to opt-in to declaring
that they don't want to be allowed to do various operations (such as
disk I/O or network operations) on their main UI threads. (these
operations are often accidental, or even when they are fast come with
a good chance of being slow or very slow in some cases....)
Implementation wise, this is just a thread-local integer that has a
bitmask of the things that aren't allowed, and more bits for saying
what the violation penalty is. The penalties, of which multiple can
be chosen, include:
* logging
* dropbox uploading for analysis/reporting
* annoying dialog
* full-on crashing
These are all only very roughly implemented at this point, but all
parts now minimally work end-to-end now, so this is a good checkpoint
commit before this gets too large.
Future CLs will polish all the above 4 penalties, including
checksumming of stacktraces and minimizing penalties for duplicate
violations.
Change-Id: Icbe61a2e950119519e7364030b10c3c28d243abe
Diffstat (limited to 'api')
-rw-r--r-- | api/current.xml | 114 |
1 files changed, 112 insertions, 2 deletions
diff --git a/api/current.xml b/api/current.xml index d002534..9930f44 100644 --- a/api/current.xml +++ b/api/current.xml @@ -77980,7 +77980,7 @@ type="float" transient="false" volatile="false" - value="0.0010f" + value="0.001f" static="true" final="true" deprecated="not deprecated" @@ -124950,6 +124950,116 @@ </parameter> </method> </class> +<class name="StrictMode" + extends="java.lang.Object" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="getThreadBlockingPolicy" + return="int" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="setThreadBlockingPolicy" + return="void" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="policyMask" type="int"> +</parameter> +</method> +<field name="DISALLOW_DISK_READ" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="DISALLOW_DISK_WRITE" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="DISALLOW_NETWORK" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="PENALTY_DEATH" + type="int" + transient="false" + volatile="false" + value="64" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="PENALTY_DIALOG" + type="int" + transient="false" + volatile="false" + value="32" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="PENALTY_DROPBOX" + type="int" + transient="false" + volatile="false" + value="128" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="PENALTY_LOG" + type="int" + transient="false" + volatile="false" + value="16" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> <class name="SystemClock" extends="java.lang.Object" abstract="false" @@ -218779,7 +218889,7 @@ deprecated="not deprecated" visibility="public" > -<parameter name="arg0" type="T"> +<parameter name="t" type="T"> </parameter> </method> </interface> |