this is a hot fix for the regression caused by ag/20171590, may need more investigation to properly handle it.
Bug: 255723033
Test: Failing Tests
Change-Id: I129f69d2979405b33c8b46430c7b1ec8559105aa
This allows core libraries (such as predictive back progress animation)
to use spring animation.
Files in androidx/dynamicanimation/animation that are not copied over:
FlingAnimation.java - Unused atm
AnimationHandler.java - Replaced with the framework AnimationHandler
FloatPropertyCompat.java - Replaced with FloatProperty
FrameCallbackScheduler.java - Unused in framework AnimationHandler
Test: m -j
Bug: 238475284
Change-Id: Ifdf847da0aa2a6cf57e18f9ac7c91bb0fe3b12c2
This change sets the default behavior of animator pausing by checking if
a system property is set and useing that value if present else it
defaults to true. This should allow the use of build properties to be
able to toggle the behavior.
Bug: 233391022
Test: Manual, adding logging to verify the values being set by the call
to the sysprop library.
Ignore-AOSP-First: Testing internal change, will cherry pick to AOSP.
Change-Id: Ib1b34585c564bf4f310441c6856412a798022900
LOCAL_LOGV should be set to false
Bug: 232914479
Bug: 233391022
Test: Manually tested to ensure logging is not happening
Change-Id: Ie14cf3c0bacb50dd1e7422dc378d5195e4d9bec5
Merged-In: Ie14cf3c0bacb50dd1e7422dc378d5195e4d9bec5
This change adds a static method which can be called to disable the
default behavior of pausing infinite animators when an app's windows
are all in the background. This could potentially be used for
global behavior of a system property to disable this behavior system
wide.
Bug: 232937493
Bug: 233391022
Test: Added new cts test to AnimatorLeakTest to verify behavior
Change-Id: Idf4957e3968253228096671fde89f820311883e3
Merged-In: Idf4957e3968253228096671fde89f820311883e3
Because animators are not tied to the lifecycle of any UI
elements, it is possible for an app to go into the background
and for the animators to continue running. Ideally, the app would
track the lifecycle of the activity/etc and pause or disable the
animators, but it is common for this to not happen, causing the
animators to continue spinning when the app does not need them.
The animators are not causing as much work as for a foreground
activity (since they do not cause any re-rendering), but they cause
work nonetheless by keeping Choreographer awake to continue pulsing
frames.
The ideal fix would be to introduce new API for animators that
tied them to lifecycle concepts (View, Activity, etc). But that kind
of fix would only be available for future versions of the platform,
and does not address existing app code. A workaround for the current
situation is to address the most egregious problems; infinite animators
running on backgrounded apps.
The fix here is exactly that: when an app's visible surface (either an
activity or, for Wallpapers, a WallpaperService) is backgrounded,
a request is sent to pause animators for that surface. When that surface
comes to the foreground, a request is sent to resume those animators.
Since all animators are handled on the same thread for the same process,
in AnimationHandler, we should only ever pause animators when *all*
surfaces for a process are not visible (and resume them when *any*
surface becomes visible). Also, to mitigate any issues with thrashing
animator state for apps which become only transiently backgrounded,
we delay pausing for some time.
Bug: 228598053
Bug: 233391022
Test: new AnimatorLeak CTS test, plus manual testing for activities
and wallpapers
Change-Id: I8b9f841cc80babb972244c724968a5c085a06b69
Merged-In: I8b9f841cc80babb972244c724968a5c085a06b69
Developers and accessibility services can remove animations by
changing the duration scale to zero. Physics-based animation
libraries like AndroidX's dynamic animations aren't duration-based,
but they need to know the duration scale to remove animations.
Expose the scale through ValueAnimator to avoid requests for
Context which may not be fulfilled by the developer.
Unhide test API getDurationScale and handle callbacks on the main
thread.
Test: atest ValueAnimatorTest
Bug: 221303983
Change-Id: I3134e0bf007df046a9a2aa0f9d866c27c7989e68
I inferred nullability annotations in Jetpack based on the guaranteed
behavior of the platform, so now I'm propagating those inferences back
to the platform as annotations.
Test: nullability presubmit checks
Fixes: 206801689
Change-Id: If969bbe8a2263a3dd6cc1497a01354648a8795e9
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.
Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas. Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:
-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage
Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance. With this extensive
effort, we've now improved our coverage as follows:
-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage
This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.
Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
Follow up aosp/1382536 by correcting the term used while renaming
a few variables and methods from AnimatorSet.
BUG=162536543
Change-Id: I9b914663790664b3f0de7774864207e90ce3f7a1
There is no need to introduce jank risk and run the inset
animations on the main thread if the app doesn't listen to
animation events. In that case, move the animations onto a
separate thread.
Bug: 118118435
Test: Inspect systrace
Change-Id: Ib6e4b4ce8e9dd8e27761ced6eb8d7700b6236a32
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
Merged-In: I8789f8499d4dca08580672e9e45ed9a7026dd686
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
An alternative method, areAnimatorsEnabled() can be used to determine
if animations are turned off or not. Otherwise, reflection access of the
value are not permitted since it is an implementation detail that can
break battery saver mode or user's choice of disabling system-wide
animations.
Bug: 123767751
Test: n/a
Change-Id: I2146613a5921e229f7db641c34732bc1044766fc
This is used by androidx.transitions only for the API levels less than 18, so it is safe to restrict it after P.
Bug: 123769438
Test: none
Change-Id: Iaff4d5741c7cf952cbff61c3b580ef1ec0618009
This covers directories through /app.
removed unused import in KeyguardManager.java
Test: make ds-docs
Bug: 117494359
Change-Id: Ie2536676ae8d3ab9349aa43dc3e3248b618dd143
Exempt-From-Owner-Approval: Docs-only change
For packages:
android.animation
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I6702ce1fb26452971e5eee8da15d5816dd75bb12
Merged-In: If0667154031b254fd632e1332fb65e9b08955755
For packages:
android.animation
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: If0667154031b254fd632e1332fb65e9b08955755
This is needed as window animations are being ported over to use
ValueAnimator, and thus ValueAnimator need to ability to support
custom duration scales per object.
Test: ValueAnimatorTests
Bug: 64674361
Change-Id: Iea8d673b66e52866929174bbf6ca4a7ae882807b
- Move the bounds animation onto the animation thread
- Remove existing code referencing the old sf-vsync choreographer
- Add ability for ValueAnimator subclasses to reference a different
AnimationHandler, which uses a different FrameCallbackProvider with the
sf-vsync choreographer in the animations that require it
- Ensure that PiP touch events are batched and sent aligned with the
sf-vsync
- Move GC onto its own thread to not block other BackgroundThread calls
Bug: 36371375
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: bit FrameworksServicesTests:com.android.server.wm.BoundsAnimationControllerTests
Test: go/wm-smoke
Change-Id: I6a41b35a4e4d4d6dbea82c2673452825fe3ffa58
AnimationHandler.doAnimationFrame() iterates on a list that may be changed
during the course of the lopp, especially when Battery Saver is enabled, or
animators have zero duration, coupled with user code launching new animators
when old ones end.
The fix is to iterate through the old size of the list, and avoid processing
new animators in the current frame.
Bug: 37376806 Keyboard doesn't come up when battery saver is turned on on Android O
Test: manual
Change-Id: I40ca1d849e6f337779c23edbab22d80760c22f9b
A cache was introduced in I677bc289f2ba430466f2d90ebc14368cb7b75118 to
optimise calls to createDependencyGraph(), but the update was removed in
If1dc6e8dbc93a4bf5ade8c5b0dcf43d3ee6ba7b5. This patch reintroduces the
update when calculating child animation start/end times to re-enable the
optimisation.
Test: cts-tradefed run cts-dev --module CtsAnimationTestCases
Change-Id: Ie9dad4049c07a151889b57809bf844ab854ff482