Commit Graph

4383 Commits

Author SHA1 Message Date
Craig Mautner
ffe0c56c29 am 429664a5: am d5e7b8bf: Merge "Clear test rectangle if previous focus is null." into jb-mr2-dev
* commit '429664a52ab0d024757650a246297ae8224e60dc':
  Clear test rectangle if previous focus is null.
2013-04-12 12:11:17 -07:00
Craig Mautner
d5e7b8bfb4 Merge "Clear test rectangle if previous focus is null." into jb-mr2-dev 2013-04-12 19:02:06 +00:00
Craig Mautner
26a84dfdd0 Clear test rectangle if previous focus is null.
A bug in FolderEditText or DynamicLayout (b/8600683) was causing
the 'rectangle' parameter passed to scrollToRectOrFocus() to be
roughly 1000 feet to the right of the screen.

This bug is normally masked because the focus found in
mLastScrolledFocus never matches the new focus and consequently
the misleading 'rectangle' is nulled. However, on the first
time in to scrollToRectOrFocus when returning to Launcher
from another app, mLastScrolledFocus is null and the code
skips over the place where 'rectangle' is nulled. Without this
clearing it was determined that 'rectangle' was outside the viewable
area and scrolling not required. This is bug 8547155.

This change causes even null values of mLastScrollFocus to be
compared to the new focus thus masking the bug in all situations.
Bug 8600683 will be fixed in a separate CL.

Fixes bug 8547155.

Change-Id: Ic6cb22c42b0e93a9793dd2babc25727c2ba29155
2013-04-11 19:33:54 -07:00
Michael Wright
0f3e023b63 am af543eb0: am 8881455a: Merge "Send joystick key repeat messages to correct handler" into jb-mr2-dev
* commit 'af543eb050546e2197bd54db7cf257e053add4c2':
  Send joystick key repeat messages to correct handler
2013-04-10 16:12:59 -07:00
Michael Wright
b9618523ad Send joystick key repeat messages to correct handler
Change-Id: I7f8dbe21c9088553ad2c5efe70585f516ab78141
2013-04-10 15:20:56 -07:00
Romain Guy
02b5d6ff13 am 23886803: am 5180ed14: Merge "Instrument views inflation in systrace" into jb-mr2-dev
* commit '23886803a13f5f8f9c69fd6374ca1f732d1e513b':
  Instrument views inflation in systrace
2013-04-10 14:14:20 -07:00
Romain Guy
5180ed141d Merge "Instrument views inflation in systrace" into jb-mr2-dev 2013-04-10 21:07:09 +00:00
Romain Guy
09f7b93a18 Instrument views inflation in systrace
Change-Id: If3cd80bc430893c701432f165b4c1f5943a4143c
2013-04-10 11:42:44 -07:00
Chet Haase
c4c8f2d82e am 78b24b6f: am dacd4751: Merge "Fix Contacts animation jank" into jb-mr2-dev
* commit '78b24b6f03f467a59afd6797b4c03224fe3af767':
  Fix Contacts animation jank
2013-04-10 11:01:31 -07:00
Chet Haase
dacd475163 Merge "Fix Contacts animation jank" into jb-mr2-dev 2013-04-10 17:49:56 +00:00
Chet Haase
58d110afa0 Fix Contacts animation jank
The last frame of an animation stays stuck on the screen for a couple of frames.
Specifically, the "Quick Contact" animation that animates the picture
closed (fades/scales it away) animates all the way to the end... then hangs there
briefly before being taken down.

The problem is a rendering bug where we correctly detect that a DisplayList
has nothing to draw (since the last frame is completely transparent, alpha==0),
but incorrectly ignore the fact that we cleared the transparent-background
window prior to not-drawing that DisplayList. When we detect that there's
nothing to draw, we don't bother swapping buffers. So even though we drew
the right thing (clearing the buffer), we didn't actually post the buffer to the
screen.

This change factors in both the clear and the draw to decide when to swap buffers.

Issue #8564865 Quick contact close animation jank redux

Change-Id: Ib922cff88a94f025b62f7461c1a29e96fe454838
2013-04-10 07:43:29 -07:00
Jeff Brown
54977db25a am 55198db2: am 4dac901f: Rewrite touch navigation dpad synthesis.
* commit '55198db2dbb55d4f9ac18db81cc05c553b6c6d23':
  Rewrite touch navigation dpad synthesis.
