Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4718479d authored by Steve Kondik's avatar Steve Kondik Committed by Steve Kondik
Browse files

perf: Remove scroll / fling boosting

 * This is being done by SystemGesturesPointerEventListener now.
 * PowerHAL will need an update

Change-Id: I6b8e8181b5858fa96f520e656e67553cdbb9ce22
parent 7447e103
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package android.widget;

import android.content.Context;
import android.hardware.SensorManager;
import android.os.PowerManager;
import android.util.Log;
import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
@@ -600,8 +599,6 @@ public class OverScroller {
        private static final int CUBIC = 1;
        private static final int BALLISTIC = 2;

        private final PowerManager mPm;

        static {
            float x_min = 0.0f;
            float y_min = 0.0f;
@@ -646,7 +643,6 @@ public class OverScroller {
                    * 39.37f // inch/meter
                    * ppi
                    * 0.84f; // look and feel tuning
            mPm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
        }

        void updateScroll(float q) {
@@ -764,7 +760,6 @@ public class OverScroller {
            if (velocity != 0) {
                mDuration = mSplineDuration = getSplineFlingDuration(velocity);
                totalDistance = getSplineFlingDistance(velocity);
                mPm.cpuBoost(mDuration * 1000);
            }

            mSplineDistance = (int) (totalDistance * Math.signum(velocity));
+0 −7
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.widget;
import android.content.Context;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.PowerManager;
import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@@ -109,8 +108,6 @@ public class Scroller {
    private float mDeceleration;
    private final float mPpi;

    private final PowerManager mPm;

    // A context-specific coefficient adjusted to physical values.
    private float mPhysicalCoeff;

@@ -181,8 +178,6 @@ public class Scroller {
        mFlywheel = flywheel;

        mPhysicalCoeff = computeDeceleration(0.84f); // look and feel tuning

        mPm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
    }

    /**
@@ -400,8 +395,6 @@ public class Scroller {
        mDeltaX = dx;
        mDeltaY = dy;
        mDurationReciprocal = 1.0f / (float) mDuration;

        mPm.cpuBoost(duration * 1000);
    }

    /**
+0 −8
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@ import com.android.systemui.statusbar.FlingAnimationUtils;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.policy.HeadsUpManager;

import cyanogenmod.power.PerformanceManager;

import java.io.FileDescriptor;
import java.io.PrintWriter;

@@ -90,8 +88,6 @@ public abstract class PanelView extends FrameLayout {
    private VelocityTrackerInterface mVelocityTracker;
    private FlingAnimationUtils mFlingAnimationUtils;

    private final PerformanceManager mPerf;

    private boolean mUpdateExpandOnLayout;
    private View.OnLayoutChangeListener mLayoutChangeListener = new OnLayoutChangeListener() {
        @Override
@@ -222,8 +218,6 @@ public abstract class PanelView extends FrameLayout {
        mLinearOutSlowInInterpolator =
                AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in);
        mBounceInterpolator = new BounceInterpolator();

        mPerf = PerformanceManager.getInstance(context);
    }

    protected void loadDimens() {
@@ -695,8 +689,6 @@ public abstract class PanelView extends FrameLayout {
            }
        }

        mPerf.cpuBoost((int)animator.getDuration() * 1000);

        animator.addListener(new AnimatorListenerAdapter() {
            private boolean mCancelled;

+0 −8
Original line number Diff line number Diff line
@@ -211,8 +211,6 @@ public class NotificationStackScrollLayout extends ViewGroup
    private boolean mDisallowScrollingInThisMotion;
    private long mGoToFullShadeDelay;

    private final PerformanceManager mPerf;

    private ViewTreeObserver.OnPreDrawListener mChildrenUpdater
            = new ViewTreeObserver.OnPreDrawListener() {
        @Override
@@ -259,8 +257,6 @@ public class NotificationStackScrollLayout extends ViewGroup
        mExpandHelper.setEventSource(this);
        mExpandHelper.setScrollAdapter(this);

        mPerf = PerformanceManager.getInstance(context);

        mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, getContext());
        mSwipeHelper.setLongPressListener(mLongPressListener);
        initView(context);
@@ -847,10 +843,6 @@ public class NotificationStackScrollLayout extends ViewGroup
            horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev);
        }

        if (expandWantsIt && mIsBeingDragged) {
            mPerf.cpuBoost(200 * 1000);
        }

        return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || super.onTouchEvent(ev);
    }