diff options
| author | 2018-08-02 19:30:08 +0000 | |
|---|---|---|
| committer | 2018-08-02 19:30:08 +0000 | |
| commit | 9e1c3b7852d70d1bcd63c15f35191c7867926fe9 (patch) | |
| tree | 44ed33ba5bcfb14febae449a944738cd7a3db456 | |
| parent | 410c9d7396c099d9da0de2372abd8c5ae1330a83 (diff) | |
| parent | 8cdf45bb17d7137aa8a355959b73eb9d032848f9 (diff) | |
Merge "Remove dead code"
| -rw-r--r-- | config/hiddenapi-light-greylist.txt | 1 | ||||
| -rw-r--r-- | core/java/android/view/ViewPropertyAnimator.java | 11 | ||||
| -rw-r--r-- | core/java/android/view/ViewPropertyAnimatorRT.java | 138 |
3 files changed, 0 insertions, 150 deletions
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt index 0b94c27db533..3fdf1b46c3a7 100644 --- a/config/hiddenapi-light-greylist.txt +++ b/config/hiddenapi-light-greylist.txt @@ -6049,7 +6049,6 @@ Landroid/view/ViewHierarchyEncoder;->addProperty(Ljava/lang/String;Ljava/lang/St Landroid/view/ViewHierarchyEncoder;->addProperty(Ljava/lang/String;Z)V Landroid/view/ViewOverlay;->getOverlayView()Landroid/view/ViewGroup; Landroid/view/ViewOverlay;->isEmpty()Z -Landroid/view/ViewPropertyAnimator;->mRTBackend:Landroid/view/ViewPropertyAnimatorRT; Landroid/view/ViewRootImpl$CalledFromWrongThreadException;-><init>(Ljava/lang/String;)V Landroid/view/ViewRootImpl;->addConfigCallback(Landroid/view/ViewRootImpl$ConfigChangedCallback;)V Landroid/view/ViewRootImpl;->cancelInvalidate(Landroid/view/View;)V diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index 6c84b63bb241..e3e2069422fc 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -109,11 +109,6 @@ public class ViewPropertyAnimator { private ValueAnimator mTempValueAnimator; /** - * A RenderThread-driven backend that may intercept startAnimation - */ - private ViewPropertyAnimatorRT mRTBackend; - - /** * This listener is the mechanism by which the underlying Animator causes changes to the * properties currently being animated, as well as the cleanup after an animation is * complete. @@ -434,9 +429,6 @@ public class ViewPropertyAnimator { mPendingOnStartAction = null; mPendingOnEndAction = null; mView.removeCallbacks(mAnimationStarter); - if (mRTBackend != null) { - mRTBackend.cancelAll(); - } } /** @@ -859,9 +851,6 @@ public class ViewPropertyAnimator { * value accordingly. */ private void startAnimation() { - if (mRTBackend != null && mRTBackend.startAnimation(this)) { - return; - } mView.setHasTransientState(true); ValueAnimator animator = ValueAnimator.ofFloat(1.0f); ArrayList<NameValuesHolder> nameValueList = diff --git a/core/java/android/view/ViewPropertyAnimatorRT.java b/core/java/android/view/ViewPropertyAnimatorRT.java deleted file mode 100644 index de96887db9fb..000000000000 --- a/core/java/android/view/ViewPropertyAnimatorRT.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.view; - -import android.animation.TimeInterpolator; -import android.view.ViewPropertyAnimator.NameValuesHolder; -import android.view.animation.Interpolator; -import android.view.animation.LinearInterpolator; - -import com.android.internal.view.animation.FallbackLUTInterpolator; - -import java.util.ArrayList; - - -/** - * This is a RenderThread driven backend for ViewPropertyAnimator. - */ -class ViewPropertyAnimatorRT { - - private static final Interpolator sLinearInterpolator = new LinearInterpolator(); - - private final View mView; - - private RenderNodeAnimator mAnimators[] = new RenderNodeAnimator[RenderNodeAnimator.LAST_VALUE + 1]; - - ViewPropertyAnimatorRT(View view) { - mView = view; - } - - /** - * @return true if ViewPropertyAnimatorRT handled the animation, - * false if ViewPropertyAnimator needs to handle it - */ - public boolean startAnimation(ViewPropertyAnimator parent) { - cancelAnimators(parent.mPendingAnimations); - if (!canHandleAnimator(parent)) { - return false; - } - doStartAnimation(parent); - return true; - } - - public void cancelAll() { - for (int i = 0; i < mAnimators.length; i++) { - if (mAnimators[i] != null) { - mAnimators[i].cancel(); - mAnimators[i] = null; - } - } - } - - private void doStartAnimation(ViewPropertyAnimator parent) { - int size = parent.mPendingAnimations.size(); - - long startDelay = parent.getStartDelay(); - long duration = parent.getDuration(); - TimeInterpolator interpolator = parent.getInterpolator(); - if (interpolator == null) { - // Documented to be LinearInterpolator in ValueAnimator.setInterpolator - interpolator = sLinearInterpolator; - } - if (!RenderNodeAnimator.isNativeInterpolator(interpolator)) { - interpolator = new FallbackLUTInterpolator(interpolator, duration); - } - for (int i = 0; i < size; i++) { - NameValuesHolder holder = parent.mPendingAnimations.get(i); - int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant); - - final float finalValue = holder.mFromValue + holder.mDeltaValue; - RenderNodeAnimator animator = new RenderNodeAnimator(property, finalValue); - animator.setStartDelay(startDelay); - animator.setDuration(duration); - animator.setInterpolator(interpolator); - animator.setTarget(mView); - animator.start(); - - mAnimators[property] = animator; - } - - parent.mPendingAnimations.clear(); - } - - private boolean canHandleAnimator(ViewPropertyAnimator parent) { - // TODO: Can we eliminate this entirely? - // If RenderNode.animatorProperties() can be toggled to point at staging - // instead then RNA can be used as the animators for software as well - // as the updateListener fallback paths. If this can be toggled - // at the top level somehow, combined with requiresUiRedraw, we could - // ensure that RT does not self-animate, allowing for safe driving of - // the animators from the UI thread using the same mechanisms - // ViewPropertyAnimator does, just with everything sitting on a single - // animator subsystem instead of multiple. - - if (parent.getUpdateListener() != null) { - return false; - } - if (parent.getListener() != null) { - // TODO support - return false; - } - if (!mView.isHardwareAccelerated()) { - // TODO handle this maybe? - return false; - } - if (parent.hasActions()) { - return false; - } - // Here goes nothing... - return true; - } - - private void cancelAnimators(ArrayList<NameValuesHolder> mPendingAnimations) { - int size = mPendingAnimations.size(); - for (int i = 0; i < size; i++) { - NameValuesHolder holder = mPendingAnimations.get(i); - int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant); - if (mAnimators[property] != null) { - mAnimators[property].cancel(); - mAnimators[property] = null; - } - } - } - -} |