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

Commit abceb16f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove flag multiuser_permission_check" into main

parents 20167af1 b9808c00
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -7,13 +7,6 @@ package {
    default_applicable_licenses: ["frameworks_native_license"],
}

aconfig_declarations {
    name: "gpuservice_flags",
    package: "com.android.frameworks.gpuservice.flags",
    container: "system",
    srcs: ["gpuservice_flags.aconfig"],
}

cc_defaults {
    name: "gpuservice_defaults",
    cflags: [
@@ -26,11 +19,6 @@ cc_defaults {
    ],
}

cc_aconfig_library {
    name: "gpuservice_multiuser_flags_c_lib",
    aconfig_declarations: "gpuservice_flags",
}

cc_aconfig_library {
    name: "gpuservice_flags_c_lib",
    aconfig_declarations: "graphicsenv_flags",
@@ -105,9 +93,6 @@ cc_library_static {
    srcs: [
        ":libgpuservice_sources",
    ],
    shared_libs: [
        "gpuservice_multiuser_flags_c_lib",
    ],
}

cc_defaults {
@@ -142,7 +127,4 @@ cc_binary {
    static_libs: [
        "libgpuservice",
    ],
    shared_libs: [
        "gpuservice_multiuser_flags_c_lib",
    ],
}
+6 −17
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
#include <binder/IResultReceiver.h>
#include <binder/Parcel.h>
#include <binder/PermissionCache.h>
#include <com_android_frameworks_gpuservice_flags.h>
#include <com_android_graphics_graphicsenv_flags.h>
#include <cutils/properties.h>
#include <cutils/multiuser.h>
@@ -42,7 +41,6 @@
#include <thread>
#include <memory>

namespace gpuservice_flags = com::android::frameworks::gpuservice::flags;
namespace graphicsenv_flags = com::android::graphics::graphicsenv::flags;

namespace android {
@@ -120,7 +118,6 @@ void GpuService::toggleAngleAsSystemDriver(bool enabled) {

    // only system_server with the ACCESS_GPU_SERVICE permission is allowed to set
    // persist.graphics.egl
    if (gpuservice_flags::multiuser_permission_check()) {
    // retrieve the appid of Settings app on multiuser builds
    const int multiuserappid = multiuser_get_app_id(uid);
    if (multiuserappid != AID_SYSTEM ||
@@ -129,14 +126,6 @@ void GpuService::toggleAngleAsSystemDriver(bool enabled) {
                "pid=%d, uid=%d\n, multiuserappid=%d", pid, uid, multiuserappid);
        return;
    }
    } else {
        if (uid != AID_SYSTEM ||
            !PermissionCache::checkPermission(sAccessGpuServicePermission, pid, uid)) {
            ALOGE("Permission Denial: can't set persist.graphics.egl from setAngleAsSystemDriver() "
                "pid=%d, uid=%d\n", pid, uid);
            return;
        }
    }

    std::lock_guard<std::mutex> lock(mLock);
    if (enabled) {
+0 −12
Original line number Diff line number Diff line
package: "com.android.frameworks.gpuservice.flags"
container: "system"

flag {
    name: "multiuser_permission_check"
    namespace: "gpu"
    description: "Whether to consider headless system user mode/multiuser when checking toggleAngleAsSystemDriver permission."
    bug: "389867658"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+0 −3
Original line number Diff line number Diff line
@@ -13,9 +13,6 @@ cc_fuzz {
        "libgpuservice",
        "liblog",
    ],
    shared_libs: [
        "gpuservice_multiuser_flags_c_lib",
    ],
    fuzz_config: {
        cc: [
            "paulthomson@google.com",
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ cc_test {
    ],
    header_libs: ["bpf_headers"],
    shared_libs: [
        "gpuservice_multiuser_flags_c_lib",
        "libbase",
        "libbinder",
        "libbpf_bcc",