Merge "GpuStats: send a hint of activity launch to GraphicsEnvironment" into qt-dev
This commit is contained in:
@@ -3393,6 +3393,9 @@ public final class ActivityThread extends ClientTransactionHandler {
|
||||
}
|
||||
WindowManagerGlobal.initialize();
|
||||
|
||||
// Hint the GraphicsEnvironment that an activity is launching on the process.
|
||||
GraphicsEnvironment.hintActivityLaunch();
|
||||
|
||||
final Activity a = performLaunchActivity(r, customIntent);
|
||||
|
||||
if (a != null) {
|
||||
|
||||
@@ -107,6 +107,12 @@ public class GraphicsEnvironment {
|
||||
Trace.traceEnd(Trace.TRACE_TAG_GRAPHICS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hint for GraphicsEnvironment that an activity is launching on the process.
|
||||
* Then the app process is allowed to send stats to GpuStats module.
|
||||
*/
|
||||
public static native void hintActivityLaunch();
|
||||
|
||||
/**
|
||||
* Allow to query whether an application will use Game Driver.
|
||||
*/
|
||||
|
||||
@@ -85,6 +85,10 @@ void setDebugLayersGLES_native(JNIEnv* env, jobject clazz, jstring layers) {
|
||||
}
|
||||
}
|
||||
|
||||
void hintActivityLaunch_native(JNIEnv* env, jobject clazz) {
|
||||
android::GraphicsEnv::getInstance().hintActivityLaunch();
|
||||
}
|
||||
|
||||
const JNINativeMethod g_methods[] = {
|
||||
{ "getCanLoadSystemLibraries", "()I", reinterpret_cast<void*>(getCanLoadSystemLibraries_native) },
|
||||
{ "setDriverPathAndSphalLibraries", "(Ljava/lang/String;Ljava/lang/String;)V", reinterpret_cast<void*>(setDriverPathAndSphalLibraries_native) },
|
||||
@@ -94,6 +98,7 @@ const JNINativeMethod g_methods[] = {
|
||||
{ "setLayerPaths", "(Ljava/lang/ClassLoader;Ljava/lang/String;)V", reinterpret_cast<void*>(setLayerPaths_native) },
|
||||
{ "setDebugLayers", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayers_native) },
|
||||
{ "setDebugLayersGLES", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayersGLES_native) },
|
||||
{ "hintActivityLaunch", "()V", reinterpret_cast<void*>(hintActivityLaunch_native) },
|
||||
};
|
||||
|
||||
const char* const kGraphicsEnvironmentName = "android/os/GraphicsEnvironment";
|
||||
|
||||
Reference in New Issue
Block a user