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

Commit 24287f4a authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Add new API to toggle ANGLE as the default system GLES driver"...

Merge "Merge "Add new API to toggle ANGLE as the default system GLES driver" into udc-dev am: 73dee795 am: 65581cad"
parents 8c36ab3e b4db1c65
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -212,6 +212,13 @@ public class GraphicsEnvironment {
        Trace.traceEnd(Trace.TRACE_TAG_GRAPHICS);
    }

    /**
     * Switch the system to use ANGLE as the default GLES driver.
     */
    public void toggleAngleAsSystemDriver(boolean enabled) {
        nativeToggleAngleAsSystemDriver(enabled);
    }

    /**
     * Query to determine if the Game Mode has enabled ANGLE.
     */
@@ -992,6 +999,7 @@ public class GraphicsEnvironment {
            String appPackage, boolean angleIsSystemDriver, String legacyDriverName);
    private static native boolean getShouldUseAngle(String packageName);
    private static native boolean setInjectLayersPrSetDumpable();
    private static native void nativeToggleAngleAsSystemDriver(boolean enabled);

    /**
     * Hint for GraphicsEnvironment that an activity is launching on the process.
+6 −0
Original line number Diff line number Diff line
@@ -122,6 +122,10 @@ void hintActivityLaunch_native(JNIEnv* env, jobject clazz) {
    android::GraphicsEnv::getInstance().hintActivityLaunch();
}

void nativeToggleAngleAsSystemDriver_native(JNIEnv* env, jobject clazz, jboolean enabled) {
    android::GraphicsEnv::getInstance().nativeToggleAngleAsSystemDriver(enabled);
}

const JNINativeMethod g_methods[] = {
        {"isDebuggable", "()Z", reinterpret_cast<void*>(isDebuggable_native)},
        {"setDriverPathAndSphalLibraries", "(Ljava/lang/String;Ljava/lang/String;)V",
@@ -143,6 +147,8 @@ const JNINativeMethod g_methods[] = {
        {"setDebugLayersGLES", "(Ljava/lang/String;)V",
         reinterpret_cast<void*>(setDebugLayersGLES_native)},
        {"hintActivityLaunch", "()V", reinterpret_cast<void*>(hintActivityLaunch_native)},
        {"nativeToggleAngleAsSystemDriver", "(Z)V",
         reinterpret_cast<void*>(nativeToggleAngleAsSystemDriver_native)},
};

const char* const kGraphicsEnvironmentName = "android/os/GraphicsEnvironment";
+7 −0
Original line number Diff line number Diff line
@@ -7638,6 +7638,13 @@
    <permission android:name="android.permission.LOG_FOREGROUND_RESOURCE_USE"
                android:protectionLevel="signature|module" />

    <!-- @hide Allows the settings app to access GPU service APIs".
        <p>Not for use by third-party applications.
        <p>Protection level: signature
    -->
    <permission android:name="android.permission.ACCESS_GPU_SERVICE"
                android:protectionLevel="signature" />

    <!-- @hide Allows an application to get type of any provider uri.
         <p>Not for use by third-party applications.
         <p>Protection level: signature