History log of /frameworks/base/core/java/android/os/Looper.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9867ed7aa98f5a719db4b50c39a290bc0ef38123 28-Feb-2014 Jeff Brown <jeffbrown@google.com> Detect invalid uses of Message.

Throw an exception when an application attempts to recycle or
resend messages that are still in-use.

Change-Id: I7096e8b7bd5bec41b7b8ef0c798c55ce3db6827e
/frameworks/base/core/java/android/os/Looper.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
/frameworks/base/core/java/android/os/Looper.java
5182c780a8b42acd46a06d693ab63a0dd78c6d70 16-Oct-2013 Jeff Brown <jeffbrown@google.com> Log view root, input and looper state in bug reports.

Bug: 10948648
Change-Id: I956cce2a0fb516c02f9bbbc021f6238bcb226891
/frameworks/base/core/java/android/os/Looper.java
efa92b2182ab581873aa8e75d596e2e363bd5e6d 03-May-2013 Dianne Hackborn <hackbod@google.com> Cleanup some of the thread merging.

Adds an optimization for checking whether a looper is stuck,
with a new Looper method to see if its thread is currently
idle. This will allow us to put a large number of loopers
in the monitor efficiently, since we generally won't have to
do a context switch on each of them (since most looper threads
spend most of their time idle waiting for work).

Also change things so the system process's main thread
is actually running on the main thread. Because Jeff
asked for this, and who am I to argue? :)

Change-Id: I12999e6f9c4b056c22dd652cb78c2453c391061f
/frameworks/base/core/java/android/os/Looper.java
8b60e4514702edd1eb4b6f2bfc027e04a94369c0 19-Apr-2013 Jeff Brown <jeffbrown@google.com> Fix change of behavior in Looper.quit().

It seems some applications rely on Looper.quit() terminating the
loop immediately without processing all messages. Rather than
risk breaking them, make the safer behavior optional.

Also take care to properly drain the message queue before quitting
so that all of the Message instances are recycled. This may
help release storage sooner in case the Looper doesn't get GC'd
promptly and its remaining queue of undelivered messages sticks
around.

Improve docs on runWithScissors.

Bug: 8596303
Change-Id: I8cbeb6f7a5f6b8e618b5109f87a03defc1486b9f
/frameworks/base/core/java/android/os/Looper.java
024136f57e5f8b4c11a4fe0fd83061eb6d372d26 12-Apr-2013 Jeff Brown <jeffbrown@google.com> Ensure looper quits after all other messages are handled.

Bug: 8596303
Change-Id: Ie8bfbbe810f5ade2afd870c8e675ce1353a80e5d
/frameworks/base/core/java/android/os/Looper.java
f9e989d5f09e72f5c9a59d713521f37d3fdd93dd 05-Apr-2013 Jeff Brown <jeffbrown@google.com> Queues, queues, queues and input.

Redesigned how ViewRootImpl delivers input events to views,
the IME and to native activities to fix several issues.

The prior change to make IME input event delegation use
InputChannels failed to take into account that InputMethodManager
is a singleton attached to the main looper whereas UI may be
attached to any looper. Consequently interactions with the
InputChannel might occur on the wrong thread. Fixed this
problem by checking the current thread and posting input
events or callbacks to the correct looper when necessary.

NativeActivity has also been broken for a while because the
default event handling logic for joysticks and touch navigation
was unable to dispatch events back into the native activity.
In particular, this meant that DPad synthesis from touch navigation
would not work in any native activity. The plan is to fix
this problem by passing all events through ViewRootImpl as usual
then forwarding them to native activity as needed. This should
greatly simplify IME pre-dispatch and system key handling
and make everything more robust overall.

Fixed issues related to when input events are synthesized.
In particular, added a more robust mechanism to ensure that
synthetic events are canceled appropriately when we discover
that events are no longer being resynthesized (because the
application or IME is handling or dropping them).

The new design is structured as a pipeline with a chain of
responsibility consisting of InputStage objects. Each InputStage
is responsible for some part of handling each input event
such as dispatching to the view hierarchy or to the IME.
As a stage processes an input event, it has the option of
finishing the event, forwarding the event to the next stage
or handling the event asynchronously. Some queueing logic
takes care to ensure that events are forwarded downstream in
the correct order even if they are handled out of order
by a given stage.

Cleaned up the InputMethodManager singleton initialization logic
to make it clearer that it must be attached to the main looper.
We don't actually need to pass this looper around.

Deleted the LatencyTimer class since no one uses it and we have
better ways of measuring latency these days using systrace.

Added a hidden helper to Looper to determine whether the current
thread is the indicated Looper thread.

Note: NativeActivity's IME dispatch is broken by this patch.
This will be fixed later in another patch.

Bug: 8473020
Change-Id: Iac2a1277545195a7a0137bbbdf04514c29165c60
/frameworks/base/core/java/android/os/Looper.java
67fc67cf3e1dba17b0eae4f3923f3e93a78c7575 01-Apr-2013 Jeff Brown <jeffbrown@google.com> Make MessageQueue and Looper final.

Applications already cannot subclass these classes because
their constructors are not visible.

Change-Id: Id979d86dd05f7bcc888fe4ea499ab9b95d3d5dde
/frameworks/base/core/java/android/os/Looper.java
13b907353f18215b52b5ceda24bbf520d91d72a1 21-May-2012 Romain Guy <romainguy@google.com> Remove unused, obsolete debug code

All these features have either been abandonned and left un-maintained
for years or can be replaced by systrace.

Change-Id: I42e4579a8078744047e5fe08a7a15254970b09bc
/frameworks/base/core/java/android/os/Looper.java
0f85ce3837633a03460a61405087a5d28a4bf955 16-Feb-2012 Jeff Brown <jeffbrown@google.com> Improve MessageQueue sync barrier implementation.

