93 Commits

Author SHA1 Message Date
Jeff Brown
bc68a59c02 Report the external display size to the input reader.
The input reader needs this information so that it knows how to
interpolate touches on an external touch screen.

Changed Display so that it asks the WindowManager what the real
display size is (as opposed to the raw display size).  This means
it now takes into the forced display size set by
adb shell am display-size.

Replaced all calls to getRealWidth() / getRealHeight() /
getRealMetrics() in the WindowManager and replaced them with direct
usages of the mCurDisplayWidth / mCurDisplayHeight so that the WM
doesn't end up making a reentrant Binder call into itself.

Fixed the table status bar HeightReceiver so that it updates the
height on all configuration changes since it is possible that the
display size changed independently of an external HDMI display
being plugged / unplugged.

Improved the Display class documentation to make the distinctions
betweeen the various sizes clearer.

Change-Id: I3f75de559d3ebffed532ab46c4ae52c5e7f1da2b
2011-07-25 20:10:12 -07:00
Dianne Hackborn
91c9ac05ef Fix issue #5050039: Launcher is sometimes rendering...
...underneath the system/status bar

Change-Id: If65aba64df9362d4721051846a6da6d096a3dc9b
2011-07-22 10:41:38 -07:00
Jeff Brown
ea4265512c Fix drag and drop regression.
Bug: 5032496

Change-Id: I6504df1261f563092dadc84155d413f43e921ab8
2011-07-18 18:09:15 -07:00
Jeff Brown
9302c8796f Refactor input dispatcher use of window/app handles.
This change moves the cached window and application input state
into the handle objects themselves.  It simplifies the dispatcher
somewhat because it no longer needs to fix up references to
transient InputWindow objects each time the window list is updated.

This change will also make it easier to optimize setInputWindows
to avoid doing a lot of redundant data copying.  In principle, only
the modified fields need to be updated.  However, for now we
continue to update all fields in unison as before.

