History log of /frameworks/base/core/java/android/os/StrictMode.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
097fbf2e98e0d32baf6cbd1a5659c4145afb191f 13-Jul-2012 Qi Wang <wangqi0316@gmail.com> StrictMode.permitCustomSlowCalls() should call disable(DETECT_CUSTOM)
/frameworks/base/core/java/android/os/StrictMode.java
3761f33387f980d7a6c6e06555a5a932ba7247a2 16-Mar-2012 Jeff Sharkey <jsharkey@android.com> Move StrictMode timers to postAtFrontOfQueue().

StrictMode posts a message to estimate how long the main thread was
blocked during a violation. Currently, any pending messages are
counted against the violation. To avoid this, switch to using
postAtFrontOfQueue().

Bug: 6119289
Change-Id: I94530632ca678b78b75a698cf9193641b102be9a
/frameworks/base/core/java/android/os/StrictMode.java
e61cad321d2888f2b6b7e0322158211e3b3e0c46 08-Mar-2012 Dirk Dougherty <ddougherty@google.com> resolved conflicts for merge of 532679a5 to master

Change-Id: Id60d047c0e1f288acff97526c016cca632873b6b
4d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219 28-Jan-2012 Dirk Dougherty <ddougherty@google.com> Doc change: String changes for Android Market

Change-Id: I823812a4fd24021bec906ad856479c92a8d2a759
/frameworks/base/core/java/android/os/StrictMode.java
d7026f1612a7c1e8cc9b484038fa99b7fc29cfd7 02-Mar-2012 Jeff Sharkey <jsharkey@android.com> Report leaked Context registrations to StrictMode.

When tearing down any leaked BroadcastReceiver or ServiceConnection
Context registrations, report through StrictMode.

Bug: 6084353
Change-Id: I5e78039299e2c9c1440cd1fd09317da78ffee82a
/frameworks/base/core/java/android/os/StrictMode.java
bc6f0ce8be64a74b695fb21dab5f4805b68dce16 03-Nov-2011 Christopher Tate <ctate@google.com> Add persistent property to disable strict mode

Setting persist.sys.strictmode.disable to 'true' will disable strict
mode on eng/userdebug builds where it is turned on by default.
Explicitly enabling it in the Settings UI will override this, so
it's still possible to toggle it there even when this property
has been set on the device.

Change-Id: Ifd971f948fb2f803d509c2a06112c4bb932a5b1f
/frameworks/base/core/java/android/os/StrictMode.java
be7c29c9f7e3d7b75d4374c8b5c0ca43c9d09c68 11-Oct-2011 Jeff Brown <jeffbrown@google.com> Don't log BlockGuard violations on ENG builds.

We want to see CloseGuard violations in the log in ENG builds
because they indicate serious problems, but BlockGuard is
too noisy and is best viewed in the aggregate from the
drop box based tools.

Change-Id: I77d4d0a561a4299355c111d0ccb5a2147646245b
/frameworks/base/core/java/android/os/StrictMode.java
d5875d98f06817f78bd974842a8a9c2d41802d20 09-Oct-2011 Jeff Brown <jeffbrown@google.com> Always log StrictMode violations on ENG builds.

The drop-box is too quiet and it masking real problems from
developers. On ENG builds, use both logging and the drop-box
to ensure that problems are noticed promptly.

Change-Id: Id8fb8d392a7e01b532b73cb1a026b0d1f17af742
/frameworks/base/core/java/android/os/StrictMode.java
7e442837702a6e026c73a01fedb62c222b63cfc9 11-Jun-2011 Jeff Brown <jeffbrown@google.com> Optimize StrictMode activity instance count check.

This change attempts to avoid a periodic and costly 110ms
explicit GC and instance count operation when StrictMode
activity leak checking is enabled.

Change-Id: Ia90289ac3352c01c797ab3cc25456e3db68f220a
/frameworks/base/core/java/android/os/StrictMode.java
08d584cd1cba05284ccd2d0ea128c297624f0c47 17-May-2011 Steve Block <steveblock@google.com> Log a StrictMode violation when WebView methods are called on the wrong thread