Instead of acquiring and releasing a barrier using an up/down
counter, we post a message to the queue that represents the
barrier. This is a more natural representation of the barrier
and better matches what we want to do with it: stall messages
behind the barrier in the queue while allowing messages earlier
in the queue to run as usual.

Refactored the MessageQueue a little bit to simplify the quit
logic and to better encapsulate the invariant that all
messages within the queue must have a valid target. Messages
without targets are used to represent barriers.

Bug: 5721047
Change-Id: Id297d9995474b5e3f17d24e302c58168e0a00394
/frameworks/base/core/java/android/os/Looper.java
7f9f99ea11051614a7727dfb9f9578b518e76e3c 11-Aug-2011 Xavier Ducrohet <xav@android.com> Make some methods/fields package private so that layoutlib can access them.

Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
/frameworks/base/core/java/android/os/Looper.java
648bee18a1ccd362445d562729250ff5910f16a0 21-Jul-2011 Romain Guy <romainguy@google.com> Convert looper traces to traceview traces

Change-Id: If9238e8b00744118c1c4d2182727569f94deb638
/frameworks/base/core/java/android/os/Looper.java
f9284695e8c10dad4daf3d2c84f607483bcb56ca 14-Jul-2011 Romain Guy <romainguy@google.com> Add new ViewDebug APIs to profile the event queue.

Change-Id: I225bf288780b0244f459316e2765cfa29cd22c89
/frameworks/base/core/java/android/os/Looper.java
10e89712863f5b91a2982dc1783fbdfe39c1485d 09-Jul-2011 Jeff Brown <jeffbrown@google.com> Eliminate single-process mode.
Bug: 5010576

Change-Id: Id450dc83efed4897d1e4ff451530fed14457aace
/frameworks/base/core/java/android/os/Looper.java
43a17654cf4bfe7f1ec22bd8b7b32daccdf27c09 07-Apr-2011 Joe Onorato <joeo@google.com> Remove the deprecated things from Config.java. These haven't been working since before 1.0.

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
/frameworks/base/core/java/android/os/Looper.java
9b7c1274ddba8db2842431649d46c4cef510131f 15-Mar-2011 Dianne Hackborn <hackbod@google.com> am e2e8da7c: am 7c2e76f0: Merge "Improve error reporting for issue #3183612" into gingerbread

* commit 'e2e8da7c734b71c4b6b81e51e16ce3f4061f0f07':
Improve error reporting for issue #3183612
1ab43775d8134d652a7d27f2d79c569653e47f1a 15-Mar-2011 Dianne Hackborn <hackbod@google.com> Improve error reporting for issue #3183612

java.lang.SecurityException: Neither user 1209 nor current process
has android.permission.WAKE_LOCK.

Change-Id: I465972ab91b007e04b2ac62550f78583956a4048
/frameworks/base/core/java/android/os/Looper.java
df58a1bbf8d7f6608848eae4d5d48dcff137dc8c 03-Mar-2011 Simon Wilson <simonwilson@google.com> am 3d79f1ce: am edc68a00: Merge "Attempt to reduce problems from issue #3183612" into gingerbread

* commit '3d79f1ce84ee60dbb26468b9e5f75f4ccb5ed8aa':
Attempt to reduce problems from issue #3183612
e5dea7537cadbf79614730f96d9e92cc2b12ad5a 09-Feb-2011 Dianne Hackborn <hackbod@google.com> Attempt to reduce problems from issue #3183612

java.lang.SecurityException: Neither user 1209 nor current...
...process has android.permission.WAKE_LOCK.

It looks like, somehow, the calling uid/pid of the SyncHandler
thread is getting corrupted. This change has Looper check for
these values changing from their original defaults and, if there
is a problem, resetting them and logging a WTF. Hopefully this
will avoid crashing the process, while also giving us more
helpful error reports about what is going on.

Change-Id: Iff06d575951fb8c06e2a3c31141f2907a715eb81
/frameworks/base/core/java/android/os/Looper.java
1b29825cca9edda7ae4b3a3f27420c42fd13eef8 24-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Misc Looper cleanups; add android.util.PrefixPrinter

Change-Id: I0b9adce46cb785b4dd4e6296e1f97c8bcf0dbfbf
/frameworks/base/core/java/android/os/Looper.java
1ebccf531d1049853b3b0630035434619682c016 15-Aug-2010 Dianne Hackborn <hackbod@google.com> Fix problems with determining when to kill apps for wake usage.

Also improve debug printing of various times.

Change-Id: Ifcc288fd1bcbf44c069875ba97925b9e7ffe9a48
/frameworks/base/core/java/android/os/Looper.java
a41ca77fabe1c7ad12ebb9b69b9e786c07d49fa0 11-Aug-2010 Jeff Brown <jeffbrown@google.com> Add support for the PointerLocation overlay.

This change involves adding a new method to IWindowManager,
monitorInput() that returns an InputChannel to receive a copy of all
input that is dispatched to applications. The caller must have
the READ_INPUT_STATE permission to make this request (similar to
other window manager methods such as getKeycodeState).

Change-Id: Icd14d810174a5b2928671ef16de73af88302aea0
/frameworks/base/core/java/android/os/Looper.java
935ae463d495d41155e27feb849768ad2b8b16db 14-Apr-2009 Dianne Hackborn <> AI 145994: Integrate #145778 from Donut.

Automated import of CL 145994
/frameworks/base/core/java/android/os/Looper.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/os/Looper.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/os/Looper.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/os/Looper.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/os/Looper.java