Loading core/java/android/widget/Scroller.java 100644 → 100755 +20 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.util.FloatMath; import android.view.ViewConfiguration; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import org.codeaurora.Performance; /** * <p>This class encapsulates scrolling. You can use scrollers ({@link Scroller} Loading Loading @@ -108,6 +108,13 @@ public class Scroller { private float mDeceleration; private final float mPpi; /* * Perf boost related variables * Enabled/Disabled using config_enableCpuBoostForScroller * true value turns it on, by default will be turned off */ private Performance mPerf = null; // A context-specific coefficient adjusted to physical values. private float mPhysicalCoeff; Loading Loading @@ -177,6 +184,7 @@ public class Scroller { * not to support progressive "flywheel" behavior in flinging. */ public Scroller(Context context, Interpolator interpolator, boolean flywheel) { boolean bIsPerfBoostEnabled = false; mFinished = true; mInterpolator = interpolator; mPpi = context.getResources().getDisplayMetrics().density * 160.0f; Loading @@ -184,6 +192,13 @@ public class Scroller { mFlywheel = flywheel; mPhysicalCoeff = computeDeceleration(0.84f); // look and feel tuning bIsPerfBoostEnabled = context.getResources().getBoolean( com.android.internal.R.bool.config_enableCpuBoostForScroller); if (mPerf == null && bIsPerfBoostEnabled) { mPerf = new Performance(); } } /** Loading Loading @@ -407,6 +422,10 @@ public class Scroller { mDeltaX = dx; mDeltaY = dy; mDurationReciprocal = 1.0f / (float) mDuration; if ((mPerf != null) && (duration != 0)) { mPerf.perfLockAcquire(mDuration, mPerf.CPUS_ON_2, 0x20B, 0x30B,0x1C00); } } /** Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1330,6 +1330,9 @@ <!-- Whether cpu boost is enabled for overscroller fling. --> <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> <!-- Whether cpu boost is enabled for horizontal scroll. --> <bool name="config_enableCpuBoostForScroller">false</bool> <!-- User display names for app ops codes --> <string-array name="app_ops_labels"> <item>Trying to access location</item> Loading core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1809,6 +1809,9 @@ <java-symbol type="bool" name="use_motion_accel" /> <java-symbol type="bool" name="config_setup_mms_data" /> <!-- cpu boost for horizontal scroll --> <java-symbol type="bool" name="config_enableCpuBoostForScroller" /> <!-- Configuration to play sms ringtone during MO/MT call --> <java-symbol type="bool" name="config_sms_ringtone_incall" /> <java-symbol type="string" name="config_partial_segment_expire_age" /> Loading Loading
core/java/android/widget/Scroller.java 100644 → 100755 +20 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.util.FloatMath; import android.view.ViewConfiguration; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import org.codeaurora.Performance; /** * <p>This class encapsulates scrolling. You can use scrollers ({@link Scroller} Loading Loading @@ -108,6 +108,13 @@ public class Scroller { private float mDeceleration; private final float mPpi; /* * Perf boost related variables * Enabled/Disabled using config_enableCpuBoostForScroller * true value turns it on, by default will be turned off */ private Performance mPerf = null; // A context-specific coefficient adjusted to physical values. private float mPhysicalCoeff; Loading Loading @@ -177,6 +184,7 @@ public class Scroller { * not to support progressive "flywheel" behavior in flinging. */ public Scroller(Context context, Interpolator interpolator, boolean flywheel) { boolean bIsPerfBoostEnabled = false; mFinished = true; mInterpolator = interpolator; mPpi = context.getResources().getDisplayMetrics().density * 160.0f; Loading @@ -184,6 +192,13 @@ public class Scroller { mFlywheel = flywheel; mPhysicalCoeff = computeDeceleration(0.84f); // look and feel tuning bIsPerfBoostEnabled = context.getResources().getBoolean( com.android.internal.R.bool.config_enableCpuBoostForScroller); if (mPerf == null && bIsPerfBoostEnabled) { mPerf = new Performance(); } } /** Loading Loading @@ -407,6 +422,10 @@ public class Scroller { mDeltaX = dx; mDeltaY = dy; mDurationReciprocal = 1.0f / (float) mDuration; if ((mPerf != null) && (duration != 0)) { mPerf.perfLockAcquire(mDuration, mPerf.CPUS_ON_2, 0x20B, 0x30B,0x1C00); } } /** Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1330,6 +1330,9 @@ <!-- Whether cpu boost is enabled for overscroller fling. --> <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> <!-- Whether cpu boost is enabled for horizontal scroll. --> <bool name="config_enableCpuBoostForScroller">false</bool> <!-- User display names for app ops codes --> <string-array name="app_ops_labels"> <item>Trying to access location</item> Loading
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1809,6 +1809,9 @@ <java-symbol type="bool" name="use_motion_accel" /> <java-symbol type="bool" name="config_setup_mms_data" /> <!-- cpu boost for horizontal scroll --> <java-symbol type="bool" name="config_enableCpuBoostForScroller" /> <!-- Configuration to play sms ringtone during MO/MT call --> <java-symbol type="bool" name="config_sms_ringtone_incall" /> <java-symbol type="string" name="config_partial_segment_expire_age" /> Loading