Loading core/java/android/os/GraphicsEnvironment.java +28 −25 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ public class GraphicsEnvironment { } /** * Selectively enable ANGLE for applications * Pass ANGLE details down to trigger enable logic */ private static void setupAngle(Context context) { Loading @@ -143,12 +143,16 @@ public class GraphicsEnvironment { String packageName = context.getPackageName(); // Only provide an ANGLE namespace if the package name matches setting boolean optIn = false; if ((angleEnabledApp != null && packageName != null) && (!angleEnabledApp.isEmpty() && !packageName.isEmpty()) && angleEnabledApp.equals(packageName)) { if (DEBUG) Log.v(TAG, "ANGLE enabled for " + packageName); if (DEBUG) Log.v(TAG, packageName + " opted in for ANGLE via Developer Setting"); optIn = true; } ApplicationInfo angleInfo; Loading @@ -173,9 +177,8 @@ public class GraphicsEnvironment { if (DEBUG) Log.v(TAG, "ANGLE package libs: " + paths); // Providing any path will trigger namespace creation setAnglePath(paths); } // Further opt-in logic is handled in native, so pass relevant info down setAngleInfo(paths, packageName, optIn); } /** Loading Loading @@ -266,5 +269,5 @@ public class GraphicsEnvironment { private static native void setLayerPaths(ClassLoader classLoader, String layerPaths); private static native void setDebugLayers(String layers); private static native void setDriverPath(String path); private static native void setAnglePath(String path); private static native void setAngleInfo(String path, String appPackage, boolean optIn); } core/jni/android_os_GraphicsEnvironment.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,10 @@ void setDriverPath(JNIEnv* env, jobject clazz, jstring path) { android::GraphicsEnv::getInstance().setDriverPath(pathChars.c_str()); } void setAnglePath(JNIEnv* env, jobject clazz, jstring path) { void setAngleInfo_native(JNIEnv* env, jobject clazz, jstring path, jstring appName, jboolean optIn) { ScopedUtfChars pathChars(env, path); android::GraphicsEnv::getInstance().setAnglePath(pathChars.c_str()); ScopedUtfChars appNameChars(env, appName); android::GraphicsEnv::getInstance().setAngleInfo(pathChars.c_str(), appNameChars.c_str(), optIn); } void setLayerPaths_native(JNIEnv* env, jobject clazz, jobject classLoader, jstring layerPaths) { Loading @@ -49,7 +50,7 @@ void setDebugLayers_native(JNIEnv* env, jobject clazz, jstring layers) { const JNINativeMethod g_methods[] = { { "setDriverPath", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDriverPath) }, { "setAnglePath", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setAnglePath) }, { "setAngleInfo", "(Ljava/lang/String;Ljava/lang/String;Z)V", reinterpret_cast<void*>(setAngleInfo_native) }, { "setLayerPaths", "(Ljava/lang/ClassLoader;Ljava/lang/String;)V", reinterpret_cast<void*>(setLayerPaths_native) }, { "setDebugLayers", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayers_native) }, }; Loading Loading
core/java/android/os/GraphicsEnvironment.java +28 −25 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ public class GraphicsEnvironment { } /** * Selectively enable ANGLE for applications * Pass ANGLE details down to trigger enable logic */ private static void setupAngle(Context context) { Loading @@ -143,12 +143,16 @@ public class GraphicsEnvironment { String packageName = context.getPackageName(); // Only provide an ANGLE namespace if the package name matches setting boolean optIn = false; if ((angleEnabledApp != null && packageName != null) && (!angleEnabledApp.isEmpty() && !packageName.isEmpty()) && angleEnabledApp.equals(packageName)) { if (DEBUG) Log.v(TAG, "ANGLE enabled for " + packageName); if (DEBUG) Log.v(TAG, packageName + " opted in for ANGLE via Developer Setting"); optIn = true; } ApplicationInfo angleInfo; Loading @@ -173,9 +177,8 @@ public class GraphicsEnvironment { if (DEBUG) Log.v(TAG, "ANGLE package libs: " + paths); // Providing any path will trigger namespace creation setAnglePath(paths); } // Further opt-in logic is handled in native, so pass relevant info down setAngleInfo(paths, packageName, optIn); } /** Loading Loading @@ -266,5 +269,5 @@ public class GraphicsEnvironment { private static native void setLayerPaths(ClassLoader classLoader, String layerPaths); private static native void setDebugLayers(String layers); private static native void setDriverPath(String path); private static native void setAnglePath(String path); private static native void setAngleInfo(String path, String appPackage, boolean optIn); }
core/jni/android_os_GraphicsEnvironment.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,10 @@ void setDriverPath(JNIEnv* env, jobject clazz, jstring path) { android::GraphicsEnv::getInstance().setDriverPath(pathChars.c_str()); } void setAnglePath(JNIEnv* env, jobject clazz, jstring path) { void setAngleInfo_native(JNIEnv* env, jobject clazz, jstring path, jstring appName, jboolean optIn) { ScopedUtfChars pathChars(env, path); android::GraphicsEnv::getInstance().setAnglePath(pathChars.c_str()); ScopedUtfChars appNameChars(env, appName); android::GraphicsEnv::getInstance().setAngleInfo(pathChars.c_str(), appNameChars.c_str(), optIn); } void setLayerPaths_native(JNIEnv* env, jobject clazz, jobject classLoader, jstring layerPaths) { Loading @@ -49,7 +50,7 @@ void setDebugLayers_native(JNIEnv* env, jobject clazz, jstring layers) { const JNINativeMethod g_methods[] = { { "setDriverPath", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDriverPath) }, { "setAnglePath", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setAnglePath) }, { "setAngleInfo", "(Ljava/lang/String;Ljava/lang/String;Z)V", reinterpret_cast<void*>(setAngleInfo_native) }, { "setLayerPaths", "(Ljava/lang/ClassLoader;Ljava/lang/String;)V", reinterpret_cast<void*>(setLayerPaths_native) }, { "setDebugLayers", "(Ljava/lang/String;)V", reinterpret_cast<void*>(setDebugLayers_native) }, }; Loading