summaryrefslogtreecommitdiff
path: root/core/java/android/animation
Commit message (Collapse)AuthorAgeFilesLines
* Revert "DO NOT MERGE Revert "Fix activity leak bug""Chet Haase2022-12-141-35/+40
| | | | | | | | | | | | | DO NOT MERGE Revert submission 20674641-revert-20610032-cherrypick-AnimatorLeak fixes-4lh72bu61o-BQALTBEXMY Reason for revert: Temporary revert deemed unnecessary - this revert will re-submit the original changes. Reverted changes: /q/submissionid:20674641-revert-20610032-cherrypick-AnimatorLeak+fixes-4lh72bu61o-BQALTBEXMY Bug: 261518932 Bug: 258616235 Change-Id: I539c771a6897a9d635613a17138343a7a9feddb9 Test: Presubmit tests. Also, forrest runs with these changes showed no regression
* DO NOT MERGE Revert "Fix activity leak bug"Chet Haase2022-12-131-40/+35
| | | | | | | | | | | | | | | | | Revert "Fix test cleanup issue in AnimatorLeakTest" Revert submission 20610032-cherrypick-AnimatorLeak fixes-4lh72bu61o Reason for revert: Startup regression found in post-submit Reverted Changes: Icdd6023f6:Fix activity leak bug Ieac851550:Fix test cleanup issue in AnimatorLeakTest This is a tentative revert to see whether it addresses the regression while I continue chasing the underlying problem Bug: 261518932 Test: presubmit Change-Id: Ica9a75b94c8c260cceb6719f8f6b95ba67d4e356
* Fix activity leak bugChet Haase2022-12-011-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | This is a cherry-pick from main branch: ID: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497 It is possible for ViewRootImpl.doDie() to be called prior to one of the other calls which tells the system that the window is going to the foreground. This race condition can cause an activity leak since the ViewRootImpl in question is stored in a collection of "requestors" which determine when to pause/resume animators for background/foreground apps. The fix is two-fold: - Only cause an item to be added to the "requestor" list in AnimationHandler when doDie() has not yet been called (marked by the mReoved" flag) - Store the requestor objects as WeakReferences, rather than the objects themselves. Thus if the requestor list is the only referent to the object, it can be collected anyway, removing the leak potential. Bug: 258616235, 258616235 Test: AnimatorLeakTest passes Change-Id: Icdd6023f6530e3cc4b474f33dc34f6eb7400788e Merged-in: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497
* Fix SpringAnimation class cast exception.Yein Jo2022-11-011-6/+8
| | | | | | | | 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
* Add AndroidX SpringAnimation library to core.Shan Huang2022-10-171-1/+2
| | | | | | | | | | | | | | | | 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
* Use System Property to Control Animator PausingSteven Terrell2022-06-062-1/+32
| | | | | | | | | | | | | | | 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
* Disable debug logging in AnimationHandlerChet Haase2022-05-231-1/+1
| | | | | | | | | | 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
* Allow system to disable behavior of pausing animators for bg appsChet Haase2022-05-232-5/+42
| | | | | | | | | | | | | | 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
* Pause animators when app is not visibleChet Haase2022-05-232-1/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add @FloatRange to DurationScaleChangeListener.onChangedSally2022-03-141-4/+4
| | | | | | Test: builds Bug: 224543281 Change-Id: Idd10b488dc3baea0e1644e5b2a165866274100d6
* Add API to read and listen to duration scale changes for animationsSally2022-03-101-4/+97
| | | | | | | | | | | | | | | | | 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
* Nullability annotations for animation and graphicsAlan Viverette2022-02-032-9/+11
| | | | | | | | | | 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
* Add option to trace animation fractionJorim Jaggi2021-12-131-0/+7
| | | | | | | | In order to investigate animation value skipping directly from traces when needed. Bug: 210125581 Change-Id: I6febb148de12bb586344d29e4713ac7e523714ea
* Improve OWNERS coverage across frameworks/base/.Jeff Sharkey2020-12-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-1/+2
| | | | | | | | | | | 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
* Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)Xin Li2020-08-311-1/+16
|\ | | | | | | | | | | Bug: 166295507 Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27 Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
| * Use separate thread if app doesn't listen to animationsJorim Jaggi2020-03-111-1/+16
| | | | | | | | | | | | | | | | | | | | | | 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
| * Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-184-4/+4
| | | | | | | | | | | | | | | | 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
| * Add @UnsupportedAppUsage to test apis that are known to be used by apps.Artur Satayev2019-11-131-0/+2
| | | | | | | | | | | | | | | | | | go/testapi-enforcement Bug: 133832325 Test: m Change-Id: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6 Merged-In: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6
* | Change variable name fix from 'endingListener' to 'endListener'Lais Andrade2020-08-031-9/+9
| | | | | | | | | | | | | | | | | | Follow up aosp/1382536 by correcting the term used while renaming a few variables and methods from AnimatorSet. BUG=162536543 Change-Id: I9b914663790664b3f0de7774864207e90ce3f7a1
* | Update language to comply with Android's inclusive language guidanceLais Andrade2020-07-311-10/+10
| | | | | | | | | | | | | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference #inclusivefixit BUG=162536543 Change-Id: Ieda6c7d61cfe8ddba1b0d80c8b87d82a9895fa31
* | Merge "Use new UnsupportedAppUsage annotation." am: 70129fc863 am: fe3063fb71Automerger Merge Worker2020-01-094-4/+4
|\ \ | | | | | | | | | Change-Id: Iea82f97f0ba766ce3f435630175aea48ca47f12f
| * | Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-094-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Add @UnsupportedAppUsage to test apis that are known to be used by ↵Artur Satayev2019-11-131-0/+2
|\| | | |/ |/| | | | | | | | | | | apps." am: a98026f7aa am: 59318bab67 Change-Id: Ic691d764839ecf34daa8b53aa92497e013c9a2a7
| * Add @UnsupportedAppUsage to test apis that are known to be used by apps.Artur Satayev2019-11-131-0/+2
| | | | | | | | | | | | | | | | | | go/testapi-enforcement Bug: 133832325 Test: m Change-Id: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6 Merged-In: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6
* | docs: fix typosJoshua Baxter2019-11-061-1/+1
|/ | | | | | Change-Id: Ifee929d0adaaa94c5026a4b0fdf926489af639b5 test: make ds-docs bug: 37009580
* Merge "Restrict reflection access to ValueAnimator's sDurationScale"TreeHugger Robot2019-02-061-1/+8
|\
| * Restrict reflection access to ValueAnimator's sDurationScaleDaniel Santiago Rivera2019-02-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Restrict usage of LayoutTransition.cancel() methodsAndrey Kulikov2019-02-041-2/+3
|/ | | | | | | | 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
* Merge "docs: fixing errors found with lint check" into pi-dev am: 8c7d2142f6kopriva2018-10-091-3/+3
|\ | | | | | | | | | | am: 4d12f4c42b Change-Id: I96a6dab05b6d4ea40950fe2ddc0948adf1b4e48f
| * Merge "docs: fixing errors found with lint check" into pi-devkopriva2018-10-091-3/+3
| |\ | | | | | | | | | | | | | | | am: 8c7d2142f6 Change-Id: Ief137b64e798b4b5bb6be5e6d25a35e08037abe5
| | * docs: fixing errors found with lint checkkopriva2018-10-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Merge "Add @UnsupportedAppUsage annotations" am: 058b566f90Mathew Inwood2018-08-034-0/+12
| |\ \ | | |/ | |/| | | | | | | | | | am: 38a6375f99 Change-Id: I92ad1b36f7fbd1ff9b1379ccf7a561158e82029b
| | * Merge "Add @UnsupportedAppUsage annotations"Mathew Inwood2018-08-034-0/+12
| | |\ | | | | | | | | | | | | | | | | | | | | am: 058b566f90 Change-Id: I982201ecfc2f257ff5509de10a73549ebe657aff
| | | * Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-014-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-014-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Merge "Docs: fixed variables" into pi-dev am: 116158689c" into ↵Laura Davis2018-06-261-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pi-dev-plus-aosp am: bd935bf41a Change-Id: I7617577dd4fc8dc0944deb76e95142f96dade2a7
| * | | Docs: fixed variablesLaura Davis2018-06-251-2/+2
| |/ / | | | | | | | | | | | | | | | | | | Test: make ds-docs Bug: 25134282 Change-Id: Ic91dd3820a409f0f28e23575090e3fd624a0fac0
* / / Remove unnecessary value setting in AnimatorSet seekingDoris Liu2018-04-021-4/+11
|/ / | | | | | | | | | | | | | | | | Also fixed seeking in paused state BUG:68274315 BUG: 68382377 Test: ag/3835109 Change-Id: Ifa6b717a77a34f2152bd0e7ad285556986dd47ff
* / Add ability to override global duration scale on ValueAnimatorJorim Jaggi2017-11-161-3/+28
|/ | | | | | | | | | 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
* Fix end() for infinite AnimatorSetDoris Liu2017-09-261-2/+3
| | | | | | | BUG: 66880433 Test: repo steps in the bug above Change-Id: If34b7386b7ff5cd28144e99c37957abddb068e9c
* Merge "Ensure that we use SF Vsync Choreographer for the PiP transition." ↵Wale Ogunwale2017-06-131-6/+11
|\ | | | | | | | | | | | | | | into oc-dev am: e1e0db8ca9 am: 90159a2492 Change-Id: I0092411f5b8bef853b55e6ffe7bdf700876f7715
| * Ensure that we use SF Vsync Choreographer for the PiP transition.Winson Chung2017-06-121-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Merge "Merge "Better handle non-recommended use and warn against it in ↵Doris Liu2017-06-071-4/+18
|\| | | | | | | | | | | | | | | JavaDoc" into oc-dev am: 8d06d8cbf1" into oc-dev-plus-aosp am: 721ecfd21a Change-Id: Iec199dd0cfe7beace7549d3e16e888458fd0306c
| * Merge "Better handle non-recommended use and warn against it in JavaDoc" ↵Doris Liu2017-06-071-4/+18
| |\ | | | | | | | | | into oc-dev
| | * Better handle non-recommended use and warn against it in JavaDocDoris Liu2017-06-071-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | BUG: 62386748 Test: Follow repro steps in b/62358678. The issue is no longer reproducible Change-Id: Ic3cec7c4947296224edb5365d81988d4da7ee5e1
* | | Merge "Ensure start delay is properly scaled with duration scale" into ↵Doris Liu2017-06-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | oc-dev am: 9057f846ac am: 4b5d12d25a Change-Id: I80a1dc2c898a9456b651f6b1375055e6fcb59540
| * | Ensure start delay is properly scaled with duration scaleDoris Liu2017-05-311-1/+1
| |/ | | | | | | | | | | BUG: 62126024 Test: CTS test in the same target branch Change-Id: Ia396e69e053ccd90cdf37ac0b59c404c9952e497
* | Merge "Fix infinite loop problem in AnimationHandler" into oc-dev am: 163ec051d1Chet Haase2017-05-311-1/+2
|\| | | | | | | | | | | am: 3fb0e7555f Change-Id: I91064e4baf1333c25d55d06e4373c83243c3e0da
| * Fix infinite loop problem in AnimationHandlerChet Haase2017-05-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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