diff options
| author | Varun Garg <gargv@codeaurora.org> | 2015-08-20 11:35:48 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-06 21:55:16 -0700 |
| commit | a313bfae1213dcf8e0845e90f260aada5026685e (patch) | |
| tree | 7e6d8ea276d2880c0b2ccb98ac0740f15f4d06fb | |
| parent | 09ecabc3ea7a13d140a0c050afdafc6e9e2884a3 (diff) | |
| download | frameworks_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
| -rw-r--r-- | core/java/android/widget/OverScroller.java | 16 | ||||
| -rw-r--r-- | core/java/android/widget/Scroller.java | 9 | ||||
| -rwxr-xr-x | core/res/res/values/config.xml | 7 | ||||
| -rwxr-xr-x | core/res/res/values/symbols.xml | 7 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 30 |
5 files changed, 50 insertions, 19 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); } } diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index e326adc..57b1919 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2278,11 +2278,14 @@ <!-- Whether cpu boost is enabled for AppLaunch --> <bool name="config_enableCpuBoostForAppLaunch">false</bool> - <integer name="disablepacking_timeout_param">0</integer> - <integer-array name="launchboost_packing_param_value"/> <integer name="launchboost_timeout_param">0</integer> <integer-array name="launchboost_param_value"/> + <!-- Whether disablepacking is enabled or not --> + <bool name="config_disablePacking">false</bool> + <integer name="disablepacking_timeout_param">0</integer> + <integer-array name="launchboost_packing_param_value"/> + <!-- Whether cpu boost is enabled for animation. --> <bool name="config_enablePerfBoostForAnimation">false</bool> <integer name="animationboost_timeout_param">0</integer> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index db5b46f..a462dfe 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2330,11 +2330,14 @@ <!-- cpu boost for AppLaunch --> <java-symbol type="bool" name="config_enableCpuBoostForAppLaunch" /> - <java-symbol type="integer" name="disablepacking_timeout_param" /> - <java-symbol type="array" name="launchboost_packing_param_value"/> <java-symbol type="integer" name="launchboost_timeout_param" /> <java-symbol type="array" name="launchboost_param_value" /> + <!-- cpu boost for AppLaunch --> + <java-symbol type="bool" name="config_disablePacking" /> + <java-symbol type="integer" name="disablepacking_timeout_param" /> + <java-symbol type="array" name="launchboost_packing_param_value" /> + <!-- cpu boost for Animationboost --> <java-symbol type="bool" name="config_enablePerfBoostForAnimation" /> <java-symbol type="integer" name="animationboost_timeout_param" /> diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 332d75e..a4c8882 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -161,9 +161,11 @@ public final class ActivityStackSupervisor implements DisplayListener { static final int RESUME_TOP_ACTIVITY_MSG = FIRST_SUPERVISOR_STACK_MSG + 2; static final int SLEEP_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 3; static final int LAUNCH_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 4; - public BoostFramework mPerf = null; public BoostFramework mPerf_iop = null; + public BoostFramework mPerfBoost = null; + public BoostFramework mPerfPack = null; public boolean mIsPerfBoostEnabled = false; + public boolean mIsperfDisablepackingEnable = false; public int lBoostTimeOut = 0; public int lDisPackTimeOut = 0; public int lBoostCpuParamVal[]; @@ -352,13 +354,19 @@ public final class ActivityStackSupervisor implements DisplayListener { /* Is perf lock for cpu-boost enabled during App 1st launch */ mIsPerfBoostEnabled = mService.mContext.getResources().getBoolean( com.android.internal.R.bool.config_enableCpuBoostForAppLaunch); + mIsperfDisablepackingEnable = mService.mContext.getResources().getBoolean( + com.android.internal.R.bool.config_disablePacking); + if(mIsPerfBoostEnabled) { lBoostTimeOut = mService.mContext.getResources().getInteger( com.android.internal.R.integer.launchboost_timeout_param); + lBoostCpuParamVal = mService.mContext.getResources().getIntArray( + com.android.internal.R.array.launchboost_param_value); + } + + if(mIsperfDisablepackingEnable) { lDisPackTimeOut = mService.mContext.getResources().getInteger( com.android.internal.R.integer.disablepacking_timeout_param); - lBoostCpuParamVal = mService.mContext.getResources().getIntArray( - com.android.internal.R.array.launchboost_param_value); lBoostPackParamVal = mService.mContext.getResources().getIntArray( com.android.internal.R.array.launchboost_packing_param_value); } @@ -3063,12 +3071,18 @@ public final class ActivityStackSupervisor implements DisplayListener { void acquireAppLaunchPerfLock() { /* Acquire perf lock during new app launch */ - if (mIsPerfBoostEnabled == true && mPerf == null) { - mPerf = new BoostFramework(); + if (mIsperfDisablepackingEnable == true && mPerfPack == null) { + mPerfPack = new BoostFramework(); + } + if (mPerfPack != null) { + mPerfPack.perfLockAcquire(lDisPackTimeOut, lBoostPackParamVal); + } + + if (mIsPerfBoostEnabled == true && mPerfBoost == null) { + mPerfBoost = new BoostFramework(); } - if (mPerf != null) { - mPerf.perfLockAcquire(lDisPackTimeOut, lBoostPackParamVal); - mPerf.perfLockAcquire(lBoostTimeOut, lBoostCpuParamVal); + if (mPerfBoost != null) { + mPerfBoost.perfLockAcquire(lBoostTimeOut, lBoostCpuParamVal); } } |
