Commit Graph

4581 Commits

Author SHA1 Message Date
Eino-Ville Talvala
b2675542c2 Initial commit of new camera API, mostly just the interface.
- New core API classes in android.hardware.photography
- android.media.Image and android.media.ImageReader classes for
  application access to direct hardware image buffers.
- Additions to android.graphics.ImageFormat to describe new image
  types needed by new camera API.
- Some documentation included; very little implementation.

Bug: 9111736
Change-Id: I0680f35944d1cb8845b7dc0c67edc8c0f0864573
2013-06-07 21:29:45 +00:00
Romain Guy
81056427e8 Merge "Remove unnecessary Rect, better reuse of NinePatch objects" 2013-06-07 20:14:58 +00:00
Romain Guy
f3187b7df1 Remove unnecessary Rect, better reuse of NinePatch objects
Cloning drawables (which happens a lot) was creating copies of NinePatch
objects, which would cause the hardware renderer to generate more meshes
than necessary. Also avoid keeping a String we don't need (it was interned
but still.) Last but not least, remove 1 RectF per NinePatch in the system.

Change-Id: If4dbfa0c30892c9b00d68875e334fd5c2bde8b94
2013-06-07 12:17:11 -07:00
Svetoslav
494cb689d0 Merge "Optimizing AccessibilityNodeInfo caching." 2013-06-07 00:04:57 +00:00
Romain Guy
f69913056b Remove unnecessary allocations
Change-Id: Ia561a0a312ca2737d5afa742184f5392bb2f29a3
2013-06-06 12:10:42 -07:00
Chet Haase
e2b66ff085 Merge "Fix CrossFade transition" 2013-06-06 17:37:10 +00:00
Chet Haase
71ce4876e5 Merge "Fix crash with LayoutTransition and ViewOverlay collision" 2013-06-06 17:35:24 +00:00
Craig Mautner
d0d3ca9548 Merge "Replace arrays with ArrayList" 2013-06-06 15:33:03 +00:00
Craig Mautner
8306f87132 Merge "Delay removal of windows from WindowManager" 2013-06-06 15:31:32 +00:00
Craig Mautner
652fdfaf6f Replace arrays with ArrayList
The three arrays were being reconstructed and copied for each add
and each remove. By replacing them with ArrayList only three
constructions total are required. Also, the number of
System.arraycopy() calls is halved.

Change-Id: I0f8def1b517eb1bc5f930fcd5d3d1e0394071f0e

Conflicts:
	core/java/android/view/WindowManagerGlobal.java
2013-06-06 07:51:57 -07:00
Chet Haase
4f0c4672ac Fix CrossFade transition
Small fixes in CrossFade to handle more general situations.
Also, added API to CrossFade to enable different behaviors during
the transition.

Change-Id: I12d17ab8f8f96be370c070373112ad8a62df9115
2013-06-06 07:37:32 -07:00
Craig Mautner
05eb730ca4 Delay removal of windows from WindowManager
When relaunching activities the window manager clears out all windows
by calling a ViewRootImpl.die() in a deferred fashion. Then it
immediately deletes the ViewRootImpl and its view from its list
of windows. When the die() is eventually executed it calls
dispatchDetachedFromWindow() which tries to remove the previously
removed windows causing an Exception to be thrown.

This change waits to remove the windows until after die() has been
completed. Fixes bug 8253030.

Change-Id: I5b41be1c6b776e32128c064267653db98bd95292
2013-06-06 07:32:13 -07:00
Chet Haase
ce08ce539a Fix crash with LayoutTransition and ViewOverlay collision
When a View is added to a ViewGroupOverlay, it must not be parented
in another container. If it is, it will automatically be removed.
This works in general, but if there is a LayoutTransition on the
view's parent, then the actual removal will be delayed until the
transition completes. This means that the call to add(view) in
the ViewGroupOverlay's container will fail and throw an exception because
the view is still parented for the duration of the LayoutTransition.

This fix cancels the running transition to ensure that the view is not
parented prior to adding it to the overlay's container.

Issue #9303245 Crash combo: add(View) and animateLayoutChanges

