diff options
author | Steve Kondik <steve@cyngn.com> | 2015-10-31 03:22:07 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-01 05:06:15 -0800 |
commit | 2e724e9fe80ccf4ba8f2a98963279e4182485a60 (patch) | |
tree | 494e10e4a9f072f7142a237321f93b672893c9b7 | |
parent | 6146b476afdb9588cd6442fec5d090d99fbbbbb6 (diff) | |
download | frameworks_base-2e724e9fe80ccf4ba8f2a98963279e4182485a60.zip frameworks_base-2e724e9fe80ccf4ba8f2a98963279e4182485a60.tar.gz frameworks_base-2e724e9fe80ccf4ba8f2a98963279e4182485a60.tar.bz2 |
Remove Qualcomm BoostFramework
* This is gonna get really sketchy with the proprietary bits, and
we have our own solution. Revert all associated patches.
Revert "BoostFramework: Adding config for disable packing params & scroll fix"
This reverts commit a313bfae1213dcf8e0845e90f260aada5026685e.
Revert "Perf: Adding hooks for IO prefetcher into framework"
This reverts commit 96e75fcafbeb77427ff4407e80a5d05bf92ec732.
Revert "frameworks/base: Add support for low resolution rendering"
This reverts commit d5282e055963a44df64265e4a592750e31bd9901.
Revert "frameworks/base: support for loading wfd whitelist dynamic libraries"
This reverts commit 79a889bcf6e4c96db48bfb755b7c7e100f4800b1.
Revert "ActivityTrigger: New class to invoke when activity starts/resumes"
This reverts commit 20d6e3c9b06d790e5ede4b1aa585d43a7d72b560.
Revert "BoostFramework to enchance performance during critical scenarios"
This reverts commit 0c3a49a56f827e16d038542b0a81c0e257787995.
Change-Id: Ibc81f3150f4bea572f869be688ebfade11b27307
-rw-r--r-- | core/java/android/app/Activity.java | 34 | ||||
-rw-r--r-- | core/java/android/content/pm/ApplicationInfo.java | 12 | ||||
-rw-r--r-- | core/java/android/util/BoostFramework.java | 184 | ||||
-rw-r--r-- | core/java/android/util/ResolutionOverride.java | 140 | ||||
-rw-r--r-- | core/java/android/view/SurfaceView.java | 19 | ||||
-rw-r--r-- | core/java/android/widget/OverScroller.java | 43 | ||||
-rw-r--r-- | core/java/android/widget/Scroller.java | 36 | ||||
-rw-r--r-- | core/java/com/android/internal/app/ActivityTrigger.java | 89 | ||||
-rw-r--r-- | core/jni/Android.mk | 3 | ||||
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 2 | ||||
-rw-r--r-- | core/jni/com_android_internal_app_ActivityTrigger.cpp | 210 | ||||
-rwxr-xr-x | core/res/res/values/config.xml | 33 | ||||
-rwxr-xr-x | core/res/res/values/symbols.xml | 32 | ||||
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 12 | ||||
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 28 | ||||
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 77 |
16 files changed, 3 insertions, 951 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 627c854..2cb3f39 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -111,7 +111,6 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import android.util.BoostFramework; /** * An activity is a single, focused thing that the user can do. Almost all @@ -673,10 +672,6 @@ public class Activity extends ContextThemeWrapper Window.Callback, KeyEvent.Callback, OnCreateContextMenuListener, ComponentCallbacks2, Window.OnWindowDismissedCallback { - private static BoostFramework mPerf = null; - private static int mDragBoostPossible = -1; - private static int mPerfLockDuration = -1; - private static int mAsParamVal[]; private static final String TAG = "Activity"; private static final boolean DEBUG_LIFECYCLE = false; @@ -2764,35 +2759,6 @@ public class Activity extends ContextThemeWrapper * @return boolean Return true if this event was consumed. */ public boolean dispatchTouchEvent(MotionEvent ev) { - if(mDragBoostPossible == -1) { - mDragBoostPossible = 0; - String currentActivity = getPackageName(); - String[] activityList = getResources().getStringArray( - com.android.internal.R.array.boost_activityList); - if(activityList != null){ - for (String match : activityList) { - if (currentActivity.indexOf(match) != -1){ - mDragBoostPossible = 1; - break; - } - } - } - } - if (mDragBoostPossible == 1) { - if (mPerf == null){ - mPerf = new BoostFramework(); - } - if(mPerfLockDuration == -1){ - mPerfLockDuration = getResources().getInteger( - com.android.internal.R.integer.ascrollboost_timeout); - mAsParamVal = getResources().getIntArray( - com.android.internal.R.array.ascrollboost_param_value); - } - mPerf.perfLockAcquireTouch(ev, - getResources().getDisplayMetrics(), - mPerfLockDuration, mAsParamVal); - } - if (ev.getAction() == MotionEvent.ACTION_DOWN) { onUserInteraction(); } diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 23e8b80..1933fc9 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -466,13 +466,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { public int privateFlags; /** - * Boolean indicating whether the resolution of the SurfaceView associated - * with this appplication can be overriden. - * {@hide} - */ - public int overrideRes = 0; - - /** * The required smallest screen width the application can run on. If 0, * nothing has been specified. Comes from * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp @@ -775,7 +768,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { theme = orig.theme; flags = orig.flags; privateFlags = orig.privateFlags; - overrideRes = orig.overrideRes; requiresSmallestWidthDp = orig.requiresSmallestWidthDp; compatibleWidthLimitDp = orig.compatibleWidthLimitDp; largestWidthLimitDp = orig.largestWidthLimitDp; @@ -831,7 +823,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(theme); dest.writeInt(flags); dest.writeInt(privateFlags); - dest.writeInt(overrideRes); dest.writeInt(requiresSmallestWidthDp); dest.writeInt(compatibleWidthLimitDp); dest.writeInt(largestWidthLimitDp); @@ -886,7 +877,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { theme = source.readInt(); flags = source.readInt(); privateFlags = source.readInt(); - overrideRes = source.readInt(); requiresSmallestWidthDp = source.readInt(); compatibleWidthLimitDp = source.readInt(); largestWidthLimitDp = source.readInt(); @@ -1027,7 +1017,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { /** {@hide} */ public void setResourcePath(String resourcePath) { scanPublicSourceDir = resourcePath; } /** {@hide} */ public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; } /** {@hide} */ public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; } - /** {@hide} */ public void setOverrideRes(int overrideResolution) { overrideRes = overrideResolution; } /** {@hide} */ public String getCodePath() { return scanSourceDir; } /** {@hide} */ public String getBaseCodePath() { return sourceDir; } @@ -1035,5 +1024,4 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { /** {@hide} */ public String getResourcePath() { return scanPublicSourceDir; } /** {@hide} */ public String getBaseResourcePath() { return publicSourceDir; } /** {@hide} */ public String[] getSplitResourcePaths() { return splitSourceDirs; } - /** {@hide} */ public int canOverrideRes() { return overrideRes; } } diff --git a/core/java/android/util/BoostFramework.java b/core/java/android/util/BoostFramework.java deleted file mode 100644 index e71f04e..0000000 --- a/core/java/android/util/BoostFramework.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package android.util; - -import android.util.Log; -import dalvik.system.PathClassLoader; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.lang.System; -import android.view.MotionEvent; -import android.util.DisplayMetrics; - -/** @hide */ -public class BoostFramework { - - private static final String TAG = "BoostFramework"; - private static final String PERFORMANCE_JAR = "/system/framework/QPerformance.jar"; - private static final String PERFORMANCE_CLASS = "com.qualcomm.qti.Performance"; - -/** @hide */ - private static boolean mIsLoaded = false; - private static Method mAcquireFunc = null; - private static Method mReleaseFunc = null; - private static Method mAcquireTouchFunc = null; - private static Method mIOPStart = null; - private static Method mIOPStop = null; - private static Constructor<Class> mConstructor = null; - -/** @hide */ - private Object mPerf = null; - -/** @hide */ - public BoostFramework() { - - if (mIsLoaded == false) { - try { - Class perfClass; - PathClassLoader perfClassLoader; - - perfClassLoader = new PathClassLoader(PERFORMANCE_JAR, - ClassLoader.getSystemClassLoader()); - perfClass = perfClassLoader.loadClass(PERFORMANCE_CLASS); - mConstructor = perfClass.getConstructor(); - - Class[] argClasses = new Class[] {int.class, int[].class}; - mAcquireFunc = perfClass.getDeclaredMethod("perfLockAcquire", argClasses); - Log.v(TAG,"mAcquireFunc method = " + mAcquireFunc); - - argClasses = new Class[] {}; - mReleaseFunc = perfClass.getDeclaredMethod("perfLockRelease", argClasses); - Log.v(TAG,"mReleaseFunc method = " + mReleaseFunc); - - argClasses = new Class[] {MotionEvent.class, DisplayMetrics.class, int.class, int[].class}; - mAcquireTouchFunc = perfClass.getDeclaredMethod("perfLockAcquireTouch", argClasses); - Log.v(TAG,"mAcquireTouchFunc method = " + mAcquireTouchFunc); - - argClasses = new Class[] {int.class, String.class}; - mIOPStart = perfClass.getDeclaredMethod("perfIOPrefetchStart", argClasses); - Log.v(TAG,"mIOPStart method = " + mIOPStart); - - argClasses = new Class[] {}; - mIOPStop = perfClass.getDeclaredMethod("perfIOPrefetchStop", argClasses); - Log.v(TAG,"mIOPStop method = " + mIOPStop); - - mIsLoaded = true; - } - catch(Exception e) { - Log.e(TAG,"BoostFramework() : Exception_1 = " + e); - } - } - - try { - if (mConstructor != null) { - mPerf = mConstructor.newInstance(); - } - } - catch(Exception e) { - Log.e(TAG,"BoostFramework() : Exception_2 = " + e); - } - - Log.v(TAG,"BoostFramework() : mPerf = " + mPerf); - } - -/** @hide */ -/* private static void loadNative() { - if(!isLoaded){ - //System.loadLibrary("perf_jni"); - System.loadLibrary("qti_performance"); - isLoaded=true; - } - return; - } -*/ - -/** @hide */ - public int perfLockAcquire(int duration, int... list) { - int ret = -1; - try { - Object retVal = mAcquireFunc.invoke(mPerf, duration, list); - ret = (int)retVal; - } catch(Exception e) { - Log.e(TAG,"Exception " + e); - } - return ret; - } - -/** @hide */ - public int perfLockRelease() { - int ret = -1; - try { - Object retVal = mReleaseFunc.invoke(mPerf); - ret = (int)retVal; - } catch(Exception e) { - Log.e(TAG,"Exception " + e); - } - return ret; - } -/** @hide */ - public int perfLockAcquireTouch(MotionEvent ev, DisplayMetrics metrics, - int duration, int... list) { - int ret = -1; - try { - Object retVal = mAcquireTouchFunc.invoke(mPerf, ev, metrics, duration, list); - ret = (int)retVal; - } catch(Exception e) { - Log.e(TAG,"Exception " + e); - } - return ret; - } - -/** @hide */ - public int perfIOPrefetchStart(int pid, String pkg_name) - { - int ret = -1; - try { - Object retVal = mIOPStart.invoke(mPerf,pid,pkg_name); - ret = (int)retVal; - } catch(Exception e) { - Log.e(TAG,"Exception " + e); - } - return ret; - } - -/** @hide */ - public int perfIOPrefetchStop() - { - int ret = -1; - try { - Object retVal = mIOPStop.invoke(mPerf); - ret = (int)retVal; - } catch(Exception e) { - Log.e(TAG,"Exception " + e); - } - return ret; - } - -}; diff --git a/core/java/android/util/ResolutionOverride.java b/core/java/android/util/ResolutionOverride.java deleted file mode 100644 index d9fc1be..0000000 --- a/core/java/android/util/ResolutionOverride.java +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are -* met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above -* copyright notice, this list of conditions and the following -* disclaimer in the documentation and/or other materials provided -* with the distribution. -* * Neither the name of The Linux Foundation nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ - -package android.util; - -import android.content.ComponentName; -import android.content.pm.ActivityInfo; -import android.content.pm.PackageManager; -import android.content.res.Configuration; -import android.graphics.Matrix; -import android.os.SystemProperties; -import android.util.Log; -import android.view.MotionEvent; -import android.view.SurfaceView; -import android.view.View; - -/** @hide */ -public class ResolutionOverride { - /** @hide */ - static private final boolean DEBUG = false; - static private final String TAG = "ResolutionOverride"; - private static final String RES_OVERRIDE = "persist.debug.app_res_override"; - private boolean mIsEnabled = false; - private int mOverrideXres = 0; - private int mOverrideYres = 0; - - /** @hide */ - public ResolutionOverride(SurfaceView view) { - boolean enable = (view.getContext().getApplicationInfo().canOverrideRes() == 1); - int orientation = view.getResources().getConfiguration().orientation; - - if(enable && (orientation == Configuration.ORIENTATION_PORTRAIT || - orientation == Configuration.ORIENTATION_LANDSCAPE)) { - String resStr = SystemProperties.get(RES_OVERRIDE, null); - - if (resStr != null && resStr.length() > 0) { - resStr = resStr.toLowerCase(); - final int pos = resStr.indexOf('x'); - if (pos > 0 && resStr.lastIndexOf('x') == pos) { - try { - mOverrideXres = Integer.parseInt(resStr.substring(0, pos)); - mOverrideYres = Integer.parseInt(resStr.substring(pos + 1)); - } catch (NumberFormatException ex) { - Log.e(TAG, "Error in extracting the overriding xres and yres"); - } - } - } - - if(orientation == Configuration.ORIENTATION_LANDSCAPE) { - int tmp = mOverrideXres; - mOverrideXres = mOverrideYres; - mOverrideYres = tmp; - } - - if(mOverrideXres > 0 && mOverrideYres > 0) { - mIsEnabled = true; - if (DEBUG) Log.i(TAG, "Orientation: " + orientation + - " Overriding resolution to" + " xres: " + mOverrideXres - + " yres: " + mOverrideYres); - } - } - } - - /** @hide */ - public void setFixedSize(SurfaceView view) { - if(!mIsEnabled) { - return; - } - - view.getHolder().setFixedSize(mOverrideXres, mOverrideYres); - } - - /** @hide */ - public void handleTouch(SurfaceView view, MotionEvent ev) { - if(!mIsEnabled) { - return; - } - - Matrix matrix = new Matrix(); - //mOverride{Xres, Yres} are already swapped if orientation is landscape - float xscale = (mOverrideXres * 1.0f) / view.getWidth(); - float yscale = (mOverrideYres * 1.0f) / view.getHeight(); - - if (DEBUG) Log.i(TAG, "Before overriding the touch event x/y : " + ev); - matrix.postScale(xscale, yscale); - ev.transform(matrix); - if (DEBUG) Log.i(TAG, "After overriding the touch event x/y : " + ev); - } - - /** @hide */ - public void handleResize(final SurfaceView surfaceView) { - if(!mIsEnabled) { - return; - } - - /* Change the visibility to GONE and back to VISIBLE and post it - * on the main thread for the touch events to be effective on the - * changed SurfaceView with the new dimensions - */ - surfaceView.post(new Runnable() { - @Override - public void run() { - surfaceView.setVisibility(View.GONE); - } - }); - - surfaceView.postDelayed(new Runnable() { - @Override - public void run() { - surfaceView.setVisibility(View.VISIBLE); - } - }, 100); - } -}; diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 7d49fd3..7d48a9a 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -33,7 +33,6 @@ import android.os.SystemClock; import android.os.ParcelFileDescriptor; import android.util.AttributeSet; import android.util.Log; -import android.util.ResolutionOverride; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -168,7 +167,6 @@ public class SurfaceView extends View { boolean mUpdateWindowNeeded; boolean mReportDrawNeeded; private Translator mTranslator; - ResolutionOverride mResolutionOverride = null; private final ViewTreeObserver.OnPreDrawListener mDrawListener = new ViewTreeObserver.OnPreDrawListener() { @@ -204,8 +202,6 @@ public class SurfaceView extends View { private void init() { setWillNotDraw(true); - mResolutionOverride = new ResolutionOverride(this); - mResolutionOverride.setFixedSize(this); } /** @@ -298,16 +294,6 @@ public class SurfaceView extends View { setMeasuredDimension(width, height); } - /** - * Transforms the touch events to the new resolution coordinate system - * if the resolution has changed - */ - @Override - public boolean dispatchTouchEvent(MotionEvent ev) { - mResolutionOverride.handleTouch(this, ev); - return super.dispatchTouchEvent(ev); - } - /** @hide */ @Override protected boolean setFrame(int left, int top, int right, int bottom) { @@ -672,14 +658,11 @@ public class SurfaceView extends View { public void resized(Rect frame, Rect overscanInsets, Rect contentInsets, Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw, Configuration newConfig) { - final SurfaceView surfaceView = mSurfaceView.get(); + SurfaceView surfaceView = mSurfaceView.get(); if (surfaceView != null) { if (DEBUG) Log.v( "SurfaceView", surfaceView + " got resized: w=" + frame.width() + " h=" + frame.height() + ", cur w=" + mCurWidth + " h=" + mCurHeight); - - surfaceView.mResolutionOverride.handleResize(surfaceView); - surfaceView.mSurfaceLock.lock(); try { if (reportDraw) { diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java index 778b2dd..50569d7 100644 --- a/core/java/android/widget/OverScroller.java +++ b/core/java/android/widget/OverScroller.java @@ -22,7 +22,6 @@ import android.util.Log; import android.view.ViewConfiguration; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; -import android.util.BoostFramework; /** * This class encapsulates scrolling with the ability to overshoot the bounds @@ -600,18 +599,6 @@ public class OverScroller { private static final int CUBIC = 1; private static final int BALLISTIC = 2; - /* - * Perf boost related variables - * Enabled/Disabled using config_enableCpuBoostForOverScrollerFling - * true value turns it on, by default will be turned off - */ - private BoostFramework mPerf = null; - private boolean mIsPerfLockAcquired = false; - private boolean mIsPerfBoostEnabled = false; - private int fBoostTimeOut = 0; - private int flingBoostTimeOut = 0; - private int fBoostParamVal[]; - static { float x_min = 0.0f; float y_min = 0.0f; @@ -656,19 +643,6 @@ public class OverScroller { * 39.37f // inch/meter * ppi * 0.84f; // look and feel tuning - - mIsPerfBoostEnabled = context.getResources().getBoolean( - com.android.internal.R.bool.config_enableCpuBoostForOverScrollerFling); - if (mIsPerfBoostEnabled) { - fBoostTimeOut = context.getResources().getInteger( - com.android.internal.R.integer.flingboost_timeout_param); - fBoostParamVal = context.getResources().getIntArray( - com.android.internal.R.array.flingboost_param_value); - } - - if (mPerf == null && mIsPerfBoostEnabled) { - mPerf = new BoostFramework(); - } } void updateScroll(float q) { @@ -716,11 +690,6 @@ public class OverScroller { } void finish() { - if (mIsPerfLockAcquired && mPerf != null) { - mPerf.perfLockRelease(); - mIsPerfLockAcquired = false; - } - mCurrentPosition = mFinal; // Not reset since WebView relies on this value for fast fling. // TODO: restore when WebView uses the fast fling implemented in this class. @@ -791,18 +760,6 @@ public class OverScroller { if (velocity != 0) { mDuration = mSplineDuration = getSplineFlingDuration(velocity); totalDistance = getSplineFlingDistance(velocity); - - if (mPerf != null) { - mIsPerfLockAcquired = true; - if (0 == fBoostTimeOut) { - //config value is not defined - flingBoostTimeOut = mDuration; - } else { - //config value is present - flingBoostTimeOut = fBoostTimeOut; - } - mPerf.perfLockAcquire(flingBoostTimeOut, fBoostParamVal); - } } mSplineDistance = (int) (totalDistance * Math.signum(velocity)); diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java index d0ba9e6..357c9c3 100644 --- a/core/java/android/widget/Scroller.java +++ b/core/java/android/widget/Scroller.java @@ -22,7 +22,6 @@ import android.os.Build; import android.view.ViewConfiguration; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; -import android.util.BoostFramework; /** @@ -109,17 +108,6 @@ 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 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. private float mPhysicalCoeff; @@ -179,7 +167,6 @@ public class Scroller { * not to support progressive "flywheel" behavior in flinging. */ public Scroller(Context context, Interpolator interpolator, boolean flywheel) { - boolean bIsPerfBoostEnabled = false; mFinished = true; if (interpolator == null) { mInterpolator = new ViscousFluidInterpolator(); @@ -191,18 +178,6 @@ 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 (bIsPerfBoostEnabled) { - sBoostTimeOut = context.getResources().getInteger( - com.android.internal.R.integer.scrollboost_timeout_param); - sBoostParamVal = context.getResources().getIntArray( - com.android.internal.R.array.scrollboost_param_value); - } - if (mPerf == null && bIsPerfBoostEnabled) { - mPerf = new BoostFramework(); - } - } /** @@ -420,17 +395,6 @@ public class Scroller { mDeltaX = dx; mDeltaY = dy; mDurationReciprocal = 1.0f / (float) mDuration; - - if ((mPerf != null) && (duration != 0)) { - if (0 == sBoostTimeOut) { - //config value is not defined - scrollBoostTimeOut = mDuration; - } else { - //config value is present - scrollBoostTimeOut = sBoostTimeOut; - } - mPerf.perfLockAcquire(scrollBoostTimeOut, sBoostParamVal); - } } /** diff --git a/core/java/com/android/internal/app/ActivityTrigger.java b/core/java/com/android/internal/app/ActivityTrigger.java deleted file mode 100644 index 6f6949a..0000000 --- a/core/java/com/android/internal/app/ActivityTrigger.java +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -package com.android.internal.app; - -import android.content.ComponentName; -import android.content.Intent; -import android.content.pm.ActivityInfo; -import android.content.pm.ApplicationInfo; -import android.util.Log; - -public class ActivityTrigger -{ - private static final String TAG = "ActivityTrigger"; - - private static final int FLAG_OVERRIDE_RESOLUTION = 1; - private static final int FLAG_HARDWARE_ACCELERATED = - ActivityInfo.FLAG_HARDWARE_ACCELERATED; - - - /** &hide */ - public ActivityTrigger() { - //Log.d(TAG, "ActivityTrigger initialized"); - } - - /** &hide */ - protected void finalize() { - native_at_deinit(); - } - - /** &hide */ - public void activityStartTrigger(Intent intent, ActivityInfo acInfo, ApplicationInfo appInfo) { - ComponentName cn = intent.getComponent(); - int overrideFlags = 0; - String activity = null; - - if(cn != null) - activity = cn.flattenToString() + "/" + appInfo.versionCode; - - overrideFlags = native_at_startActivity(activity, overrideFlags); - - if((overrideFlags & FLAG_HARDWARE_ACCELERATED) != 0) { - acInfo.flags |= ActivityInfo.FLAG_HARDWARE_ACCELERATED; - } - if((overrideFlags & FLAG_OVERRIDE_RESOLUTION) != 0) { - appInfo.setOverrideRes(1); - } - } - - /** &hide */ - public void activityResumeTrigger(Intent intent, ActivityInfo acInfo, ApplicationInfo appInfo) { - ComponentName cn = intent.getComponent(); - String activity = null; - - if (cn != null) - activity = cn.flattenToString() + "/" + appInfo.versionCode; - native_at_resumeActivity(activity); - } - - private native int native_at_startActivity(String activity, int flags); - private native void native_at_resumeActivity(String activity); - private native void native_at_deinit(); -} diff --git a/core/jni/Android.mk b/core/jni/Android.mk index c3e79dc..a118106 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -171,8 +171,7 @@ LOCAL_SRC_FILES:= \ com_android_internal_net_NetworkStatsFactory.cpp \ com_android_internal_os_Zygote.cpp \ com_android_internal_util_VirtualRefBasePtr.cpp \ - com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp \ - com_android_internal_app_ActivityTrigger.cpp + com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp LOCAL_C_INCLUDES += \ $(JNI_H_INCLUDE) \ diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index f39d127..a715c5f 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -192,7 +192,6 @@ extern int register_com_android_internal_content_NativeLibraryHelper(JNIEnv *env extern int register_com_android_internal_net_NetworkStatsFactory(JNIEnv *env); extern int register_com_android_internal_os_Zygote(JNIEnv *env); extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env); -extern int register_com_android_internal_app_ActivityTrigger(JNIEnv *env); static AndroidRuntime* gCurRuntime = NULL; @@ -1435,7 +1434,6 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_animation_PropertyValuesHolder), REG_JNI(register_com_android_internal_content_NativeLibraryHelper), REG_JNI(register_com_android_internal_net_NetworkStatsFactory), - REG_JNI(register_com_android_internal_app_ActivityTrigger), }; /* diff --git a/core/jni/com_android_internal_app_ActivityTrigger.cpp b/core/jni/com_android_internal_app_ActivityTrigger.cpp deleted file mode 100644 index 8ba9e06d..0000000 --- a/core/jni/com_android_internal_app_ActivityTrigger.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_TAG "ActTriggerJNI" - -#include "jni.h" -#include "JNIHelp.h" -#include <android_runtime/AndroidRuntime.h> - -#include <dlfcn.h> -#include <limits.h> -#include <string.h> - -#include <cutils/properties.h> -#include <utils/Log.h> - -#define LIBRARY_PATH_PREFIX "/vendor/lib/" - -namespace android -{ - -// ---------------------------------------------------------------------------- -/* - * Stuct containing handle to dynamically loaded lib as well as function - * pointers to key interfaces. - */ -typedef struct dlLibHandler { - void *dlhandle; - void (*startActivity)(const char *, int *); - void (*resumeActivity)(const char *); - void (*init)(void); - void (*deinit)(void); - const char *dlname; -}dlLibHandler; - -/* - * Array of dlhandlers - * library -both handlers for Start and Resume events. - */ -static dlLibHandler mDlLibHandlers[] = { - {NULL, NULL, NULL, NULL, NULL, - "ro.vendor.at_library"}, - {NULL, NULL, NULL, NULL, NULL, - "ro.vendor.gt_library"}, - {NULL, NULL, NULL, NULL, NULL, - "ro.vendor.wl_library"} -}; - -// ---------------------------------------------------------------------------- - -static void -com_android_internal_app_ActivityTrigger_native_at_init() -{ - const char *rc; - char buf[PROPERTY_VALUE_MAX]; - bool errored = false; - size_t numlibs = 0; - - numlibs = sizeof (mDlLibHandlers) / sizeof (*mDlLibHandlers); - - for(size_t i = 0; i < numlibs; i++) { - errored = false; - - /* Retrieve name of vendor library */ - if (property_get(mDlLibHandlers[i].dlname, buf, NULL) <= 0) { - continue; - } - - /* Sanity check - ensure */ - buf[PROPERTY_VALUE_MAX-1] = '\0'; - if (strstr(buf, "/") != NULL) { - continue; - } - - mDlLibHandlers[i].dlhandle = dlopen(buf, RTLD_NOW | RTLD_LOCAL); - if (mDlLibHandlers[i].dlhandle == NULL) { - continue; - } - - dlerror(); - - *(void **) (&mDlLibHandlers[i].startActivity) = dlsym(mDlLibHandlers[i].dlhandle, "activity_trigger_start"); - if ((rc = dlerror()) != NULL) { - errored = true; - } - - if (!errored) { - *(void **) (&mDlLibHandlers[i].resumeActivity) = dlsym(mDlLibHandlers[i].dlhandle, "activity_trigger_resume"); - if ((rc = dlerror()) != NULL) { - errored = true; - } - } - if (!errored) { - *(void **) (&mDlLibHandlers[i].init) = dlsym(mDlLibHandlers[i].dlhandle, "activity_trigger_init"); - if ((rc = dlerror()) != NULL) { - errored = true; - } - } - - if (errored) { - mDlLibHandlers[i].startActivity = NULL; - mDlLibHandlers[i].resumeActivity = NULL; - if (mDlLibHandlers[i].dlhandle) { - dlclose(mDlLibHandlers[i].dlhandle); - mDlLibHandlers[i].dlhandle = NULL; - } - } else { - (*mDlLibHandlers[i].init)(); - } - } -} - -static void -com_android_internal_app_ActivityTrigger_native_at_deinit(JNIEnv *env, jobject clazz) -{ - size_t numlibs = sizeof (mDlLibHandlers) / sizeof (*mDlLibHandlers); - - for(size_t i = 0; i < numlibs; i++) { - if (mDlLibHandlers[i].dlhandle) { - mDlLibHandlers[i].startActivity = NULL; - mDlLibHandlers[i].resumeActivity = NULL; - - *(void **) (&mDlLibHandlers[i].deinit) = dlsym(mDlLibHandlers[i].dlhandle, "activity_trigger_deinit"); - if (mDlLibHandlers[i].deinit) { - (*mDlLibHandlers[i].deinit)(); - } - - dlclose(mDlLibHandlers[i].dlhandle); - mDlLibHandlers[i].dlhandle = NULL; - } - } -} - -static jint -com_android_internal_app_ActivityTrigger_native_at_startActivity(JNIEnv *env, jobject clazz, jstring activity, jint flags) -{ - int activiyFlags = flags; - size_t numlibs = sizeof (mDlLibHandlers) / sizeof (*mDlLibHandlers); - for(size_t i = 0; i < numlibs; i++){ - if(mDlLibHandlers[i].startActivity && activity) { - const char *actStr = env->GetStringUTFChars(activity, NULL); - if (actStr) { - (*mDlLibHandlers[i].startActivity)(actStr, &activiyFlags); - env->ReleaseStringUTFChars(activity, actStr); - } - } - } - return activiyFlags; -} - -static void -com_android_internal_app_ActivityTrigger_native_at_resumeActivity(JNIEnv *env, jobject clazz, jstring activity) -{ - size_t numlibs = sizeof (mDlLibHandlers) / sizeof (*mDlLibHandlers); - - for(size_t i = 0; i < numlibs; i++){ - if(mDlLibHandlers[i].resumeActivity && activity) { - const char *actStr = env->GetStringUTFChars(activity, NULL); - if (actStr) { - (*mDlLibHandlers[i].resumeActivity)(actStr); - env->ReleaseStringUTFChars(activity, actStr); - } - } - } -} - -// ---------------------------------------------------------------------------- - -static JNINativeMethod gMethods[] = { - {"native_at_startActivity", "(Ljava/lang/String;I)I", (void *)com_android_internal_app_ActivityTrigger_native_at_startActivity}, - {"native_at_resumeActivity", "(Ljava/lang/String;)V", (void *)com_android_internal_app_ActivityTrigger_native_at_resumeActivity}, - {"native_at_deinit", "()V", (void *)com_android_internal_app_ActivityTrigger_native_at_deinit}, -}; - - -int register_com_android_internal_app_ActivityTrigger(JNIEnv *env) -{ - com_android_internal_app_ActivityTrigger_native_at_init(); - - return AndroidRuntime::registerNativeMethods(env, - "com/android/internal/app/ActivityTrigger", gMethods, NELEM(gMethods)); -} - -} // namespace android diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 6de725d..0dd4b40 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2400,39 +2400,6 @@ <string-array name="config_cell_retries_per_error_code"> </string-array> - <!-- Whether cpu boost is enabled for AppLaunch --> - <bool name="config_enableCpuBoostForAppLaunch">false</bool> - <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> - <integer-array name="animationboost_param_value"/> - - <!-- Whether cpu boost is enabled for overscroller fling. --> - <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> - <integer name="flingboost_timeout_param">0</integer> - <integer-array name="flingboost_param_value"/> - - <!-- Whether cpu boost is enabled for horizontal scroll. --> - <bool name="config_enableCpuBoostForScroller">false</bool> - <integer name="scrollboost_timeout_param">0</integer> - <integer-array name="scrollboost_param_value"/> - - <!-- Activities list for boost --> - <string-array translatable="false" name="boost_activityList"> - </string-array> - - <!-- Activity scroll boost params --> - <integer name="ascrollboost_timeout">0</integer> - <integer-array name="ascrollboost_param_value"/> - <!-- Configuration to play sms ringtone during MO/MT call --> <bool name="config_sms_ringtone_incall">false</bool> <!-- IpReachability monitor enable/Disable --> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 6643cf3..1173069 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2348,38 +2348,6 @@ <!-- config softap extention feature --> <java-symbol type="bool" name="config_softap_extention" /> - <!-- cpu boost for AppLaunch --> - <java-symbol type="bool" name="config_enableCpuBoostForAppLaunch" /> - <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" /> - <java-symbol type="array" name="animationboost_param_value" /> - - <!-- cpu boost for overscroller fling --> - <java-symbol type="bool" name="config_enableCpuBoostForOverScrollerFling" /> - <java-symbol type="integer" name="flingboost_timeout_param" /> - <java-symbol type="array" name="flingboost_param_value" /> - - <!-- cpu boost for horizontal scroll --> - <java-symbol type="bool" name="config_enableCpuBoostForScroller" /> - <java-symbol type="integer" name="scrollboost_timeout_param" /> - <java-symbol type="array" name="scrollboost_param_value" /> - - <!-- Activities list for boost --> - <java-symbol type="array" name="boost_activityList" /> - - <!-- Activity scroll boost params --> - <java-symbol type="integer" name="ascrollboost_timeout" /> - <java-symbol type="array" name="ascrollboost_param_value" /> - <!-- for wifi auto connection --> <java-symbol type="bool" name="wifi_autocon" /> <!-- Configuration to play sms ringtone during MO/MT call --> diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 41e23ac..fb65a15 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -74,7 +74,6 @@ import android.util.ArraySet; import android.util.DebugUtils; import android.util.SparseIntArray; import android.view.Display; -import android.util.BoostFramework; import android.view.InflateException; import com.android.internal.R; @@ -3456,17 +3455,6 @@ public final class ActivityManagerService extends ActivityManagerNative checkTime(startTime, "startProcess: building log message"); StringBuilder buf = mStringBuilder; buf.setLength(0); - if(hostingType.equals("activity")) - { - BoostFramework mPerf = null; - if (null == mPerf) { - mPerf = new BoostFramework(); - } - if (mPerf != null) { - mPerf.perfIOPrefetchStart(startResult.pid,app.processName); - } - } - buf.append("Start proc "); buf.append(startResult.pid); buf.append(':'); diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 469e670..218ee02 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -67,8 +67,6 @@ import android.service.voice.IVoiceInteractionSession; import android.util.EventLog; import android.util.Slog; import android.view.Display; -import android.util.BoostFramework; -import com.android.internal.app.ActivityTrigger; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -154,10 +152,6 @@ final class ActivityStack { final WindowManagerService mWindowManager; private final RecentTasks mRecentTasks; - public BoostFramework mPerf = null; - public boolean mIsAnimationBoostEnabled = false; - public int aBoostTimeOut = 0; - public int aBoostParamVal[]; /** * The back history of all previous (and possibly still * running) activities. It contains #TaskRecord objects. @@ -273,8 +267,6 @@ final class ActivityStack { final Handler mHandler; - static final ActivityTrigger mActivityTrigger = new ActivityTrigger(); - final class ActivityStackHandler extends Handler { ActivityStackHandler(Looper looper) { @@ -371,14 +363,6 @@ final class ActivityStack { mCurrentUser = mService.mCurrentUserId; mRecentTasks = recentTasks; mOverrideConfig = Configuration.EMPTY; - mIsAnimationBoostEnabled = mService.mContext.getResources().getBoolean( - com.android.internal.R.bool.config_enablePerfBoostForAnimation); - if (mIsAnimationBoostEnabled) { - aBoostTimeOut = mService.mContext.getResources().getInteger( - com.android.internal.R.integer.animationboost_timeout_param); - aBoostParamVal = mService.mContext.getResources().getIntArray( - com.android.internal.R.array.animationboost_param_value); - } } boolean okToShowLocked(ActivityRecord r) { @@ -1701,8 +1685,6 @@ final class ActivityStack { if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resuming " + next); - mActivityTrigger.activityResumeTrigger(next.intent, next.info, next.appInfo); - // If we are currently pausing an activity, then don't do anything // until that is done. if (!mStackSupervisor.allPausedActivitiesComplete()) { @@ -1824,9 +1806,6 @@ final class ActivityStack { // that the previous one will be hidden soon. This way it can know // to ignore it when computing the desired screen orientation. boolean anim = true; - if (mIsAnimationBoostEnabled == true && mPerf == null) { - mPerf = new BoostFramework(); - } if (prev != null) { if (prev.finishing) { if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, @@ -1838,9 +1817,6 @@ final class ActivityStack { mWindowManager.prepareAppTransition(prev.task == next.task ? AppTransition.TRANSIT_ACTIVITY_CLOSE : AppTransition.TRANSIT_TASK_CLOSE, false); - if(prev.task != next.task && mPerf != null) { - mPerf.perfLockAcquire(aBoostTimeOut, aBoostParamVal); - } } mWindowManager.setAppWillBeHidden(prev.appToken); mWindowManager.setAppVisibility(prev.appToken, false); @@ -1856,9 +1832,6 @@ final class ActivityStack { : next.mLaunchTaskBehind ? AppTransition.TRANSIT_TASK_OPEN_BEHIND : AppTransition.TRANSIT_TASK_OPEN, false); - if(prev.task != next.task && mPerf != null) { - mPerf.perfLockAcquire(aBoostTimeOut, aBoostParamVal); - } } } if (false) { @@ -2194,7 +2167,6 @@ final class ActivityStack { task.setFrontOfTask(); r.putInHistory(); - mActivityTrigger.activityStartTrigger(r.intent, r.info, r.appInfo); if (!isHomeStack() || numActivities() > 0) { // We want to show the starting preview window if we are // switching to a new task, or the next activity's process is diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 2851722..d20a9c4 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -101,7 +101,6 @@ import android.util.ArraySet; import android.util.EventLog; import android.util.Slog; import android.util.SparseArray; -import android.util.BoostFramework; import android.util.SparseIntArray; import android.view.Display; @@ -119,6 +118,7 @@ import com.android.server.LocalServices; import com.android.server.am.ActivityStack.ActivityState; import com.android.server.wm.WindowManagerService; + import java.io.FileDescriptor; import java.io.IOException; import java.io.PrintWriter; @@ -161,15 +161,6 @@ 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_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[]; - public int lBoostPackParamVal[]; static final int HANDLE_DISPLAY_ADDED = FIRST_SUPERVISOR_STACK_MSG + 5; static final int HANDLE_DISPLAY_CHANGED = FIRST_SUPERVISOR_STACK_MSG + 6; static final int HANDLE_DISPLAY_REMOVED = FIRST_SUPERVISOR_STACK_MSG + 7; @@ -356,25 +347,6 @@ public final class ActivityStackSupervisor implements DisplayListener { mService = service; mRecentTasks = recentTasks; mHandler = new ActivityStackSupervisorHandler(mService.mHandler.getLooper()); - /* 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); - lBoostPackParamVal = mService.mContext.getResources().getIntArray( - com.android.internal.R.array.launchboost_packing_param_value); - } } /** @@ -2807,14 +2779,6 @@ public final class ActivityStackSupervisor implements DisplayListener { } void findTaskToMoveToFrontLocked(TaskRecord task, int flags, Bundle options, String reason) { - - ActivityRecord top_activity; - top_activity = task.stack.topRunningActivityLocked(null); - /* App is launching from recent apps and it's a new process */ - if(top_activity != null && top_activity.state == ActivityState.DESTROYED) { - acquireAppLaunchPerfLock(); - } - if ((flags & ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) { mUserLeaving = true; } @@ -3079,23 +3043,6 @@ public final class ActivityStackSupervisor implements DisplayListener { resumeTopActivitiesLocked(); } - void acquireAppLaunchPerfLock() { - /* Acquire perf lock during new app launch */ - if (mIsperfDisablepackingEnable == true && mPerfPack == null) { - mPerfPack = new BoostFramework(); - } - if (mPerfPack != null) { - mPerfPack.perfLockAcquire(lDisPackTimeOut, lBoostPackParamVal); - } - - if (mIsPerfBoostEnabled == true && mPerfBoost == null) { - mPerfBoost = new BoostFramework(); - } - if (mPerfBoost != null) { - mPerfBoost.perfLockAcquire(lBoostTimeOut, lBoostCpuParamVal); - } - } - ActivityRecord findTaskLocked(ActivityRecord r) { if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Looking for task of " + r); for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { @@ -3113,32 +3060,10 @@ public final class ActivityStackSupervisor implements DisplayListener { } final ActivityRecord ar = stack.findTaskLocked(r); if (ar != null) { - if(ar.state == ActivityState.DESTROYED ) { - /*It's a new app launch */ - acquireAppLaunchPerfLock(); - - // Strat IOP - if (mPerf_iop == null) { - mPerf_iop = new BoostFramework(); - } - if (mPerf_iop != null) { - mPerf_iop.perfIOPrefetchStart(-1,r.packageName); - } - } return ar; } } } - /* Acquire perf lock during new app launch */ - acquireAppLaunchPerfLock(); - //Start IOP - if (mPerf_iop == null) { - mPerf_iop = new BoostFramework(); - } - if (mPerf_iop != null) { - mPerf_iop.perfIOPrefetchStart(-1,r.packageName); - } - if (DEBUG_TASKS) Slog.d(TAG_TASKS, "No task found"); return null; } |