summaryrefslogtreecommitdiff
path: root/core/java/android/os/Message.java
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Bernardo Rufino2022-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 331be9a6431d6489f8d1e1b80cb510d0ee073c50. Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55). Original commit message: Migrate unsafe parcel APIs in framework-minus-apex Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93 Test: TH passes
* Revert "Migrate unsafe parcel APIs in framework-minus-apex"Bernardo Rufino2022-01-121-1/+1
| | | | | | | | This reverts commit 90bb3709dc75f7e44914222114752de5bce133d4. Reason for revert: b/214053959 Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
* Migrate unsafe parcel APIs in framework-minus-apexBernardo Rufino2021-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Test: TH passes Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* Rename writeToProto to be dumpDebugJeffrey Huang2019-12-051-1/+1
| | | | | | | | | We want to eventually migrate some of these APIs to be @SystemApi for mainline modules. The #dumpDebug name is more appropriate than #writeToProto. Bug: 142279786 Test: Manual Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
* Add @UnsupportedAppUsage annotationsAndrei Onea2019-03-151-0/+10
| | | | | | | | | | | | | | | | For packages: android.os This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4ece0a3f37f88fc2508cb965092aed7cabc61819
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* LooperStats - track time to message dispatchMarcin Oczeretko2018-10-121-1/+9
| | | | | | | | | | | Test: UT and manual atest .../LooperStatsTest.java Verified that adb shell cmd looper_stats dump produces data with dispatch delay Bug: 113651685 Change-Id: I44550f8c5d71848932733bd02016aa65ce7b75b3
* Merge "Fix incorrect javadoc links" am: 0d954557a1 am: cd1c75ae4cTor Norbye2018-10-101-1/+1
|\ | | | | | | | | | | am: f2183961a9 Change-Id: Icf157b65308e7de18b51aec837b8c29baa5a1918
| * Merge "Fix incorrect javadoc links" am: 0d954557a1Tor Norbye2018-10-101-1/+1
| |\ | | | | | | | | | | | | | | | am: cd1c75ae4c Change-Id: I6d8c44be9d156ac2b6a20d3d13972371ee4d741e
| | * Fix incorrect javadoc linksTor Norbye2018-10-081-1/+1
| | | | | | | | | | | | | | | | | | Test: make offline-sdk-docs Bug: b/116163454 Change-Id: I55de1f71d443713b033ee63fd191bd34b3a52fd2
* | | Add work source uid collection to LooperStatsMarcin Oczeretko2018-09-201-3/+21
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Add ThreadLocalWorkSourceUid and Message.workSourceUid which will store the UID which caused, directly or indirectly, the Message to be enqueued. This was needed because using Binder.getCallingUid() does not give us enough data since quite a few Binder services call Binder.clearCallingIdentity() when processing the call. Test: UT and manual Change-Id: I35af3a9ca5193477070990b41ff5d9c52f420069
* / docs: fixed typoJoshua Baxter2018-06-041-1/+1
|/ | | | | | | Test: make ds-docs Bug: 36966026 Change-Id: I4eaef8ba2b281451c77c7897af7273e3e8ac8cff
* PooledLambdaEugene Susla2017-12-051-1/+19
| | | | | | | | | | | This introduces PooledLambda - a way of obtaining lambdas without the allocations overhead. See PooledLambda javadoc for a guide and PooledLambdaSample for code samples of useful usages. Test: ensure samples of PooledLambdaSample work as described. Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
* Protobufferize PowerManager dumpsysNetta P2017-02-231-22/+55
| | | | | | Bug: 34230125 Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCase -t com.android.server.cts.PowerIncidentTest Change-Id: Ib71563cfc9ca95c297111430d8bbe2ce88d7a41d
* Make Message.setAsynchronous() public.Jeff Brown2014-11-111-18/+22
| | | | | | | | | | | | | | | | | There are many cases in real world applications where it is desirable to continue processing messages on the Looper even when most other messages have been suspended by a synchronization barrier pending completion of the next drawing frame on vsync. Internally the framework is able to mark certain messages as being independent of these higher level synchronization invariants by flagging them as asynchronous. This change exposes the existing function and improves on the documentation so that it is clearer what is meant by asynchronous. Bug: 18283959 Change-Id: I775e4c95938123a364b21a9f2c39019bf37e1afd
* Put in real "code" (aka marketing) name.Dianne Hackborn2014-10-071-1/+1
| | | | Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
* Fix issue #17391969: Only exception on Message.recycle() when target-sdk > 20Dianne Hackborn2014-09-051-2/+14
| | | | Change-Id: Iaf271c96901c5dba15831681269a49ad4aaa57fd
* am 3e5f0229: am 58005ec5: am 3b345a6f: Merge "Fix javadoc typo in ↵Nick Kralevich2014-07-051-1/+1
|\ | | | | | | | | | | | | Message.java: "arg1" -> "arg2"" * commit '3e5f0229e10be4179f763efd6119b63bcea6d162': Fix javadoc typo in Message.java: "arg1" -> "arg2"
| * Fix javadoc typo in Message.java: "arg1" -> "arg2"Denver Coneybeare2014-06-181-1/+1
| | | | | | | | Change-Id: I245eadaf322dce9e27af30d8dbb6d97ca0d296ce
* | Add new sendingUid field to Message.Dianne Hackborn2014-06-281-0/+12
| | | | | | | | | | | | | | This tell you where the message came from when it was delivered through a Messenger. Change-Id: I86a5f521c8ae919b45872dd76b61e83447f397ab
* | Detect invalid uses of Message.Jeff Brown2014-03-031-20/+41
|/ | | | | | | Throw an exception when an application attempts to recycle or resend messages that are still in-use. Change-Id: I7096e8b7bd5bec41b7b8ef0c798c55ce3db6827e
* Log view root, input and looper state in bug reports.Jeff Brown2013-10-151-18/+30
| | | | | Bug: 10948648 Change-Id: I956cce2a0fb516c02f9bbbc021f6238bcb226891
* Increase the Message pool sizeRomain Guy2012-05-061-2/+2
| | | | Change-Id: If609c9ffbea800ff6409b0096a82f0b899f29343
* Allow fine-grained control over functors executionRomain Guy2012-04-021-10/+7
| | | | | | Adds non-drawing execution mode Change-Id: I82f92cf1b9a3b9ff2ca6d7427c4e02b73e04e6bf
* Add a barrier mechanism to the MessageQueue.Jeff Brown2012-02-141-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | The synchronization barrier enables selectively blocking execution of synchronous messages until the barrier is released. Asynchronous messages may continue running in the meantime. The barrier is intended to be used to implement more sophisticated scheduling policies related to view hierarchy traversals. While traversals are pending, most messages posted to the message queue must be held up. This is to satisfy the invariant that traversals will occur before subsequently posted messages are handled. The exception to this rule are "asynchronous" messages that represent external events or interrupts that come from other components such as VSYNC pulses, input events or sensor events. Because these messages are typically delivered at arbitrary times, they are independent of traversals or other typical synchronization boundaries. Messages can now be flagged as asynchronous to indicate that they are weakly ordered. Bug: 5721047 Change-Id: I1446dcfbc896f33b48355adc28967ace8c8c9b9b
* Always clear the Message when recycled.Jeff Brown2011-06-101-1/+2
| | | | | | | | | | Clear the Message when it is recycled, even if it will not go back into the Message pool. This makes the behavior of recycle() more consistent and ensures that the Message does not hold onto other object after it has been recycled (useful in case there are stale references to the Message lingering elsewhere). Change-Id: I26b6a4b629f9c0b6bed70fdc42734919f30e64c4
* am 6af61b84: am a206efcf: Merge "android.os.Message: respect sPoolSize"Brad Fitzpatrick2011-01-251-12/+13
|\ | | | | | | | | * commit '6af61b843511bc5b669d30b980c4a9e2682da47c': android.os.Message: respect sPoolSize
| * android.os.Message: respect sPoolSizeBrad Fitzpatrick2011-01-251-13/+13
| | | | | | | | | | | | | | Also rename some static members from mFoo to sFoo. Bug: http://code.google.com/p/android/issues/detail?id=13866 Change-Id: I5c5075eb6f529d1534c7aa72b6881873cd08676a
* | Allow reliable detection of a message that is in use.Wink Saville2010-08-241-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the standard Looper.loop code calls Message#recycle it is imperative that Handler#handleMessage code not attempt to resue a message it receives. If allowed to do so it will cause bugs that could be difficult to diagnois. This change adds Message#flags and uses one bit to reliably detect a message is in use and throws an error in MessageQueue#enqueueMessage. This allows early detection of this bug. Note: This is not new functionality, but the current implementation does not detect messages that are in use because it uses Message#when != 0 as the detection mechanism. The problem is that a Message#when value of 0 is valid value used to place a message at the front of the queue and is thus unreliable. Another option is to change the setting of Message#when in Message#enqueueMessage so that it is never 0, although that does change subtly a publicly accessible field. Yet another option would be to use other fields but all candidates have similar problems as when in that they are publicly accessible or even settable such as Message#target. Change-Id: I040d6e546376f7b1ed1e4daa0d5644cce8bf333a
* | Revert "Allow reliable detection of a message that is in use."Jaikumar Ganesh2010-08-231-14/+1
| | | | | | | | | | | | | | | | This reverts commit 6083d81ce4d67ec632962270fda64ebb9db0d5b1. Reverting this because it causes runtime to reboot in a loop if connected to a Bluetooth Headset. copyFrom() needs to check for the introduced bit too.
* | Allow reliable detection of a message that is in use.Wink Saville2010-08-211-1/+14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Because the standard Looper.loop code calls Message#recycle it is imperative that Handler#handleMessage code not attempt to resue a message it receives. If allowed to do so it will cause bugs that could be difficult to diagnois. This change adds Message#flags and uses one bit to reliably detect a message is in use and throws an error in MessageQueue#enqueueMessage. This allows early detection of this bug. Note: This is not new functionality, but the current implementation does not detect messages that are in use because it uses Message#when != 0 as the detection mechanism. The problem is that a Message#when value of 0 is valid value used to place a message at the front of the queue and is thus unreliable. Another option is to change the setting of Message#when in Message#enqueueMessage so that it is never 0, although that does change subtly a publicly accessible field. Yet another option would be to use other fields but all candidates have similar problems as when in that they are publicly accessible or even settable such as Message#target. Change-Id: I2df600537700a3fe206678f38bcae7329751c4e5
* Fix problems with determining when to kill apps for wake usage.Dianne Hackborn2010-08-151-1/+6
| | | | | | Also improve debug printing of various times. Change-Id: Ifcc288fd1bcbf44c069875ba97925b9e7ffe9a48
* Improve Service documentation with some samples.Dianne Hackborn2010-02-181-15/+61
| | | | | Also some small tweaks to the Message API to improve its use in the MessengerService sample.
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+405
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-405/+0
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+405