Users have requested the ability to sequence ViewPropertyAnimator
animations. it is not possible with AnimatorSet, which only takes objects
of type Animator (which VPA does not extend). But the AnimatorSet model
is not appropriate for VPA anyway, since it is not possible to set up
a VPA ahead of time to start later; it's just not the way that VPA is
intended to work.
Instead, there are now two new methods on VPA, onStart() and onEnd(). These
methods take a Runnable which is executed when the animation starts or ends.
These methods should allow other VPAs or other arbitrary code to execute at the
start or finish of any particular VPA animation, allowing simple sequencing
without the overhead of creating listeners and monitoring the cancelation status
of the VPA.
Additionally, this change adds a new method withLayer() which sets a hardware
layer on the VPA's target view for the duration of the animation. This
was already possible, but required writing boilerplate code to create a listener
and override the start/end methods to add and remove the layer. This utility method
makes this common use case much simpler and less error-prone.
Change-Id: I819978517e17c647ffb7028063cd0adde68ff691
These markers will be used to group the GL commands by View in the
OpenGL ES debugging tool. This will help correlate individual GL
calls to higher level components like Views.
Change-Id: I73607ba2e7224a80ac32527968261ee008f049c6
Because the NetworkInfo included in CONNECTIVITY_ACTION broadcast
extra does not reflect the state applicable to the calling UID, and
the last sticky broadcast may have stale state, transition to calling
ConnectivityManager.getActiveNetworkInfo() directly.
Change-Id: I86b316fbedd0273585ad5f1248b091bc3a3a5520
When a view is becoming VISIBLE or INVISIBLE in a container with a
LayoutTransition, animations run to fade the view in and out and also
to run 'changing' animations on the view's other siblings. This logic
also cancels any running 'changin' animations to account for new ones
running.
However, in the specific case of INVISIBLE changes, there will be no
layout changes in the container - layout has already accounted for that
view (unlike in the case of GONE views); the visibility is just a matter of
drawing the view (or not). Therefore, we're canceling 'changing' animations
that should continue running and not replacing them with any other animations,
since new animations would only be started on layout chnages which are not
forthcoming.
One artifact seen from this bug is that the navigation bar buttons sometimes
disappear when changing orientation. This is because the menu button may
toggle between VISIBLE and INVISIBLE, causing animations on the other
buttons to get canceled, which leaves those views in a completely wrong
state.
The right thing to do is to avoid canceling in-process 'changing' animations
and to skip the logic of setting up new 'changing' animations which won't fire
anyway.
There is some minor API work in here because we did not previously have the
necessary information in LayoutTransition to know whether a view was being
hidden or shown to/from the INVISIBLE state.
Issue #5911213: LayoutTransitions ending in an odd state
Change-Id: I5c60c8583c8ea08965727b4ef17b550c40a3882c
Bug 5556478
Launcher pre-populates its all apps and widget pages with their
content, which includes text. The layout calls some onMeasure methods
that trigger TextView's registerForPreDraw(), which in turns adds a
listener in the ViewTreeObserver.
However, some of these pages may never be actually displayed, leaving
the listeners in the list since onDraw() is never called.
As a result, every frame displayed by launcher is slowned down by this
array copy of 6-18 listeners.
The problem is not Launcher specific since other applications may use
a similar caching mechanism.
The solution is to unsubscribe the listener in onPreDraw.
The drawback is that several successive calls to registerForPreDraw() will
add/remove the some listener object. However, these calls are rare and are
relatively cheap since we're just adding the object in and out of an
ArrayList which should not need to change its size.
Change-Id: Ifb65655a27e302d31a2ad622d18f839aec99689e
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object. The application
creates a CancelationSignal object and passes it as an argument
to the query. The cancelation signal can then be used to cancel
the query while it is executing.
If the cancelation signal is raised before the query is executed,
then it is immediately terminated.
Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
This attempts to fix an issue where sometimes the time shown on lock
screen was really old. The code now sets the time immediately when the
screen turns on.
Change-Id: Ic4649ea342499aea82f997ba488bc2cb45987739
- also clean some destructors (was not quite compulsory because
they are related to some Singletons)
Change-Id: I3091cac7b38628cda593d72570ba7a5d7ea2a15c
Was a mix of audio_source_t, uint8_t, and int.
Related fixes:
- fix comments in MediaRecorder.java
- AudioPolicyService server side was not checking source parameter at
all, so if the client wrapper was bypassed, invalid values could be
passed into audio HAL
- JNI android_media_AudioRecord_setup was checking source for positive
values, but not negative values. This test is redundant, since already
checked at Java and now checked by AudioPolicyService also, but might
as well make it correct.
Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a