Change-Id: Id4eaddccf64c353fc77e020882b978cdeb14c0ef
2013-06-06 07:27:53 -07:00
Svetoslav
6254f4806d Optimizing AccessibilityNodeInfo caching.
1. Before we were firing an accessibility event from the common
   predecessor of views with accessibility related state changes
   every X amount of time. These events designate that the tree
   rooted at the source is invalid and should not be cached.
   However, some of the state changes do not affect the view tree
   structure and we can just refresh the node instead of evicting
   and recaching nodes infos for views that did not change. Hence,
   we need a way to distinguish between a subtree changed over a
   node changed.

   Adding a new event type will not work since if say two siblings
   have local changes and their predecessor fires a window state
   change event, the client will drop the subtree rooted at the
   parent including the two views with changes. Subsequent, more
   specialized events emitted from the two changed siblings will
   be useless since the parent which did not changed is already
   evicted from the cache. Conversely, if the specialized events
   are fired from the two siblings with local changes and they
   are refreshed in the cache the subsequent window state change
   event from the common predecessor will force the refreshed
   nodes to be evicted.

   Hence, to enable distinction between node being changed and
   a subtree baing changed while not changing existing behavior,
   we will fire only window content change event with an additional
   argument specifying what changed - node or a subtree for now.
   Also if the changes are local to a view we fire the window
   content changed event from the view. So, the two siblings will
   fire such an event independently and the client will know that
   these are local changes and can just refresh the node. If the
   changes are structural, then we fire the window state change
   event from the common predecessor.

2. Added the input type of a text view as one of the properties
   reported by an AccessibilityNodeInfo. It is nice to prompt the
   user what input is expected.

3. Added a bundle for optional information to AccessiiblityNodeInfo.
   For example, it will be used for putting web specific properties
   that do not map cleanly to Android specific ones in WebView.

4. AccessibilityInteractionController was not taking into account
   whether the current accessibility focused node is shown before
   returing it. Hence, a disconnected node would be returned and
   caching it puts our cahche in an inconsistent state.

Change-Id: I8ed19cfb4a70bdd7597c3f105487f1651cffd9e0
2013-06-05 15:16:05 -07:00
Romain Guy
ba23e80b80 Merge "Remove string allocations when creating display lists" 2013-06-05 21:15:03 +00:00
Romain Guy
450dc7554d Remove string allocations when creating display lists
Change-Id: Id520db981a3988cb980c8da5dbea8f26ef94989f
2013-06-05 14:14:03 -07:00
John Spurlock
4dad6cab64 Unhide MotionEvent#actionToString.
Also clarify the input as unmasked, and fix a few other found doc
issues in related methods.

Change-Id: I1338a17dea0282b99229925dea8e48693e177eaa
2013-06-05 13:25:28 -04:00
Chet Haase
25a738fb25 Fix in transition canceling logic
The logic that canceled underlying animations caused a problem
when there were more than one animation in the list (due to removing
items from a list that was currently being processed elsewhere).

Change-Id: Ie207f340b5d7de4ffcf56a26c05ec394abb80224
2013-06-04 16:35:14 -07:00
Chet Haase
08735185f8 Use ArrayMap instead of HashMap in transitions
The new ArrayMap class is more efficient for small collections.
Transitions use maps all over the place to collect/use property
values in setting up the transition animations. Changing to ArrayMap
should be more efficient, especially in terms of memory allocations
and GCs.

Issue #9276256 Transitions: Reduce memory allocations

Change-Id: I07b7d4ba68d5a207808eca11943aa3578fa90e3e
2013-06-04 10:44:40 -07:00
Chet Haase
e9d32ea13e Starting new transition cancels running transition
The behavior of running a transition is janky and unpredictable,
when there is already a transition running on the same scene root.
Usually, the new transition simply jumps to the end values, or
jumps to the start values for that transition and animates from
there.

A better approach is to cancel any running transition first, the
start the new transition from that point.

Even better would be to blend old/new transitions, or at least adjust
the animation timing according to where/when the previous transition
stopped. In the meantime, this fix is at least better than the
previous approach of ignoring running transitions.

Change-Id: I4f5fabb55f6454f1e9d66589a9a7c36f9fc013fb
2013-06-04 08:46:42 -07:00
Chet Haase
867a86613d Various fixes/cleanup in Scenes and Transitions
setDuration() wasn't handled correctly for TransitionGroup; it should
propagate the value to its children.

Also, videos with no ids were not being handled correctly. The transition code was
using the default id on those views (-1) to store start/end data about the view,
causing multiple non-id views to clobber values in the hashmaps. The correct approach
should be to ignore default id values - only store information about the view
instances, not about the unset ids.

