Commit Graph

874 Commits

Author SHA1 Message Date
Chris Tate
6b3912865c Drag thumbnail fixes / improvements
* Properly wipe the thumbnail canvas before handing it to the app for
  its contents to be drawn

* Provide a getView() method in DragThumbnailBuilder that allows
  clients or subclasses to get at the associated view.  This is
  especially for clients that want to draw entire (sub)layouts as
  the drag thumbnail, by overriding onDrawThumbnail(Canvas c)
  like this:

  // Override specifically for drawing a whole ViewGroup into
  // the drag thumbnail canvas
  @Override
  public void onDrawThumbnail(Canvas c) {
      getView().dispatchDraw(c);
  }

Change-Id: Ib43ddd7cf1d44faf2d7f6ba79f102bc3c7f14596
2010-10-14 16:43:39 -07:00
Chris Tate
a32dcf7f72 Actually draw the drag thumbnail
Now sets the layer and thumbnail dimensions correctly.  Also removed the
leftover bits of the now-replaced thumbnail measurement/drawing mechanism.

Fixes bug 3077339

Change-Id: I02983648e0a7ce2ce5fee10825f744e20a3a5b8d
2010-10-14 14:41:07 -07:00
Romain Guy
909cbaf8f9 Don't draw TextView's alpha layers when not needed.
Change-Id: Iedf42cbc62d727f18500c78fcccf2d081a761fec
2010-10-13 18:19:48 -07:00
Romain Guy
67a2f7b5a1 Never skip drawing SurfaceViews.
Change-Id: I07fbc632b01d96cee16b6e000e0cbf05238a442b
2010-10-13 17:24:41 -07:00
Daniel Sandler
db6303e51e Merge "Dynamically show the menu button on the system bar." 2010-10-13 16:32:07 -07:00
Adam Powell
d8404b2373 Allow icon+text action buttons
Change-Id: I96d1f3958de3ac13cadbab108b87d6bae96e9473
2010-10-13 14:35:19 -07:00
Romain Guy
41030da168 Add a getNativeMatrix() API.
This API can be used by WebView to apply the appropriate transform
on its rendering.

Change-Id: I79aa39a29805f462fb08226370328815e74bdc52
2010-10-13 13:40:37 -07:00
Daniel Sandler
e02d808abf Dynamically show the menu button on the system bar.
Windows with FLAG_NEEDS_MENU_KEY (or windowNeedsMenuKey=true
in their theme) will cause the system bar to show a menu
icon. (Note that the phone's status bar currently ignores
this, but phones tend to have hardware menu keys anyway.)

Additionally, all windows whose package's SDK version is
pre-Honeycomb will have FLAG_NEEDS_MENU_KEY set by default.

Bug: 3003728

Change-Id: I2d983763a726ea4f32cd1af9b0390e30478b11d1
2010-10-13 16:25:43 -04:00
Chris Tate
048691cfac Don't stomp on the drag-focus bookkeeping inadvertently.
Also don't update the focus tracking redundantly.
Fixes bug 3076468

Change-Id: I021e1bb91134d5226735d9510ad7f9a7b650f93f
2010-10-12 17:39:18 -07:00
Chris Tate
91e9bb3b46 Elide undelivered drag-location messages
The recipient app could be receiving drag location updates faster than
it handled them, leading to progressive poor responsiveness.  Now we
discard any undelivered pending location updates and replace them with
the newest data point when the location is updated.

Change-Id: I7299d205a0ef8ef8f5f32fd14e9ef87383d92717
2010-10-12 12:58:43 -07:00
Romain Guy
a3496a9e60 Fix invisible views issue in Launcher.
Change-Id: Ic7cb8f418b5879110eaea5a9c5fdb4f237ca4cab
2010-10-12 11:53:24 -07:00
Romain Guy
c00972bb16 Don't recreate a new texture every time we draw a layer.
Change-Id: I3c28aff5acffc7c6f1ac74805869725426c62d28
2010-10-12 11:31:07 -07:00
Romain Guy
d10cd5765a Always create OpenGL accelerated windows in RGBA 8888.
Bug #3081600

The OpenGL renderer in libhwui uses a single EGL context per process and
thus create it with an RGBA 8888 EGL configuration. To ensure that all
windows are compatible with this configuration, this change modifies
the window manager and SurfaceFlinger.