Bug: 4373919
Change-Id: I1f526e033ce316e51b3de7fe4ac88119fbc65b4e
/frameworks/base/core/java/android/os/StrictMode.java
c0bb0bb5e3425b77b6e7820ebe25fe72bdd07782 21-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> StrictMode: set sIsIdlerRegistered to false, and don't register if no penalties

Change-Id: I1b2531b66d09c850519af17918aed8be9853ef3b
/frameworks/base/core/java/android/os/StrictMode.java
5f8b5c191cae77f536ee64f0b625e4a7f8596787 21-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> Fixes for StrictMode instance count checking.

Misc stuff found after looking at the first day of data, Jesse's
review, and comments from Dianne about tracking Activity counts
better.

Change-Id: Ifee1ef8f59f41061d4aac8c02765627dbf3cd8e4
/frameworks/base/core/java/android/os/StrictMode.java
bfbe5771106a07f9c8e8685e402b1003db40526f 19-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> StrictMode: class instance limits (track object "leaks")

Change-Id: I2db5a19060c2013078feb88a91caf655469b2f98
/frameworks/base/core/java/android/os/StrictMode.java
758035757f11a085a12b54daa9467f1d6bb251ef 13-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> StrictMode class instance limit interface.

Change-Id: Ic5eea539586e5d4965d83364bf9f623d1d89f2b1
/frameworks/base/core/java/android/os/StrictMode.java
4a82b620443269e0954ebb0743d8b42f0e76bc3e 14-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> Remove accidental StrictMode logging left in.

Change-Id: I7580816c6efc32889f49987152ff1d4c40d47140
/frameworks/base/core/java/android/os/StrictMode.java
4e920f70f38d52d3a74c6a3133388a2e2cb6c175 14-Dec-2010 Brad Fitzpatrick <bradfitz@android.com> Add MODE_MULTI_PROCESS flag to Context.getSharedPreferences()

Also, changes to make this testable with CTS:

-- special PENALTY_DEATH StrictMode fast path that doesn't use
the Looper idling to "time" the violation. Only used when
death is the only violation,

-- make PENALTY_DEATH throw a RuntimeException instead of
killing its process with a signal. this means we can catch
it in CTS tests, but it's also more consistent with
PENALTY_NETWORK_DEATH in Honeycomb.

-- make FileUtils.getFileStatus() invoke StrictMode, which isn't
(yet?) aware of I/O in native code. so help it out.

CTS test for MODE_MULTI_PROCESS is in I6154edab

Change-Id: Icf93f9dfb0ece06b16781e4803dd2c17df3cf1b3
/frameworks/base/core/java/android/os/StrictMode.java
996f41da3ca69844ffeee9f8e9ae7423bf440788 14-Dec-2010 Brad Fitzpatrick <bradfitz@android.com> am 2d5b11ab: am 0927c902: Merge "Fix StrictMode javadoc copy/paste error." into gingerbread

* commit '2d5b11aba0fec21e1ce3f358eb0d280b62704899':
Fix StrictMode javadoc copy/paste error.
320274c5f17057a3a823fed50b7027cbd46fc025 13-Dec-2010 Brad Fitzpatrick <bradfitz@android.com> Fix StrictMode javadoc copy/paste error.

Change-Id: Idd49111f0a1af6f331cffa0972191b2d4e25a385
/frameworks/base/core/java/android/os/StrictMode.java
e36f9bf123c7cd07ce1007a16de564b2840ea1fe 10-Dec-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode "custom" trigger support.

For people who want to annotate their own functions as slow, outside
of just the built-in disk & network stuff.

Change-Id: Ia90e150d1cf7a23a658c091285c1c8bb2d7d9732
/frameworks/base/core/java/android/os/StrictMode.java
bea168c09d173fb99cfc91c562c4a497a5e7d2d2 30-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: more accurate timings

Don't wait for animations to finish before clicking stopwatch. (see
comments in the patch for details)

Change-Id: I73f87b2b787d6db19deb0171a2457ff5fc875d3d
/frameworks/base/core/java/android/os/StrictMode.java
f54545927f365d6e55cbf66ff9f7ffe91aada774 25-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Don't flash StrictMode from the system server.

These are false positives from a developer's point of view.

