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

Commit c558c0c1 authored by Cody Northrop's avatar Cody Northrop
Browse files

Revert "GraphicsEnvironment: Allow profileable apps to load layers"

This reverts commit 3832aa99.

Loading layers for apps that have opted for "profileable" breaks
the Android security model.  They have only consented to exposing
profiling information, not exposing data under its control.  Layers
have access to everything in the API calls.

Bug: 128637647
Test: atest CtsGpuToolsHostTestCases
Change-Id: I5aed181c3cec616c3ce98a1a30287b30f190ba9b
parent aa21a4a7
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -230,13 +230,6 @@ public class GraphicsEnvironment {
        return (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) > 0;
    }

    /**
     * Check whether application is profileable
     */
    private static boolean isProfileable(Context context) {
        return context.getApplicationInfo().isProfileableByShell();
    }

    /**
     * Store the layer paths available to the loader.
     */
@@ -287,11 +280,11 @@ public class GraphicsEnvironment {
        String layerPaths = "";

        // Only enable additional debug functionality if the following conditions are met:
        // 1. App is debuggable, profileable, or device is rooted
        // 1. App is debuggable or device is rooted
        // 2. ENABLE_GPU_DEBUG_LAYERS is true
        // 3. Package name is equal to GPU_DEBUG_APP

        if (isDebuggable(context) || isProfileable(context) || (getCanLoadSystemLibraries() == 1)) {
        if (isDebuggable(context) || (getCanLoadSystemLibraries() == 1)) {

            final int enable = coreSettings.getInt(Settings.Global.ENABLE_GPU_DEBUG_LAYERS, 0);