The window manager now checks the window's flags and if the window is
hardware accelerated, it forces the window's pixel format to be
translucent when creating the surface. The window itself is still
marked as opaque if we know that the window will be opaque on screen.
This keeps existing optimizations in place.

Similarly in SurfaceFlinger, a translucent Surface can now be created
with the Surface.OPAQUE flag, indicating SurfaceFlinger that the surface
does not require blending, despite its RGBA 8888 configuration.

Change-Id: Ic747b6b12564ba064412d842117880fcc199eb7c
2010-10-12 11:00:18 -07:00
Romain Guy
53ca03d9a3 Don't set hwAccelerated=true when libhwui is not present.
Change-Id: I6df5a89e4b4d94d76e96b5d0a678b7a8f646268a
2010-10-12 10:34:25 -07:00
Jeff Brown
4231124c9d Merge "Fix an event injection bug when the policy is bypassed." 2010-10-11 18:15:38 -07:00
Romain Guy
d5d2b7382c Merge "Don't draw fully transparent views/primitives." 2010-10-11 18:00:43 -07:00
Romain Guy
dbc26d2ba1 Don't draw fully transparent views/primitives.
Change-Id: Icd7d8ef1f57b51a24faf32f7004125e6300d4fdc
2010-10-11 17:58:29 -07:00
Jeff Brown
e20c9e0264 Fix an event injection bug when the policy is bypassed.
Added the concept of a "trusted" event to distinguish between events from
attached input devices or trusted injectors vs. other applications.
This change enables us to move certain policy decisions out of the
dispatcher and into the policy itself where they can be handled more
systematically.

Cherry pick of b931a1b4 from gingerbread into master.

Change-Id: I700a5f07b8b227878cea9437a289a45a245c0424
2010-10-11 17:54:12 -07:00
Jeff Brown
dd8b0c9040 am 41aabeb5: am 1e6a3a53: Merge "Added more robust tracking and cancelation of events." into gingerbread
Merge commit '41aabeb51305d19747687f246080f44fc2a74435'

* commit '41aabeb51305d19747687f246080f44fc2a74435':
  Added more robust tracking and cancelation of events.
2010-10-11 17:42:30 -07:00
Romain Guy
101e2ae00c Redraw the screen when needed.
Bug #3085265

Change-Id: Ibb47500f819b823eb4f3dee829f0396dce9a3d65
2010-10-11 12:41:21 -07:00
Jeff Brown
325b05f611 am b13998f2: am d00b4386: Merge "Clarify some comments on individual key codes." into gingerbread
Merge commit 'b13998f2b482ff0ebe96cd683801758a01d10799'

* commit 'b13998f2b482ff0ebe96cd683801758a01d10799':
  Clarify some comments on individual key codes.
2010-10-10 17:45:25 -07:00
Romain Guy
fd5072606b Reset the dirty region after drawing in hardware.
Change-Id: I687419f2a95d5d7c51913467bd80249244102725
2010-10-10 15:46:46 -07:00
Jeff Brown
41aabeb513 am 1e6a3a53: Merge "Added more robust tracking and cancelation of events." into gingerbread
Merge commit '1e6a3a53fc4d56e3a0f86c8721dedfd46e738a32' into gingerbread-plus-aosp

* commit '1e6a3a53fc4d56e3a0f86c8721dedfd46e738a32':
  Added more robust tracking and cancelation of events.
2010-10-10 14:50:38 -07:00
Jeff Brown
b699726018 Added more robust tracking and cancelation of events.
This change fixes several issues where events would be dropped in the
input dispatch pipeline in such a way that the dispatcher could not
accurately track the state of the input device.

Given more robust tracking, we can now also provide robust cancelation
of input events in cases where an application might otherwise become
out of sync with the event stream due to ANR, app switch, policy decisions,
or forced focus transitions.

Pruned some of the input dispatcher log output.

Moved the responsibility for calling intercept*BeforeQueueing into
the input dispatcher instead of the input reader and added support for
early interception of injected events for events coming from trusted
sources.  This enables behaviors like injection of media keys while
the screen is off, haptic feedback of injected virtual keys, so injected
events become more "first class" in a way.

Change-Id: Iec6ff1dd21e5f3c7feb80ea4feb5382bd090dbd9
2010-10-10 14:45:51 -07:00
Dianne Hackborn
ca33268ef8 am 18e225b4: am bfba7cab: Fix issue #3001362: API REVIEW: android.view.InputQueue.Callback
Merge commit '18e225b42b77c48efa63f245a4137c5f74302e26'