Change-Id: Ic8baf81c0e2cf559a38c1fe6adfa6e739dd3eaed
/frameworks/base/core/java/android/os/StrictMode.java
c1a968a8ed45181312f7d4bcdbba0cc8ddc201ba 24-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Option to enable StrictMode flashing on userdebug builds.

Change-Id: Ifc8e733ea0e0f6bda234a18ad84bcd230879e802
/frameworks/base/core/java/android/os/StrictMode.java
1065685400335ef8c1220f34b4e896e7da603789 24-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fix potential weird StrictMode NPE.

Seen once in an eng build. Could in theory happen if there was a
violation in the system server before the activity manager was
registered.

Change-Id: I785f06848af0e2af4657be3a8edbbd658eeb3cf2
/frameworks/base/core/java/android/os/StrictMode.java
f3d86be6d7d2999cd6bae236817688490df7da71 23-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode fingerprinting / hashCode improvements.

Change-Id: I08ff939327f7c11a562851847ae91c67b1db4f87
/frameworks/base/core/java/android/os/StrictMode.java
cdcb73ef781b8f7d37d9f758409a0c7671517b37 23-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Cache WindowManager in StrictMode; add android.util.Singleton

Change-Id: I15a85461424de930710d4901658440b5d305cabb
/frameworks/base/core/java/android/os/StrictMode.java
6804433b0af50f33a338307ae8ddb50bc49e886b 23-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode visual notification support.

Change-Id: I64a5adb683060d9649f1132414547bb3c346a2a8
/frameworks/base/core/java/android/os/StrictMode.java
bee248769d51adb335b71b329b3d7813c5c71851 20-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: dropbox VM-wide violations (e.g. CloseGuard) async

To be clear, the dropbox violations were already async in the
ActivityManager, but the Binder call was often 30 ms anyway.

This optimization was already done for per-thread violations earlier,
but was never done for VM-wide violations because they weren't common,
until CloseGuard came about. Now that CloseGuard fires a lot, apply
the same optimization to VM-wide violations.

This CL also addresses a concern of Dianne's earlier of too many
threads being outstanding. So now there's a paranoia check with an
upper bound on how many outstanding ActivityManager calls are
in-flight.

Change-Id: I95e0816105ab862f0f241052b149c9a46a70ce9c
/frameworks/base/core/java/android/os/StrictMode.java
82829ef3b7c72bee36d8c17b36ac565f1856a310 19-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: use Log.isLoggable

Change-Id: Ic28450066a43a168cfe3026d6d4b06b752f8423c
/frameworks/base/core/java/android/os/StrictMode.java
d188ededa6f61dbe5a700e81db22c02478ce60cc 18-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: shut up VM penalty logging on debug builds.

Thread penalties were just dropboxing, but VM penalties were both
dropboxing *and* logging, and most annoyingly.

Change-Id: Ifc64b642dd0e2b17f0234ce3724650489883f62b
/frameworks/base/core/java/android/os/StrictMode.java
1cc13b6d1cc7203ad126b0708f0bf697e111264f 17-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Annotate ListView with StrictMode.Span

Change-Id: Ibee1bfa73c85dac2e8103eb5900f0609cbb30ee7
/frameworks/base/core/java/android/os/StrictMode.java
1181cbbfd7c913c51d9836272ad30cfe851c4699 16-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fast no-op path for StrictMode.Span on user builds.

Change-Id: I3eb75288d670a8ac1e10547715d8c1a855a5fdc9
/frameworks/base/core/java/android/os/StrictMode.java
7c2ae6570321575ad74a25bdc72bea1ec6558660 14-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fix CloseGuard/StrictMode integration.

Change-Id: Ib89843c48b92138d3981f0f719eae28bf44e2ed4
/frameworks/base/core/java/android/os/StrictMode.java
e7520d89fe2c5dc9dd833ecd9769c981df855b61 11-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode.Span support

Support for annotating critical regions (e.g. animations) with
a tag to be uploaded.

Change-Id: I412fc78f40dc05c9a3c9f62a4b0463201dbdb767
/frameworks/base/core/java/android/os/StrictMode.java
4b9b7c38e8f52259f9d2f960072d35e8a1ab2129 08-Nov-2010 Brian Carlstrom <bdc@google.com> Add custom CloseGuard.Reporter for StrictMode

