Skip to content

Commit

Permalink
enable virtio-video driver on Android T
Browse files Browse the repository at this point in the history
add sepolicy rule for v4l2-codec2 plugin
Correct the compile error for R_stable
cgroup_bpf must be used in Android R
cgroup_v2 is only for Android S
add 2 rules for mediacodec
Follow Guide to config service

Tracked-On: OAM-104252
Signed-off-by: ji, zhenlong z <[email protected]>
Signed-off-by: Yang, Dong <[email protected]>
Signed-off-by: Shaofeng Tang <[email protected]>
  • Loading branch information
dyang23 authored and Shao-Feng committed Oct 14, 2022
1 parent 1e3ebbc commit c56f00c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions codecs/v4l2-codec2/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/bin/hw/android\.hardware\.media\.c2@1\.0-service-v4l2(.*)? u:object_r:media_c2_v4l2_hal_exec:s0
/dev/video[0-9] u:object_r:video_device:s0
34 changes: 34 additions & 0 deletions codecs/v4l2-codec2/media_c2_v4l2_hal.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
type media_c2_v4l2_hal, domain;

type media_c2_v4l2_hal_exec, exec_type, file_type, vendor_file_type;
init_daemon_domain(media_c2_v4l2_hal)

vndbinder_use(media_c2_v4l2_hal)
hal_client_domain(media_c2_v4l2_hal, hal_codec2)
hal_server_domain(media_c2_v4l2_hal, hal_codec2)

#allow media_c2_v4l2_hal hwservicemanager_prop:file { open read getattr map };
get_prop(media_c2_v4l2_hal, hwservicemanager_prop)

allow media_c2_v4l2_hal hwservicemanager:binder call;
allow media_c2_v4l2_hal tombstoned_crash_socket:sock_file write;
allow media_c2_v4l2_hal hal_codec2_hwservice:hwservice_manager { find add };

allow media_c2_v4l2_hal hidl_base_hwservice:hwservice_manager add;

#allow media_c2_v4l2_hal mediaserver:binder transfer;
#allow mediaserver media_c2_v4l2_hal:binder call;
binder_call(media_c2_v4l2_hal, mediaserver)
binder_call(mediaserver, media_c2_v4l2_hal)

allow media_c2_v4l2_hal cgroup_v2:dir search;
allow media_c2_v4l2_hal video_device:chr_file { open read write ioctl };

allow media_c2_v4l2_hal hal_graphics_mapper_hwservice:hwservice_manager find;
hal_client_domain(media_c2_v4l2_hal, hal_graphics_allocator)

allow media_c2_v4l2_hal hal_graphics_allocator_default_tmpfs:file { read write map };
allow media_c2_v4l2_hal gpu_device:dir search;
allow media_c2_v4l2_hal gpu_device:chr_file { open read write ioctl getattr map};

crash_dump_fallback(media_c2_v4l2_hal)
2 changes: 2 additions & 0 deletions codecs/v4l2-codec2/mediaswcodec.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#============= mediaswcodec ==============
allow mediaswcodec gpu_device:chr_file map;

0 comments on commit c56f00c

Please sign in to comment.