* commit '18e225b42b77c48efa63f245a4137c5f74302e26':
  Fix issue #3001362: API REVIEW: android.view.InputQueue.Callback
2010-10-08 17:59:52 -07:00
Mike Dodd
9568a5ab2e Merge "HardwareRenderer: When throwing an exception because of an EGL error, include the specific error." 2010-10-08 15:33:45 -07:00
Mike Dodd
5d3e2ea6f3 HardwareRenderer: When throwing an exception because of an EGL
error, include the specific error.

Change-Id: I8e4b0cdbc207824df4f4bb55c3b379b0ee4aeec2
2010-10-08 14:43:16 -07:00
Jeff Brown
b13998f2b4 am d00b4386: Merge "Clarify some comments on individual key codes." into gingerbread
Merge commit 'd00b4386aed2ef58077490ca7de7d93b98ed51fb' into gingerbread-plus-aosp

* commit 'd00b4386aed2ef58077490ca7de7d93b98ed51fb':
  Clarify some comments on individual key codes.
2010-10-08 12:48:27 -07:00
Dianne Hackborn
c4dfe3d5c0 am 92d29c66: am a2a0a98a: Merge "Fix NPE if there is no accelerometer." into gingerbread
Merge commit '92d29c66f5cb69627172d21057e672eaba2eb03f'

* commit '92d29c66f5cb69627172d21057e672eaba2eb03f':
  Fix NPE if there is no accelerometer.
2010-10-08 12:39:14 -07:00
Jeff Brown
224d4a1535 Clarify some comments on individual key codes.
Change-Id: I03cce0ad69aaab5b71e5017982b01afd27285d2f
2010-10-07 20:28:53 -07:00
Chet Haase
e0ee2e9f31 New TimeInterpolator interface for android.animation package.
The new animation package's reliance on the old Interpolator interface (in
android.view.animation) was an eyesore. Adding TimeInterpolator, and having the
old Interpolator interface extend it, allows the new Animator classes to break
the tie to the older animation package completely. However, developers can still
use the older Interpolator-based classes, such as AccelerateInterpolator,
because they all implicitly extend the new TimeInterpolator class.

Change-Id: I41132fa56167ba564f4839113289114d0ea31a92
2010-10-07 12:27:06 -07:00
Dianne Hackborn
18e225b42b am bfba7cab: Fix issue #3001362: API REVIEW: android.view.InputQueue.Callback
Merge commit 'bfba7cab94cd9cf28e561159dbbe934dc83a6f0a' into gingerbread-plus-aosp

* commit 'bfba7cab94cd9cf28e561159dbbe934dc83a6f0a':
  Fix issue #3001362: API REVIEW: android.view.InputQueue.Callback
2010-10-07 07:18:08 -07:00
satok
47a44916e2 Add InputMethodEnabler for enabling input methods and subtypes
- Copyed functionarity from LanguageSettings.java

TODO: Save enabled InputMethodSubtypes

Change-Id: I7b4fb1a79cb8b3229f88773d261430e23ba7aae2
2010-10-07 14:43:16 +09:00
Romain Guy
e743bd2bac Merge "Don't clear the framebuffer when not needed." 2010-10-06 19:51:36 -07:00
Romain Guy
6b7bd24659 Don't clear the framebuffer when not needed. 2010-10-06 19:49:23 -07:00
Dianne Hackborn
bfba7cab94 Fix issue #3001362: API REVIEW: android.view.InputQueue.Callback
Change-Id: Ibc12a7326a13c318205774e226ed1f62a5cf11eb
2010-10-06 17:58:05 -07:00
Christopher Tate
5ada6cb059 More drag/drop adjustments:
* Make View.onDragEvent() public instead of protected.
* No longer @hide View.startDrag()
* Properly manage the boundaries of DRAG_STARTED / DRAG_ENDED notifications
  to windows (and as a result don't send bogus empty DRAG_STARTED events or
  double-recycle pooled DragEvents)

Change-Id: Ib75f5c1417640c82a5b043c555e02d6e6f4b4d9c
2010-10-06 17:33:10 -07:00
Mathias Agopian
7930b5bc06 am 722665c5: am ef115308: fix build. SurfaceView.setFrame needed to be hidden
Merge commit '722665c5f76e81bed646490977ea30f38aaa00da'

