# Copyright (C) 2026 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: b/330118443 - minimize the list further
# device/google/cuttlefish/shared/graphics/sepolicy/file_contexts
/dev/dri u:object_r:gpu_device:s0
/dev/dri/card0  u:object_r:graphics_device:s0
/dev/dri/renderD128  u:object_r:gpu_device:s0

/vendor/lib(64)?/libdrm.so  u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/hw/android\.hardware\.graphics\.mapper@4\.0-impl\.minigbm\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/hw/mapper\.minigbm\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libminigbm_gralloc.so  u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libminigbm_gralloc4_utils.so  u:object_r:same_process_hal_file:s0

# gfxstream (to be better factored (fewer libraries?))
/vendor/lib(64)?/hw/vulkan\.ranchu\.so   u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libEGL_emulation\.so          u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGLESv1_CM_emulation\.so    u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGLESv2_emulation\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libOpenglCodecCommon\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libOpenglSystemCommon\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/lib_renderControl_enc\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGLESv1_enc\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGLESv2_enc\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libvulkan_enc\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libandroidemu\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGoldfishProfiler\.so       u:object_r:same_process_hal_file:s0

# TODO: b/326956485 - remove after migrating away from virgl
# device/google/cuttlefish/shared/virgl/sepolicy/file_contexts
/vendor/lib(64)?/libglapi.so  u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/dri/.*       u:object_r:same_process_hal_file:s0