StrictMode now replaces the default CloseGuard.Reporter with one that
calls onVmPolicyViolation, which is a renamed version of
onSqliteObjectLeaked.

Change-Id: Iea980662e2ee91939960c83b8768a8172379617a
/frameworks/base/core/java/android/os/StrictMode.java
fd9ddd1a40efc801dc7512950cb9336967b6f775 04-Nov-2010 Brian Carlstrom <bdc@google.com> Integrate StrictMode with CloseGuard

In additional to adding the StringMode API for controling CloseGuard,
this checkin fixes several CloseGuard issues found booting a device.

Bug: 3041575
Change-Id: I4dffd184f49438d6d477ed81a1c2a2a5b56cc76b
/frameworks/base/core/java/android/os/StrictMode.java
bfb191998eba2ebc710ff9eb59480b10909ba4c9 30-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: annotate violations with the Broadcast Intent's action, if any.

Change-Id: If36ab776bb95054a109b5475c6be041c75c7e0af
/frameworks/base/core/java/android/os/StrictMode.java
b6e18412af35bf724298796eed65ef1fbbe1925e 28-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> Make network usage on the main thread fatal (Honeycomb+)

For apps targetting Honeycomb SDK or above, make network usage on the
main thread (aka event thread, Looper thread, UI thread) be fatal.

If an app is targetting a previous SDK version, they're grandfathered
into the older (lack of) rules.

Bug: 786847
Change-Id: Ia4ae77b8369567ee526c96b930d523bc722b0bc9
/frameworks/base/core/java/android/os/StrictMode.java
71678ddcc45d9cd4557f3bed8bba5382bf36b68b 28-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: optimize common case (just dropboxing)

The way StrictMode is used during development, just dropboxing
violations, could be a little more optimal, taking the
ActivityManagerService call off the main thread. But we can only do
this safely in the case where that's the only penalty.

Data suggests this call, despite being async, still takes around 30
milliseconds. This isn't a major win, and arguably it might be a
_better_ idea to slow down people's event loops more and further jank
up their animations on violations, but I thought any less overhead
from StrictMode, the better.

Change-Id: Iad9cce1cb4a084fa64abc4b5e1b4f3bff6a08c94
/frameworks/base/core/java/android/os/StrictMode.java
599ca29986235e07f532c7b112507f6c39b5dba9 22-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> Expose (internally only) the number of animations currently running.

This will be used for StrictMode to annotate violations with
whether or not they janked up an animation.

Change-Id: I5bc691f49b74c45279cd2ae044d2a81dcf1204a9
/frameworks/base/core/java/android/os/StrictMode.java
62a1eb58bfafe8744d7a65f651e11b88fdb0938d 18-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: fix docs to actually compile and add a utility method.

Yes, this is a last minute public API change, but I'm already getting
a lot of inquiries about how to use StrictMode on a GB device but
targetting Eclair or Froyo. I'd like a simple answer involving
reflection, but the current API is too painful to use via reflection.

I imagine this will be a common request, and it's much easier for us
to write a little blog post about trying it out if there's an easy way
to use it with reflection.

Change-Id: I1f21aaac7e61e5e90d1e4facc0c787d8daf089b1
/frameworks/base/core/java/android/os/StrictMode.java
9fc2fc5757a3d28d098bd2b0ad0f869a3cf3fa14 11-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: link to designing for responsiveness ANR docs

Change-Id: If65849aaa8317e7e40b2837b640a5cdb95fe7b0e
/frameworks/base/core/java/android/os/StrictMode.java
191cdf023c3c1ab441087a77f7881c7bb376613a 11-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: check max-offenses-per-loop earlier, before allocations

Previously a tight loop of StrictMode violations would still allocate
Exception objects and populate their stack frames, just to orphan them
later when checking the max-10-violations-per-loop constraint.

With this patch, we do that check _before_ allocating any memory.

Change-Id: Iae96aba33f8fcc6a8ec5838a231aecc08e95122d
/frameworks/base/core/java/android/os/StrictMode.java
32e60c7942eeba920ec5c27b372ec0899fd75a20 01-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> Update StrictMode's public API.