2013-04-10 04:01:10 -07:00
Jeff Brown
4dac901f01 Rewrite touch navigation dpad synthesis.
The new implementation more accurately tracks the velocity
of flings and takes care to avoid obvious discontinuities.
The main goal is for a fling to appear to be a linear
extension of the movement already in progress.  The minimum
fling velocity is set to ensure that flings appear to be
fairly smooth despite being discretized.

Use sequences of repeated key events instead of individual
down/up events to represent continuous motions in one
direction which can be helpful for stopping flings at boundaries
such as when flinging the cursor position within a text view.

Compute the movement thresholds based on the physical
size of the touch pad, if known.  If not known, we assume a
nominal size.

Support stopping flings with a tap just like we do for
normal touch events elsewhere in the framework.

Moved the detection of ASSIST swipes into the InputReader
where it belongs.  These swipes must be detected globally
to ensure consistent behavior across the all applications.

Added a custom protocol in EventHub to enable input device
drivers to override the timestamp of the following events
in a packet.  This change enables input device drivers
that have a better idea of when an input event was actually
generated to pass this information to the input system.
Particularly useful with uinput.

Bug: 8583760
Change-Id: I8ef4e827804786d549cfaa00793a2b9dd0fda465
2013-04-10 03:51:18 -07:00
Jeff Brown
82c0edaad3 am f1cee03b: am 678a1252: Split up the event synthesis code by source.
* commit 'f1cee03bf0e5d3144947609a23665d950e385635':
  Split up the event synthesis code by source.
2013-04-10 03:26:33 -07:00
Jeff Brown
678a1252b4 Split up the event synthesis code by source.
The goal is to better encapsulate this code to make it easier
to maintain and to facilitate some upcoming changes.

Some of the variables have been renamed but the logic is unchanged.

Bug: 8583760
Change-Id: I45501f7dabebcb938e42c386291d615d088a4c8c
2013-04-10 03:01:29 -07:00
Jeff Brown
8140b05f1e am 9acc8c9c: am 97b968b6: Merge "Fix trackball interpretation of precision." into jb-mr2-dev
* commit '9acc8c9c53a4d3adcf3e3f220ea5e4529c3e60a4':
  Fix trackball interpretation of precision.
2013-04-08 19:15:13 -07:00
Jeff Brown
b437a79b05 resolved conflicts for merge of 21dffd5d to master
Change-Id: I37c48dee471c9d43f19c1fe4a01f70db53e2441f
2013-04-08 19:05:15 -07:00
Chet Haase
c6b0589b08 am 15c9e15e: am b9604a34: Merge "Amend getOverlay() docs for SurfaceView/TextureView" into jb-mr2-dev
* commit '15c9e15e71dba40370946ca3837b80327d2925c2':
  Amend getOverlay() docs for SurfaceView/TextureView
2013-04-08 17:05:39 -07:00
Jeff Brown
97b968b6b3 Merge "Fix trackball interpretation of precision." into jb-mr2-dev 2013-04-09 00:00:38 +00:00
Jeff Brown
3a2854bcee Merge "Queues, queues, queues and input." into jb-mr2-dev 2013-04-08 23:59:24 +00:00
Jeff Brown
c574b68cbb Fix trackball interpretation of precision.
The trackball to dpad synthesis was using the MotionEvent's precision
field to determine a threshold for movement but the calculations
involved did not actually make sense for any value of precision
less than 2.0.  This worked fine before since the InputReader
hardcodes the trackball's precision to 6.

Injected trackball events may have a different precision which can
result in the thresholds being set inappropriately.  For example,
it was not possible to move focus by one unit at a time when
the precision was set to 1.0.

The old code was probably using precision as a way to set a
threshold based on the trackball moving by some minimum number
of physical ticks, in this case 2.  But the code will work just
as well if we set an absolute threshold based on distance
traveled given that the input system is already expected to
normalize the trackball movements before delivering them to the
application.

So stop using precision.

Bug: 8473020
Change-Id: I3c6f7fb1b507f8cf5608b47550e7345fea3352fa
2013-04-08 16:53:59 -07:00
Jeff Brown
f9e989d5f0 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
2013-04-08 15:31:47 -07:00
Chet Haase
95399493c6 Amend getOverlay() docs for SurfaceView/TextureView
SurfaceView and TextureView do not currently support overlays
correctly; the docs now reflect this constraint.

Change-Id: I79183c02b51ae4cd14638198d0668b2c2e3e22e1
2013-04-08 14:30:31 -07:00
Chet Haase
b7045d2fb9 am cbfce445: am edf6f4b4: Make adding views specific to a ViewGroup\'s overlay
* commit 'cbfce445c500a12fee63e526251471839f44e26b':
  Make adding views specific to a ViewGroup's overlay