Also, added a new test InterruptTest to be used to fix the current behavior of
not handling situations where new transitions start while old ones are still taking place.

Change-Id: I4e880bdbb33cc26d487bceb0d56e463e72f7621f
2013-06-03 16:37:05 -07:00
Adam Powell
3f7a6935d3 Merge "Fix a bug resolving the correct icon/logo in action bars" 2013-06-01 00:07:05 +00:00
Adam Powell
04fe6ebb9f Fix a bug resolving the correct icon/logo in action bars
Remove some abstraction-breaking magic in ActionBarView and replace it
with proper resolution of the icon/logo when creating a window. The
old implementation relied on the ActionBarView's context being an
Activity.

Bug 9171554

Change-Id: Idbbb1942622195dcb55e8119f2d64287b07bb509
2013-05-31 15:00:24 -07:00
Jean Chalard
e507c840c8 am 44baed2d: am af9e5e5f: Merge "Improve the documentation for InputConnection." into jb-mr2-dev
* commit '44baed2dc31d29c48f5d49577c109ca3903ad915':
  Improve the documentation for InputConnection.
2013-05-30 19:49:23 -07:00
Jean Chalard
44baed2dc3 am af9e5e5f: Merge "Improve the documentation for InputConnection." into jb-mr2-dev
* commit 'af9e5e5f618448f77f74bb36e0adbe88cb2ae156':
  Improve the documentation for InputConnection.
2013-05-30 19:47:41 -07:00
Jean Chalard
e811de2d6c Improve the documentation for InputConnection.
- Add many details to most methods.
- Add comments specific to IME authors and to editor authors.
- Add missing return value docs.
- Straighten out single-spacing vs double spacing.

Bug: 8843866
Change-Id: If1f6dcf0457d5332a7ebb1ebfb1967c6ff0df722
2013-05-30 18:03:39 +09:00
Romain Guy
c4ea109ba2 Merge "Disable the AssetAtlas when running under valgrind Bug #9191438" 2013-05-29 23:02:19 +00:00
Romain Guy
80b12fcaae Disable the AssetAtlas when running under valgrind
Bug #9191438

When running under valgrind, the ppid will be different from the ppid
of the system server (which always gets forked from zygote.)

Change-Id: I42cbf99fd0084aeab76c30de9beb7c49ed1fc7d8
2013-05-29 16:01:36 -07:00
John Spurlock
c00930f4fe am 50ef7ab7: Docfix: remove confusing "disabled" link label.
* commit '50ef7ab70ad02deb9ad3694fb894741d6007564a':
  Docfix: remove confusing "disabled" link label.
2013-05-29 15:18:51 -07:00
John Spurlock
50ef7ab70a Docfix: remove confusing "disabled" link label.
Change-Id: I1acb9c8c20b6cda0e6cfb2fc1e450f37e7cd4eeb
2013-05-29 17:43:16 -04:00
John Spurlock
0ffefdf9fc Docfix: remove confusing "disabled" link label.
Change-Id: I96ebc44fe69de60e187f200b5e9d0b5adc478c17
2013-05-29 17:34:53 -04:00
Jeff Brown
19c618dbce am c8a77735: am dea6e86d: am 3422ceb6: Merge "Bug fix for building the hover target list"
* commit 'c8a777356267803be3e235b2fdaf807166fb46eb':
  Bug fix for building the hover target list
2013-05-28 15:52:22 -07:00
Jeff Brown
c8a7773562 am dea6e86d: am 3422ceb6: Merge "Bug fix for building the hover target list"
* commit 'dea6e86dce716b67fe92c9b281fe9e79256f3b78':
  Bug fix for building the hover target list
2013-05-28 15:49:13 -07:00
Jeff Brown
dea6e86dce am 3422ceb6: Merge "Bug fix for building the hover target list"
* commit '3422ceb6ba453c28ac39dfce34534e0346394a3a':
  Bug fix for building the hover target list
2013-05-28 15:46:00 -07:00
Jeff Brown
3422ceb6ba Merge "Bug fix for building the hover target list" 2013-05-28 20:04:23 +00:00
John Spurlock
be7a7e546f am ee352cca: Merge "Fix typo in View.java javadocs" into jb-mr2-dev
* commit 'ee352cca1f3beb577dfdf1c18a08242e4f94d01b':
  Fix typo in View.java javadocs