This makes it more future-proof and maintainable, not exposing the
internal bitpacking state.

The implementation is unchanged (the policy is still just an int we pass
around).

Also starts to introduce VmPolicy, for things which are process-wide,
not per-thread. As an initial user, make SQLite's Cursor finalization
leak warnings use StrictMode.

Change-Id: Idedfba4e965716f5089a52036421460b1f383725
/frameworks/base/core/java/android/os/StrictMode.java
15ba4061116e088d62a7e05a0037f294f31dff06 22-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> Flesh out StrictMode docs.

Bug: 3001474
Change-Id: If64209a312d45f7d96d8317d1e63e6c773a01441
/frameworks/base/core/java/android/os/StrictMode.java
50d66f9fcdac84b2af65a82be56728f54b1a7ef0 14-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> Unify some duplicate StrictMode-enabling code.

Change-Id: Ifb92f35d9e245dbdb5e201597d8be702bce9e8b8
/frameworks/base/core/java/android/os/StrictMode.java
97461bd25c3821f3fb6af9705f0612259c6b4492 24-Aug-2010 Brad Fitzpatrick <bradfitz@android.com> Some StrictMode API changes.

* rename setThreadBlockingPolicy to setThreadPolicy (opens the way to
using StrictMode for non-blocking-related things in the future?)

* add allowThreadDiskWrites() and allowThreadDiskReads() to modify the
current policy mask and return the old one. this will allow turning
off part of StrictMode during certain regions of code. (for
instance, writing to disk in Activity onPause...)

Change-Id: Ia1878153713f79299971fdab567fa15b3cb9d56c
/frameworks/base/core/java/android/os/StrictMode.java
cb9ceb1029036363a81952d8ed5dfcbc83e6ff72 29-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: time violations in Binder calls

Change-Id: I5796993dce98be722cf679b78acaf0c9de0ba461
/frameworks/base/core/java/android/os/StrictMode.java
7bcad8a315f12bd6251a998781efac7b11c2ca84 27-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> Replace several IPCThreadState::get() lookups with one.

Also, make StrictMode's ThreadLocal final.

Change-Id: I08d400ed254fa67bb7a3dae1227f205a54c00df0
/frameworks/base/core/java/android/os/StrictMode.java
703e5d3c7fbeb8ca0978045db01d40318f838612 15-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: avoid an allocation in common case

Make the initialValue() of the ThreadLocal be null, so checking it doesn't
cause one to be created in the case of an RPC call not using StrictMode.

Change-Id: I3ea19ce444a1b3c39a6e53c5cb5d4faf4b07a6c8
/frameworks/base/core/java/android/os/StrictMode.java
5b747191ff8ad43a54d41faf50436271d1d7fcc8 12-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: gather and return violating stacks in Binder replies

Now, when Thread A has a strict mode policy in effect and does a
Binder call to Thread B (most likely in another process), the strict
mode policy is passed along, but with the GATHER penalty bit set which
overrides other policies and instead gathers all offending stack
traces to a threadlocal which are then written back in the Parcel's
reply header.

Change-Id: I7d4497032a0609b37b1a2a15855f5c929ba0584d
/frameworks/base/core/java/android/os/StrictMode.java
727de40c6bc7c6521a0542ea9def5d5c7b1c5e06 08-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> More StrictMode work, keeping Binder & BlockGuard's thread-locals in-sync.

Change-Id: Ia67cabcc17a73a0f15907ffea683d06bc41b90e5
/frameworks/base/core/java/android/os/StrictMode.java
143666f0ca28f0e3e6597e5025078f0449ca6abe 14-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: implement the log-to-DropBox option

Change-Id: I51d12e264155078f953028241f8c5cbdc47262e8
/frameworks/base/core/java/android/os/StrictMode.java
46d42387464a651268648659e91d022566d4844c 11-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> More StrictMode work, handling violations in ActivityManagerService.

Also starts to do duplicate-suppression.

Change-Id: I0502f6ab6c45fa319298de4874ecfe44b7829d21
/frameworks/base/core/java/android/os/StrictMode.java
438d0595121a7a2cdf19741e76e3c0e21a5c173d 10-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> 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
/frameworks/base/core/java/android/os/StrictMode.java