2013-04-08 07:39:17 -07:00
Chet Haase
edf6f4b49f Make adding views specific to a ViewGroup's overlay
Adding views to views (possible with the new Overlay API) is weird.
This change moves the view-management facilities of Overlay to a subclass
that is specific to the overlay returned from ViewGroup.getOverlay().
So now you can add drawables to all view overlays, but only add/remove
views to/from the overlay returned from ViewGroup.getOverlay().

Also, the previous approach of using an interface for Overlay was
changed to classes for both ViewOverlay and ViewGroupOverlay.

Finally, this change makes not handling touch correctly the proper,
and documented, behavior of overlay views. There are various tricky issues
to sort out with input in overlays (including click handling as well as focus)
and we don't want developers starting to use overlays as some kind of general
container hierarchy, so we're purposely constraining overlays to have visual-only
behavior.

Issue #8459085 Overlay needs to handle touch correctly

Change-Id: I207b8dbf528f87c92369d270d8b0a6556826d207
2013-04-08 07:30:12 -07:00
Michael Wright
8775af6319 am aaddfacf: am bdb706e4: Merge "Pipe through device resolution information" into jb-mr2-dev
* commit 'aaddfacf962655d82f3ad64723ea408f949a2b79':
  Pipe through device resolution information
2013-04-05 15:46:40 -07:00
Michael Wright
bdb706e48d Merge "Pipe through device resolution information" into jb-mr2-dev 2013-04-05 21:43:31 +00:00
Jeff Brown
ae9d6aa6d9 am 4c2a7b23: am 4a706bc6: Merge "Correctly manage the lifecycle of IME InputChannels." into jb-mr2-dev
* commit '4c2a7b23f5f012cf00357035f840a32d4da20eb5':
  Correctly manage the lifecycle of IME InputChannels.
2013-04-05 14:09:41 -07:00
Jeff Brown
4a706bc6f1 Merge "Correctly manage the lifecycle of IME InputChannels." into jb-mr2-dev 2013-04-05 20:57:01 +00:00
Jeff Brown
1951ce86c2 Correctly manage the lifecycle of IME InputChannels.
InputChannels are normally duplicated when sent to a remote process
over Binder but this does not happen if the recipient is running within
the system server process.  This causes problems for KeyGuard because the
InputMethodManagerService may accidentally dispose the channel
that KeyGuard is using.

Fixed the lifecycle of InputChannels that are managed by the IME
framework.  We now return a duplicate of the channel to the application
and then take care to dispose of the duplicate when necessary.
In particular, InputBindResult disposes its InputChannel automatically
when returned through Binder (using PARCELABLE_WRITE_RETURN_VALUE).

Bug: 8493879
Change-Id: I08ec3d13268c76f3b56706b4523508bcefa3be79
2013-04-04 22:45:12 -07:00
Michael Wright
c6091c64c9 Pipe through device resolution information
Bug: 8424494
Change-Id: Iafeeee0d5cd29342c1cdc86b9616222aaa5d1b94
2013-04-04 18:10:37 -07:00
Romain Guy
49084108f2 am 9ff408c1: am faec826b: Merge "Reduce the size of dirty invalidates" into jb-mr2-dev
* commit '9ff408c17be8cccc9820d46b207673be22bfbe84':
  Reduce the size of dirty invalidates
2013-04-04 15:57:56 -07:00
Romain Guy
faec826bd6 Merge "Reduce the size of dirty invalidates" into jb-mr2-dev 2013-04-04 22:47:49 +00:00
Romain Guy
e55945e219 Reduce the size of dirty invalidates
Remove remnants from times long gone. We don't need to redraw the
union of the previous frame's dirty region and the new dirty
region.

Change-Id: I9fb96f99a6a72c2233f9ca563cf6432a42b2b65b
2013-04-04 15:29:09 -07:00
Chet Haase
b38af997f6 am 98f69881: am 77d94957: Merge "Adding small animation features" into jb-mr2-dev
* commit '98f69881ce28fef261da45c7fbd7ee79e9b8d637':
  Adding small animation features
2013-04-04 11:33:56 -07:00
Chet Haase
b989502e5c Adding small animation features
RectEvaluator is useful when animating object bounds.
The other change is a hidden API that allows temporary suspension
of layout, useful for animations which need to animate view bounds
without conflicting with layout passes that might happen in the middle
of the animation.