* commit '722665c5f76e81bed646490977ea30f38aaa00da':
  fix build. SurfaceView.setFrame needed to be hidden
2010-10-06 17:07:30 -07:00
Mathias Agopian
3243cbc9b2 am b99e81ab: am 7e6064ad: Merge "fix [3008290] passion GB surface does not send surfaceChanged notification after size change." into gingerbread
Merge commit 'b99e81ab4cccac537fc7ae8d07d59a0f6c1395d2'

* commit 'b99e81ab4cccac537fc7ae8d07d59a0f6c1395d2':
  fix [3008290] passion GB surface does not send surfaceChanged notification after size change.
2010-10-06 16:17:44 -07:00
Neel Parekh
e537858ba7 Fix pressed vs selected typo in onCreateDrawableState
Change-Id: I7a415cacf29ed8c6c558f6b29902edd76fc98ea6
2010-10-06 11:39:53 -07:00
Brian Carlstrom
c21550a8d1 Adding android.os.Debug.countInstancesOfClass
- Debug.countInstancesOfClass is just a wrapper on
  dalvik.system.VMDebug.countInstancesOfClass to avoid code from
  depending on the dalvik classes directly

- Existing usages of VMDebug.countInstancesOfClass in ActivityThread
  and ViewDebug are converted to the new Debug.countInstancesOfClass

- Existing use of OpenSSLSocketImpl.instanceCount, which is being
  removed, is converted to Debug.countInstancesOfClass(OpenSSLSocketImpl.class)

Bug: 3015791
Change-Id: Iefa781292d5b82a63bad7254c913a09deb3b7888
2010-10-05 21:38:57 -07:00
Dianne Hackborn
92d29c66f5 am a2a0a98a: Merge "Fix NPE if there is no accelerometer." into gingerbread
Merge commit 'a2a0a98ac7ce53f282a9a4caac9d382a0eb01ef9' into gingerbread-plus-aosp

* commit 'a2a0a98ac7ce53f282a9a4caac9d382a0eb01ef9':
  Fix NPE if there is no accelerometer.
2010-10-05 19:06:04 -07:00
Dianne Hackborn
a2a0a98ac7 Merge "Fix NPE if there is no accelerometer." into gingerbread 2010-10-05 19:02:52 -07:00
Dianne Hackborn
b499bb1069 Fix NPE if there is no accelerometer.
Change-Id: I983290a7fc3deda2a82b03ff564f1b7201cc3dd3
2010-10-05 18:54:49 -07:00
Adam Powell
ee7e0efcc1 am 59c4cb9e: Merge "DO NOT MERGE Fix bug 3001751 and bug 3001584 - Gingerbread API review for over-scroll" into gingerbread
Merge commit '59c4cb9e8fee03f770aa0fa1a2f0ec84ffb945b8' into gingerbread-plus-aosp

* commit '59c4cb9e8fee03f770aa0fa1a2f0ec84ffb945b8':
  DO NOT MERGE Fix bug 3001751 and bug 3001584 - Gingerbread API review for over-scroll
2010-10-05 16:46:05 -07:00
Adam Powell
737e8fe2c7 DO NOT MERGE Fix bug 3001751 and bug 3001584 - Gingerbread API review for over-scroll
Change-Id: If34c8ea4e15697420adad0bc404f3c278efd7c1b
2010-10-05 15:22:07 -07:00
Romain Guy
e21635571e Merge "Code cleanup and disable display lists for now." 2010-10-05 13:44:24 -07:00
Romain Guy
469b1dbeaf Code cleanup and disable display lists for now.
Change-Id: I681213036b5279339cb96a016d1dfb15d74dafc8
2010-10-05 13:42:35 -07:00
Christopher Tate
a0374192b9 Make View.DragThumbnailBuilder a static class
It also now uses a WeakReference to the associated View, not a hard
object pointer.

Change-Id: I37e10b3155ee7e089a72bdf050cc2d323794810f
2010-10-05 13:14:25 -07:00
Dianne Hackborn
38014763a2 am 89230e3b: am 458fc5f5: Merge "Fix issue #3041660: Camera image flips upside down when rotating device" into gingerbread
Merge commit '89230e3b7b9ec455373e3f60b62ff65589a9c57d'

* commit '89230e3b7b9ec455373e3f60b62ff65589a9c57d':
  Fix issue #3041660: Camera image flips upside down when rotating device
2010-10-05 12:54:41 -07:00