It turns out that the input dispatcher was inappropriately retaining
pointers to InputWindow objects within the mWindows InputWindow
vector.  This vector is copy-on-write so it is possible and the
item pointers to change if an editing operation is performed on
the vector when it does not exclusively own the underlying
SharedBuffer.  This bug was uncovered by a previous change that
replaced calls to clear() and appendVector() with a simple use
of operator= which caused the buffer to be shared.  Consequently
after editItemAt was called (which it shouldn't have, actually)
the buffer was copied and the cached InputWindow pointers became
invalid.  Oops.  This change fixes the problem.

Change-Id: I0a259339a6015fcf9113dc4081a6875e047fd425
2011-07-14 04:11:21 -07:00
Jim Miller
cb925e7a56 Merge "Fix 4689527: Fix rendering issue with thumbnails on phones" 2011-07-07 14:35:18 -07:00
Jim Miller
28637bacfd Fix 4689527: Fix rendering issue with thumbnails on phones
This fixes a bug where the phone thumbnail scale was being miscalculated
for the square aspect of thumbnails on phones.  The code now constrains
thumbnails to fit the smaller of screen width and screen height.

Change-Id: I174abacd4cf3dcf124e10fe8980fb01fe299ec6a
2011-07-07 14:26:32 -07:00
Jeff Brown
a4d1bc5172 Drop obsolete touch screen hacks.
Change-Id: I47354c37ee2cc2b36340eb709bb5043b3ba78ed9
2011-07-01 19:23:40 -07:00
Dianne Hackborn
58b8684177 Merge "Fix issue #4770360: older app compatibility mode is really tiny on ICS phones" 2011-06-23 12:13:06 -07:00
Dianne Hackborn
2b31d53161 Fix issue #4770360: older app compatibility mode is really tiny on ICS phones
We were applying the density compat mode scaling multiple times to
display metrics, causing bad values.

Change-Id: Iafafd9a5e94b9d774cd2715bf968e91602a1bd82
2011-06-23 12:00:54 -07:00
Dianne Hackborn
bd67cddd0d Merge "Don't report a resize unless the window's surface actually changed." 2011-06-22 14:13:35 -07:00
Dianne Hackborn
b961cd2c80 Don't report a resize unless the window's surface actually changed.
Change-Id: I133cf8e417753dba60d23a3bfc1c84ace983b335
2011-06-22 12:10:25 -07:00
Svetoslav Ganov
7961be75f4 AccessibilityNodeInfo bounds inconsistent with compatibility mode.
1. In compatibility mode a window wide scaling is applied to stretch
   the content. However, AccessibilityNodeInfos retrieved from that
   window contain bounds in application's view of the world and need
   to be scaled to properly relect what a sighted user sees.

Change-Id: Iebbb99526fc327f45b5cede89ba8c32e6ebd8845
2011-06-21 13:02:03 -07:00
Jeff Brown
474dcb5c3d Add support for disabling pointer gestures.
Made it possible for individual windows to disable pointer gestures
while the window has focus using a private API.

Cleaned up the InputReader configuration code to enable in-place
reconfiguration of input devices without having to reopen them all.
This change makes changing the pointer speed somewhat nicer since the
pointer doesn't jump back to the origin after each change.

Change-Id: I9727419c2f4cb39e16acb4b15fd7fd84526b1239
2011-06-14 22:07:31 -07:00
Jeff Brown
bc38d3e44e Merge "Optimize orientation changes." 2011-06-10 18:59:21 -07:00
Jeff Brown
2457237532 Optimize orientation changes.
Modified setRotation to allow it to restart a rotation in
progress as long as the rotation animation has not yet started.
This enables the system to recover more quickly from mispredicted
orientation changes.

Removed the call to System.gc() when freezing the display, which
added 60-80ms before we even started the orientation change.
We used to need this to make it less likely that an upcoming GC
would cause a pause during the window animation, but this is
not longer a concern with the concurrent GC in place.

Changed the wallpaper surface to be 32bit.  This accelerates
drawing and improves the overall appearance slightly.

Reduced code duplication in the WallpaperManager.

Change-Id: Ic6e5e8bdce4b970b11badddd0355baaed40df88a
2011-06-10 18:13:30 -07:00
Dianne Hackborn
7bbf6f7d11 am 8297f669: am 3aabdeac: am 5ba2e872: Merge "Fix for not reporting correct "sw" in compat mode." into honeycomb-mr2
* commit '8297f669356ee997c5faa745815e8b9a7009fba7':
  Fix for not reporting correct "sw" in compat mode.
2011-06-09 18:42:55 -07:00
Dianne Hackborn
f741e679c4 resolved conflicts for merge of e2aa0490 to master
Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
2011-06-09 17:50:36 -07:00
Dianne Hackborn
48a7651823 Fix for not reporting correct "sw" in compat mode.
Change-Id: Ia225c94b36ccc3589d417aafd5680247678eddfd
2011-06-08 22:26:33 -07:00
Dianne Hackborn
5fd2169eab Work on issue #4518815: Compatibility mode introduces compatibility regression...
...for Market App iRunner

There were a lot of serious issues with how we updated (or often didn't update)
the display and resource state when switching compatibility mode in conjunction
with restarting and updating application components.  This addresses everything
I could find.

Unfortunately it does *not* fix this particular app.  I am starting to think this
is just an issue in the app.  This change does fix a number of other problems
I could repro, such as switching the compatibility mode of an IME.

Also a few changes here and there to get rid of $#*&^!! debug logs.

Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
2011-06-08 18:45:43 -07:00
Jeff Brown
774ed9d953 resolved conflicts for merge of 8b2c0014 to master
Change-Id: I33a5a2949dc6c2d09e8196ba8c7128caa7ac2361
2011-06-07 17:48:39 -07:00
Dianne Hackborn
aefc94f19a am 4bd50588: am fc3fa5dc: am 1b405592: Merge "Fix issue #4539687: At least one compatibility-mode app (Androminion)..." into honeycomb-mr2
* commit '4bd505883df3d8ca7583d854f1c71302c615519d':
  Fix issue #4539687: At least one compatibility-mode app (Androminion)...
2011-06-07 17:18:16 -07:00
Jeff Brown
ed48fa89a8 Merge "Touch pad improvements. Bug: 4124987" into honeycomb-mr2 2011-06-06 20:30:47 -07:00
Jeff Brown
bb3fcba0ca Touch pad improvements.
Bug: 4124987

Only show one spot per touch point instead of one spot per
finger for multitouch gestures.

Tweaked the pointer acceleration curves.

Dissociated the hover/tap timeouts from the "tap" timeout
since they mean very different things.

Change-Id: I7c2cbd30feeb65ebc12f6c7e33a67dc9a9f59d4c
2011-06-06 19:23:05 -07:00
Dianne Hackborn
bc7386c261 Fix issue #4539687: At least one compatibility-mode app (Androminion)...
...will only launch when held in portrait mode.

There was a bug in the window manager that caused all of the careful code to
update the configuration in sync with movements between activities to break.
Now it is fixed, so this app works, and we no longer see the bad slow orientation
changes when switching between activities that want to be in different
orientations.

Change-Id: I5d93f99649849bdaca2e8bebade6b91b8b6cf645
2011-06-06 17:29:10 -07:00
Jeff Brown
7218d830e2 resolved conflicts for merge of ca2b552d to master
Change-Id: I2f3693a59042ac5aa2d7bcdc3a504c78dc99a18b
2011-06-03 15:50:27 -07:00
Dianne Hackborn
50469db071 am 7322e557: am a4cfcf10: am 75d6b3c2: Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2
* commit '7322e557cfe42da42779625d69ced2db74a9df90':
  Fix issue #4502672: Wrong xml resources used for homescreen widgets.
2011-06-03 13:17:00 -07:00
Dianne Hackborn
f3b57def93 resolved conflicts for merge of 7e193916 to master
Change-Id: If06892419319c3a2d4ab6b03dd3ceb99b83803b5
2011-06-03 12:26:54 -07:00
Dianne Hackborn
9313a27797 am 096762d6: am 8075fe48: am 78470718: Fix various places that were using the wrong display metrics.
* commit '096762d6efcae6300c02919bc6b3eaeeffccf91d':
  Fix various places that were using the wrong display metrics.
2011-06-02 16:50:59 -07:00
Jeff Brown
1a84fd1fb7 Add a preference panel for mouse speed.
Bug: 4124987
Change-Id: I3ce175d268a1d043cf5878481261b1049a15a149
2011-06-02 15:39:21 -07:00
Dianne Hackborn
ed60f81940 resolved conflicts for merge of 76450622 to master
Change-Id: I26ccd8f264e65f100d894f43cf597a781552db83
2011-06-02 09:20:52 -07:00
Dianne Hackborn
75d6b3c2a2 Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2 2011-05-31 18:05:26 -07:00
Dianne Hackborn
2f0b17573d Fix issue #4502672: Wrong xml resources used for homescreen widgets.
There was a race in the system process between applying the initial
configuration and executing code in higher-level system services
like the app widget service that relies on the config.  For some
reason it starting showing up more after my code changes; it should
now be completely fixed.

Also fix the activity starting window to run in compatibility mode
if its application is going to be in compatibility mode.

And some various cleanup and small fixes.

Change-Id: I0566933bf1bbb4259c1d99a60c0a3c19af1542e5
2011-05-31 18:04:14 -07:00
Jeff Brown
c272d42794 Merge "Use ViewConfiguration to seed input system configuration." into honeycomb-mr2 2011-05-31 15:42:18 -07:00
Jeff Brown
214eaf4887 Use ViewConfiguration to seed input system configuration.
Fix bug where the pointer presentation would be updated on
any input reader timeout rather than only when a pointer gesture
is in progress.

Bug: 4124987
Change-Id: Ie9bba4a0b3228d55e45e65fa2ede5cd6ba887a08
2011-05-31 15:00:59 -07:00
Dianne Hackborn
784707187d Fix various places that were using the wrong display metrics.
Change-Id: I1ac2a0c4a1b7c851dbc99d26f295c7dd49b0bd5c
2011-05-27 17:09:19 -07:00
Dianne Hackborn
81e56d535c Rework how we decide whether to use system or status bar.
The PhoneWindowManager is now responsible for determing this,
since it needs to do this before we can generate the configuration
since we need to take into account the system bar size we will use.

Also the Display should now report the screen height without
including the system bar.

Change-Id: I82dfcc5e327e4d13d82c373c6c870f557a99b757
2011-05-26 10:46:19 -07:00
Daniel Sandler
8c1132e3ce Merge "Framework support for Android Dreams." 2011-05-26 06:01:41 -07:00
Joe Onorato
2a3c67c0e9 am cfb046de: am 2c09a9c0: am 5520610c: Merge "Make adb shell am display-size persistent." into honeycomb-mr2
* commit 'cfb046dead49568de6f6808a697e0508ef39a3a6':
  Make adb shell am display-size persistent.
2011-05-25 21:29:07 -07:00
Jeff Brown
86ea1f5f52 Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
Added a new PointerIcon API (hidden for now) for loading
pointer icons.

Fixed a starvation problem in the native Looper's sendMessage
implementation which caused new messages to be posted ahead
of old messages sent with sendMessageDelayed.

Redesigned the touch pad gestures to be defined in terms of
more fluid finger / spot movements.  The objective is to reinforce
the natural mapping between fingers and spots which means there
must not be any discontinuities in spot motion relative to
the fingers.

Removed the SpotController stub and folded its responsibilities
into PointerController.

Change-Id: Ib647dbd7a57a7f30dd9c6e2c260df51d7bbdd18e
2011-05-25 14:37:17 -07:00
Joe Onorato
571ae90801 Make adb shell am display-size persistent.
Change-Id: If3d5d18729f4e89eb7e689994deadd996fd487e9
2011-05-25 11:40:21 -07:00
Daniel Sandler
0601eb7953 Framework support for Android Dreams.
A Dream is an activity that is launched by the window
manager after a specified idle time. You might think of this
as a "screen saver", but with the same capacity for
interactivity as any other application.

The window manager maintains a timer (like the screen lock
timer) that is reset on userActivity; the timer is suspended
during wakelocks and when the screen is off.

When the timer elapses, the user's preferred dream module is
launched (by reading Settings.Secure.DREAM_COMPONENT, which
is configured through the Settings app UI).

Like a dock app, the user can install new dreams and a
single application package may contain multiple dream
activities. Unlike the dock mode, however, there is no
"screensaver mode" for the system to manage. This allows us
to offer the user the ability to run a dream at any time, in
addition to making the overall mechanism quite simple.

There is no public API for this facility.

There is, however, a useful/recommended base class for dream
activities in the support library (change I4559a958).

Change-Id: Ied691856f88cfa38a7aca496d015f9a595da72f2
2011-05-24 10:28:52 -04:00
Dianne Hackborn
161e67ff3b resolved conflicts for merge of 06a8ceac to master
Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
2011-05-19 21:44:52 -07:00
Dianne Hackborn
69cb87576b Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
2011-05-19 18:23:29 -07:00
Romain Guy
71fcc865e3 Merge "Code cleanup." 2011-05-19 16:16:43 -07:00
Romain Guy
88b4f153e2 Code cleanup.
Change-Id: Ia6ea04b83832db2f39e3168ef2596c24273a7ef3
2011-05-19 16:15:46 -07:00
Dianne Hackborn
d37b84edf5 am ba8fc5b0: am 8416e5cf: am 6ad07db7: Merge "Fix fake display size when rotated." into honeycomb-mr2
* commit 'ba8fc5b059228402afa965e175d5f6655e3fe555':
  Fix fake display size when rotated.
2011-05-19 03:46:24 -07:00
Dianne Hackborn
8f7c271ac9 Fix fake display size when rotated.
Change-Id: Ic8a1dbe32cf0cb3c5cdc9b9294b98e810558f875
2011-05-18 15:07:48 -07:00
Dianne Hackborn
fb03c4fafe am 4f9bb17f: am c2db2144: am a429d5df: Merge "Improve compat mode scaling implementation." into honeycomb-mr2
* commit '4f9bb17f7e74746c4296100f2fbd47f0f6ead3a7':
  Improve compat mode scaling implementation.
2011-05-18 10:36:14 -07:00
Dianne Hackborn
ffb3d939cc Improve compat mode scaling implementation.
Rip out the old funky code for trying to restrict the app window
sizes to be within the compat mode range.  Instead, we know rely
entirely on scaling -- we deal with windows always with the scaling
applied so that the window manager doesn't have to deal with them
specially.  Instead, we just apply the inverse scale at the few
points we need to do something the app sees.

Change-Id: I785409dd4513b5f738684e1635dc8f770c249651
2011-05-17 18:29:51 -07:00
Dianne Hackborn
9d31154d0b am b68c768d: am 41744836: am 7916ac65: Add new command line option to change global screen size.
* commit 'b68c768ddb57407bc253230c677056329c9e4bae':
  Add new command line option to change global screen size.
2011-05-16 21:39:47 -07:00