summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/util/BoostFramework.java86
-rw-r--r--core/res/res/values/ice_config.xml3
-rw-r--r--core/res/res/values/ice_symbols.xml3
3 files changed, 90 insertions, 2 deletions
diff --git a/core/java/android/util/BoostFramework.java b/core/java/android/util/BoostFramework.java
index b5a740c501ab..88c9460913f4 100644
--- a/core/java/android/util/BoostFramework.java
+++ b/core/java/android/util/BoostFramework.java
@@ -30,6 +30,7 @@
package android.util;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.BLASTBufferQueue;
import android.os.SystemProperties;
import android.util.Log;
@@ -79,6 +80,9 @@ public class BoostFramework {
private static Class<?> sUxPerfClass = null;
private static Method sUxIOPStart = null;
+ private static final boolean sIsSupported = Resources.getSystem().getBoolean(
+ com.android.internal.R.bool.config_supportsBoostFramework);
+
/** @hide */
private Object mPerf = null;
private Object mUxPerf = null;
@@ -237,7 +241,7 @@ public class BoostFramework {
private void initFunctions () {
synchronized(BoostFramework.class) {
- if (sIsLoaded == false) {
+ if (sIsSupported && sIsLoaded == false) {
try {
sPerfClass = Class.forName(PERFORMANCE_CLASS);
@@ -322,6 +326,9 @@ public class BoostFramework {
/** @hide */
public int perfLockAcquire(int duration, int... list) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sAcquireFunc != null) {
Object retVal = sAcquireFunc.invoke(mPerf, duration, list);
@@ -336,6 +343,9 @@ public class BoostFramework {
/** @hide */
public int perfLockRelease() {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sReleaseFunc != null) {
Object retVal = sReleaseFunc.invoke(mPerf);
@@ -350,6 +360,9 @@ public class BoostFramework {
/** @hide */
public int perfLockReleaseHandler(int handle) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sReleaseHandlerFunc != null) {
Object retVal = sReleaseHandlerFunc.invoke(mPerf, handle);
@@ -374,6 +387,9 @@ public class BoostFramework {
/** @hide */
public int perfHint(int hint, String userDataStr, int userData1, int userData2) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sPerfHintFunc != null) {
Object retVal = sPerfHintFunc.invoke(mPerf, hint, userDataStr, userData1, userData2);
@@ -394,6 +410,9 @@ public class BoostFramework {
/** @hide */
public int perfGetFeedback(int req, String pkg_name) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sFeedbackFunc != null) {
Object retVal = sFeedbackFunc.invoke(mPerf, req, pkg_name);
@@ -408,6 +427,9 @@ public class BoostFramework {
/** @hide */
public int perfGetFeedbackExtn(int req, String pkg_name, int numArgs, int... list) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sFeedbackFuncExtn != null) {
Object retVal = sFeedbackFuncExtn.invoke(mPerf, req, pkg_name, numArgs, list);
@@ -422,6 +444,9 @@ public class BoostFramework {
/** @hide */
public int perfIOPrefetchStart(int pid, String pkgName, String codePath) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
Object retVal = sIOPStart.invoke(mPerf, pid, pkgName, codePath);
ret = (int) retVal;
@@ -441,6 +466,9 @@ public class BoostFramework {
/** @hide */
public int perfIOPrefetchStop() {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
Object retVal = sIOPStop.invoke(mPerf);
ret = (int) retVal;
@@ -458,6 +486,9 @@ public class BoostFramework {
/** @hide */
public int perfUXEngine_events(int opcode, int pid, String pkgName, int lat, String codePath) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sUXEngineEvents == null) {
return ret;
@@ -475,6 +506,9 @@ public class BoostFramework {
/** @hide */
public String perfUXEngine_trigger(int opcode) {
String ret = null;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sUXEngineTrigger == null) {
return ret;
@@ -490,6 +524,9 @@ public class BoostFramework {
/** @hide */
public String perfSyncRequest(int opcode) {
String ret = null;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sPerfSyncRequest == null) {
return ret;
@@ -505,6 +542,9 @@ public class BoostFramework {
/** @hide */
public String perfGetProp(String prop_name, String def_val) {
String ret = "";
+ if (!sIsSupported) {
+ return def_val;
+ }
try {
if (sPerfGetPropFunc != null) {
Object retVal = sPerfGetPropFunc.invoke(mPerf, prop_name, def_val);
@@ -521,6 +561,9 @@ public class BoostFramework {
/** @hide */
public int perfLockAcqAndRelease(int handle, int duration, int numArgs,int reserveNumArgs, int... list) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sAcqAndReleaseFunc != null) {
Object retVal = sAcqAndReleaseFunc.invoke(mPerf, handle, duration, numArgs, reserveNumArgs, list);
@@ -539,6 +582,9 @@ public class BoostFramework {
/** @hide */
public void perfEvent(int eventId, String pkg_name, int numArgs, int... list) {
+ if (!sIsSupported) {
+ return;
+ }
try {
if (sPerfEventFunc != null) {
sPerfEventFunc.invoke(mPerf, eventId, pkg_name, numArgs, list);
@@ -567,6 +613,9 @@ public class BoostFramework {
public int perfHintAcqRel(int handle, int hint, String pkg_name, int duration,
int hintType, int numArgs, int... list) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sperfHintAcqRelFunc != null) {
Object retVal = sperfHintAcqRelFunc.invoke(mPerf,handle, hint, pkg_name,
@@ -598,6 +647,9 @@ public class BoostFramework {
public int perfHintRenew(int handle, int hint, String pkg_name, int duration,
int hintType, int numArgs, int... list) {
int ret = -1;
+ if (!sIsSupported) {
+ return ret;
+ }
try {
if (sperfHintRenewFunc != null) {
Object retVal = sperfHintRenewFunc.invoke(mPerf,handle, hint, pkg_name,
@@ -637,7 +689,7 @@ public class BoostFramework {
private static Method sGetAdjustedAnimationClock = null;
private static void initQXPerfFuncs() {
- if (sQXIsLoaded) return;
+ if (!sIsSupported || sQXIsLoaded) return;
try {
sScrollOptProp = SystemProperties.getBoolean(SCROLL_OPT_PROP, false);
@@ -692,6 +744,9 @@ public class BoostFramework {
/** @hide */
public static void setFrameInterval(long frameIntervalNanos) {
+ if (!sIsSupported) {
+ return;
+ }
if (sQXIsLoaded) {
if (sScrollOptEnable && sSetFrameInterval != null) {
try {
@@ -724,6 +779,9 @@ public class BoostFramework {
/** @hide */
public static void disableOptimizer(boolean disabled) {
+ if (!sIsSupported) {
+ return;
+ }
if (sScrollOptEnable && sDisableOptimizer != null) {
try {
sDisableOptimizer.invoke(null, disabled);
@@ -735,6 +793,9 @@ public class BoostFramework {
/** @hide */
public static void setBLASTBufferQueue(BLASTBufferQueue blastBufferQueue) {
+ if (!sIsSupported) {
+ return;
+ }
if (sScrollOptEnable && sSetBLASTBufferQueue != null) {
try {
sSetBLASTBufferQueue.invoke(null, blastBufferQueue);
@@ -746,6 +807,9 @@ public class BoostFramework {
/** @hide */
public static void setMotionType(int eventType) {
+ if (!sIsSupported) {
+ return;
+ }
if (sScrollOptEnable && sSetMotionType != null) {
try {
sSetMotionType.invoke(null, eventType);
@@ -757,6 +821,9 @@ public class BoostFramework {
/** @hide */
public static void setVsyncTime(long vsyncTimeNanos) {
+ if (!sIsSupported) {
+ return;
+ }
if (sScrollOptEnable && sSetVsyncTime != null) {
try {
sSetVsyncTime.invoke(null, vsyncTimeNanos);
@@ -768,6 +835,9 @@ public class BoostFramework {
/** @hide */
public static void setUITaskStatus(boolean running) {
+ if (!sIsSupported) {
+ return;
+ }
if (sScrollOptEnable && sSetUITaskStatus != null) {
try {
sSetUITaskStatus.invoke(null, running);
@@ -779,6 +849,9 @@ public class BoostFramework {
/** @hide */
public static void setFlingFlag(int flag) {
+ if (!sIsSupported) {
+ return;
+ }
if (sScrollOptEnable && sSetFlingFlag != null) {
try {
sSetFlingFlag.invoke(null, flag);
@@ -791,6 +864,9 @@ public class BoostFramework {
/** @hide */
public static boolean shouldUseVsync(boolean defaultVsyncFlag) {
boolean useVsync = defaultVsyncFlag;
+ if (!sIsSupported) {
+ return useVsync;
+ }
if (sScrollOptEnable && sShouldUseVsync != null) {
try {
Object retVal = sShouldUseVsync.invoke(null);
@@ -805,6 +881,9 @@ public class BoostFramework {
/** @hide */
public static long getFrameDelay(long defaultDelay, long lastFrameTimeNanos) {
long frameDelay = defaultDelay;
+ if (!sIsSupported) {
+ return frameDelay;
+ }
if (sScrollOptEnable && sGetFrameDelay != null) {
try {
Object retVal = sGetFrameDelay.invoke(null, lastFrameTimeNanos);
@@ -819,6 +898,9 @@ public class BoostFramework {
/** @hide */
public static long getAdjustedAnimationClock(long frameTimeNanos) {
long newFrameTimeNanos = frameTimeNanos;
+ if (!sIsSupported) {
+ return newFrameTimeNanos;
+ }
if (sScrollOptEnable && sGetAdjustedAnimationClock != null) {
try {
Object retVal = sGetAdjustedAnimationClock.invoke(null,
diff --git a/core/res/res/values/ice_config.xml b/core/res/res/values/ice_config.xml
index 6016dc84e9a2..265fbc248b0b 100644
--- a/core/res/res/values/ice_config.xml
+++ b/core/res/res/values/ice_config.xml
@@ -48,4 +48,7 @@
0: Left side
1: Right side -->
<integer name="config_alertSliderLocation">0</integer>
+
+ <!-- Whether device supports QTI Boost Framework -->
+ <bool name="config_supportsBoostFramework">true</bool>
</resources>
diff --git a/core/res/res/values/ice_symbols.xml b/core/res/res/values/ice_symbols.xml
index 394ebe9a115c..dcc26d998032 100644
--- a/core/res/res/values/ice_symbols.xml
+++ b/core/res/res/values/ice_symbols.xml
@@ -32,4 +32,7 @@
<!-- Alert Slider -->
<java-symbol type="bool" name="config_hasAlertSlider" />
<java-symbol type="integer" name="config_alertSliderLocation" />
+
+ <!-- Boost Framework -->
+ <java-symbol type="bool" name="config_supportsBoostFramework" />
</resources>