summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget
diff options
context:
space:
mode:
authorVarun Garg <gargv@codeaurora.org>2015-08-20 11:35:48 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-06 21:55:16 -0700
commita313bfae1213dcf8e0845e90f260aada5026685e (patch)
tree7e6d8ea276d2880c0b2ccb98ac0740f15f4d06fb /core/java/android/widget
parent09ecabc3ea7a13d140a0c050afdafc6e9e2884a3 (diff)
downloadframeworks_base-a313bfae1213dcf8e0845e90f260aada5026685e.zip
frameworks_base-a313bfae1213dcf8e0845e90f260aada5026685e.tar.gz
frameworks_base-a313bfae1213dcf8e0845e90f260aada5026685e.tar.bz2
BoostFramework: Adding config for disable packing params & scroll fix
Adding config variable for disable packing, this will provide the flexibility to enable and disable packing on different targets. Fixing bug in launch boost while calling back to back perflock acquire using same Boostframework object. Fixed bug in scroll duration during scroll perflocks. Change-Id: Id42a6e350dfd852a43ec35ec3afef9b298707057
Diffstat (limited to 'core/java/android/widget')
-rw-r--r--core/java/android/widget/OverScroller.java16
-rw-r--r--core/java/android/widget/Scroller.java9
2 files changed, 18 insertions, 7 deletions
diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java
index 4cb1514..778b2dd 100644
--- a/core/java/android/widget/OverScroller.java
+++ b/core/java/android/widget/OverScroller.java
@@ -609,6 +609,7 @@ public class OverScroller {
private boolean mIsPerfLockAcquired = false;
private boolean mIsPerfBoostEnabled = false;
private int fBoostTimeOut = 0;
+ private int flingBoostTimeOut = 0;
private int fBoostParamVal[];
static {
@@ -664,6 +665,10 @@ public class OverScroller {
fBoostParamVal = context.getResources().getIntArray(
com.android.internal.R.array.flingboost_param_value);
}
+
+ if (mPerf == null && mIsPerfBoostEnabled) {
+ mPerf = new BoostFramework();
+ }
}
void updateScroll(float q) {
@@ -786,16 +791,17 @@ public class OverScroller {
if (velocity != 0) {
mDuration = mSplineDuration = getSplineFlingDuration(velocity);
totalDistance = getSplineFlingDistance(velocity);
- if (mPerf == null && mIsPerfBoostEnabled) {
- mPerf = new BoostFramework();
- }
if (mPerf != null) {
mIsPerfLockAcquired = true;
if (0 == fBoostTimeOut) {
- fBoostTimeOut = mDuration;
+ //config value is not defined
+ flingBoostTimeOut = mDuration;
+ } else {
+ //config value is present
+ flingBoostTimeOut = fBoostTimeOut;
}
- mPerf.perfLockAcquire(fBoostTimeOut, fBoostParamVal);
+ mPerf.perfLockAcquire(flingBoostTimeOut, fBoostParamVal);
}
}
diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java
index 96e6b9d..d0ba9e6 100644
--- a/core/java/android/widget/Scroller.java
+++ b/core/java/android/widget/Scroller.java
@@ -117,6 +117,7 @@ public class Scroller {
private BoostFramework mPerf = null;
boolean bIsPerfBoostEnabled = false;
private int sBoostTimeOut = 0;
+ private int scrollBoostTimeOut = 0;
private int sBoostParamVal[];
// A context-specific coefficient adjusted to physical values.
@@ -422,9 +423,13 @@ public class Scroller {
if ((mPerf != null) && (duration != 0)) {
if (0 == sBoostTimeOut) {
- sBoostTimeOut = mDuration;
+ //config value is not defined
+ scrollBoostTimeOut = mDuration;
+ } else {
+ //config value is present
+ scrollBoostTimeOut = sBoostTimeOut;
}
- mPerf.perfLockAcquire(sBoostTimeOut, sBoostParamVal);
+ mPerf.perfLockAcquire(scrollBoostTimeOut, sBoostParamVal);
}
}