Change-Id: I3dc08cb6ec455dfa3409e825506b218d3ea63d7a
2013-04-04 11:00:07 -07:00
Dan Morrill
e4d9a01bfc Phase 1 of refactoring SystemServer.
SystemServer is currently a monolithic class that brings up key system
services. This change is the first phase of refactoring it to be more
configurable. Specifically, it adds a set of on/off switches used to control
startup of individual services. Future plans include finer grained controls
and a more explicit and consistent startup sequence for these services.

Change-Id: I7299f5ce7d7b74a34eb56dffb788366fbc058532
2013-04-04 09:49:22 -07:00
Jeff Brown
739d5507e0 am 6d21e404: am 41c07671: Merge "Clear mCurSender when mCurChannel is modified." into jb-mr2-dev
* commit '6d21e404ce834779b061fb519d85c9f95dccfd3d':
  Clear mCurSender when mCurChannel is modified.
2013-04-03 18:05:41 -07:00
Jeff Brown
4d656885ed Clear mCurSender when mCurChannel is modified.
This fixed an issue where an InputEventSender might outlive
its usefulness and continue to be used well after it should
have been disposed or recreated.

Also improves the queue management somewhat.

Bug: 8493879
Change-Id: I7e0b6a3c43cbe72f8762991f5d36560feebd214b
2013-04-03 14:40:57 -07:00
Scott Kennedy
7ee8002aab resolved conflicts for merge of b5d6b3fe to master
Change-Id: Ib7beb5c22fadd7aae5039d49a819fbc91d355b6b
2013-04-03 11:15:50 -07:00
Scott Kennedy
688c334485 am 23eda7cd: am 76f9a0a6: am c318dbcf: am 2dd01a0b: am 555c82cd: am f7c06ddb: Merge "docs: Typos and other fixes" into jb-mr1-dev
* commit '23eda7cd0a2b80bafcba7c24f49a73a2f11f782f':
  docs: Typos and other fixes
2013-04-03 09:38:49 -07:00
Scott Kennedy
23eda7cd0a am 76f9a0a6: am c318dbcf: am 2dd01a0b: am 555c82cd: am f7c06ddb: Merge "docs: Typos and other fixes" into jb-mr1-dev
* commit '76f9a0a6800d8a8945156a95dea79f16ec704b3d':
  docs: Typos and other fixes
2013-04-03 09:35:18 -07:00
Scott Kennedy
76f9a0a680 am c318dbcf: am 2dd01a0b: am 555c82cd: am f7c06ddb: Merge "docs: Typos and other fixes" into jb-mr1-dev
* commit 'c318dbcf358772ab53b0380edb3e487a773ad2d8':
  docs: Typos and other fixes
2013-04-03 09:31:32 -07:00
Scott Kennedy
555c82cd43 am f7c06ddb: Merge "docs: Typos and other fixes" into jb-mr1-dev
* commit 'f7c06ddbfc79921d389ed6699df17e54c428571e':
  docs: Typos and other fixes
2013-04-03 09:20:38 -07:00
Scott Kennedy
f7c06ddbfc Merge "docs: Typos and other fixes" into jb-mr1-dev 2013-04-03 16:16:35 +00:00
Jeff Brown
fc00755627 am 4c20e618: am a4ca8ea0: Fix reference cycle in InputEventReceiver and Sender.
* commit '4c20e61808a75f217e99b589261821ca453cea1b':
  Fix reference cycle in InputEventReceiver and Sender.
2013-04-02 20:08:01 -07:00
Jeff Brown
a4ca8ea0ad Fix reference cycle in InputEventReceiver and Sender.
If the receiver or sender was not properly disposed, then
the underlying input channel might be leaked because the
native peer was holding a strong reference to the object.

Switched to using a weak reference.

Also updated Binder to use a new helper created for this purpose.

Change-Id: I19680bf96d0548777bff02aa1d91874d1e8e41da
2013-04-02 18:59:15 -07:00
Brian Colonna
c849fbcf3d resolved conflicts for merge of 5856ee4b to master
Change-Id: I60ba85bc246b9cf25d467b2099535aad47f82ca7
2013-04-02 17:16:55 -04:00
Brian Colonna
1eccc0cf5f Merge "FUL now restarts when flipping tablet 180 (bug 7484464)" into jb-mr2-dev 2013-04-02 20:19:24 +00:00
Chet Haase
d4c5453464 am 7aab1134: am c99d3c1f: Stop jank from window animations overlapping activity animations
* commit '7aab1134236a30aa2e595be55fcc7b5c90982413':
  Stop jank from window animations overlapping activity animations
2013-04-02 11:03:16 -07:00