2013-05-28 09:36:19 -07:00
John Spurlock
0efd4f0215 Merge "Fix typo in View.java javadocs" 2013-05-28 15:45:18 +00:00
John Spurlock
44b1edd948 Fix typo in View.java javadocs
Change-Id: I85b9b2bd30d1f9d38954c31f24a352930a230ced
2013-05-28 11:40:58 -04:00
John Spurlock
9643d40395 Fix typo in View.java javadocs
Change-Id: I6da88e18fe32c4763c916990f6aa17dda21f5c8f
2013-05-28 09:44:50 -04:00
Dianne Hackborn
2e39f5c5cb Merge "New ArrayMap class." 2013-05-24 23:37:16 +00:00
Dianne Hackborn
f4bf0ae2a7 New ArrayMap class.
This is a new kind of key/value mapping that stores its data
as an array, so it doesn't need to create an extra Entry object
for every mapping placed in to it.  It is also optimized to reduce
memory overhead in other ways, by keeping the base object small,
being fairly aggressive about keeping the array data structures
small, etc.

There are some unit and performance tests dropped in to some
random places; they will need to be put somewhere else once I
decided what we are going to do with this for the next release
(for example if we make it public the unit tests should go in
to CTS).

Switch IntentResolver to using ArrayMap instead of HashMap.

Also get rid of a bunch of duplicate implementations of binarySearch,
and add an optimization to the various sparse arrays where you can
supply an explicit 0 capacity to prevent it from doing an initial
array allocation; use this new optimization in a few places where it
makes sense.

Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
2013-05-24 16:36:14 -07:00
Romain Guy
6080940411 Merge "Add PerfHUD ES profiling capabilities" 2013-05-23 19:50:58 +00:00
Romain Guy
e9bc11f712 Add PerfHUD ES profiling capabilities
The eglGetSystemTimeNV extension can be used to enable profiling
in PerfHUD ES. When the delta of two calls to eglGetSystemTimeNV
equals 0, we now cancels display lists updates. This allows the
tool to redraw the same frame several times in a row to run its
analysis.

For better results profiling should only be attempted after
setting viewroot.profile_rendering to true using adb shell
setprop.

Change-Id: I02e3c237418004cff8d6cb0b9a37126efae44c90
2013-05-23 12:50:13 -07:00
Romain Guy
0c63d7c239 am 469cc57c: am 2f35d244: Merge "Avoid extraneous EGL surface allocations Bug #8667873" into jb-mr2-dev
* commit '469cc57ca77687420246dd679e94eb242fcec41d':
  Avoid extraneous EGL surface allocations Bug #8667873
2013-05-21 19:12:50 -07:00
Romain Guy
469cc57ca7 am 2f35d244: Merge "Avoid extraneous EGL surface allocations Bug #8667873" into jb-mr2-dev
* commit '2f35d2441e59b996a56653881fdc2f52d4eeb644':
  Avoid extraneous EGL surface allocations Bug #8667873
2013-05-21 19:11:16 -07:00
Romain Guy
2f35d2441e Merge "Avoid extraneous EGL surface allocations Bug #8667873" into jb-mr2-dev 2013-05-22 02:08:24 +00:00
Romain Guy
370ab062a0 Avoid extraneous EGL surface allocations
Bug #8667873

windowShouldResize means we need to layout the window, it doesn't mean
the dimensions of the surface have changed. We should only check the
width and the height. With this fix we can avoid a surface allocation
every time the window shade is opened or closed.

Change-Id: I8afe97b820a865723f2aab7a5aa4ddc8eaaec6e1
2013-05-21 12:15:07 -07:00
Romain Guy
49f2e4098d Merge "Destroy display lists when running complete memory trims Bug #8833153" 2013-05-21 18:25:14 +00:00
Romain Guy
779321fde1 Destroy display lists when running complete memory trims
Bug #8833153

Display lists ops might now keep references to GL resources so they
must be destroyed when the EGL context goes away.

Change-Id: I0feb18f5539b345234a58dafa6f0775d7d7460dc
2013-05-20 16:23:34 -07:00
Svetoslav Ganov
f1cfdcee27 am 5315953b: am 78a4630e: Merge "Taking into account data change for AbsListView when prefetching node infos." into jb-mr2-dev
* commit '5315953b86ee7ca29756504535e124b053286623':
  Taking into account data change for AbsListView when prefetching node infos.
2013-05-20 15:46:18 -07:00