Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b137faed authored by Yiwei Zhang's avatar Yiwei Zhang Committed by Android (Google) Code Review
Browse files

Merge "GpuStats: send a hint of activity launch to GraphicsEnvironment" into qt-dev

parents f235aa57 e54faf58
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -3393,6 +3393,9 @@ public final class ActivityThread extends ClientTransactionHandler {
        }
        }
        WindowManagerGlobal.initialize();
        WindowManagerGlobal.initialize();


        // Hint the GraphicsEnvironment that an activity is launching on the process.
        GraphicsEnvironment.hintActivityLaunch();

        final Activity a = performLaunchActivity(r, customIntent);
        final Activity a = performLaunchActivity(r, customIntent);


        if (a != null) {
        if (a != null) {
+6 −0
Original line number Original line Diff line number Diff line
@@ -107,6 +107,12 @@ public class GraphicsEnvironment {
        Trace.traceEnd(Trace.TRACE_TAG_GRAPHICS);
        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.
     * Allow to query whether an application will use Game Driver.
     */
     */
+5 −0
Original line number Original line Diff line number Diff line
@@ -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[] = {
const JNINativeMethod g_methods[] = {
    { "getCanLoadSystemLibraries", "()I", reinterpret_cast<void*>(getCanLoadSystemLibraries_native) },
    { "getCanLoadSystemLibraries", "()I", reinterpret_cast<void*>(getCanLoadSystemLibraries_native) },
    { "setDriverPathAndSphalLibraries", "(Ljava/lang/String;Ljava/lang/String;)V", reinterpret_cast<void*>(setDriverPathAndSphalLibraries_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) },
    { "setLayerPaths", "(Ljava/lang/ClassLoader;Ljava/lang/String;)V", reinterpret_cast<void*>(setLayerPaths_native) },
    { "setDebugLayers", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayers_native) },
    { "setDebugLayers", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayers_native) },
    { "setDebugLayersGLES", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayersGLES_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";
const char* const kGraphicsEnvironmentName = "android/os/GraphicsEnvironment";