diff options
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 3 | ||||
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 6 | ||||
| -rw-r--r-- | core/jni/android_os_GraphicsEnvironment.cpp | 5 |
3 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index bfc8b1204373..ca04536af4c0 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -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) { diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index 1868d0596acc..5039b31ed9ff 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -108,6 +108,12 @@ public class GraphicsEnvironment { } /** + * 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. */ public static boolean shouldUseGameDriver(Context context, Bundle coreSettings, diff --git a/core/jni/android_os_GraphicsEnvironment.cpp b/core/jni/android_os_GraphicsEnvironment.cpp index 74ebb95b58c7..be9aee410d40 100644 --- a/core/jni/android_os_GraphicsEnvironment.cpp +++ b/core/jni/android_os_GraphicsEnvironment.cpp @@ -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"; |