Remove mediacodec from binder violators.

The new binder_call() lines had to be added
because this change removes mediacodec from
binderservicedomain (on full-treble), hence
domains that could previously reach mediacodec
with binder_call(domain, binderservicedomain)
now need explicit calls instead.

Test: Youtube, Netflix, Maps, Chrome, Music
Change-Id: I3325ce20d9304bc07659fd435554cbcbacbc9829
diff --git a/private/app.te b/private/app.te
index d6dc48c..2fddb44 100644
--- a/private/app.te
+++ b/private/app.te
@@ -273,6 +273,9 @@
 # Allow app to access the graphic allocator HAL
 binder_call({ appdomain -isolated_app }, hal_graphics_allocator)
 
+# Allow app access to mediacodec (IOMX HAL)
+binder_call({ appdomain -isolated_app }, mediacodec)
+
 # App can access configstore HAL which is read only
 binder_call({ appdomain -isolated_app }, hal_configstore)
 
diff --git a/private/system_server.te b/private/system_server.te
index e200bef..0f0dcdc 100644
--- a/private/system_server.te
+++ b/private/system_server.te
@@ -199,6 +199,8 @@
 
 hal_client_domain(system_server, hal_wifi_supplicant)
 
+binder_call(system_server, mediacodec)
+
 # Talk with graphics composer fences
 allow system_server hal_graphics_composer:fd use;
 
diff --git a/public/mediacodec.te b/public/mediacodec.te
index e4801b6..3445c7a 100644
--- a/public/mediacodec.te
+++ b/public/mediacodec.te
@@ -15,19 +15,17 @@
 not_full_treble(`
     # on legacy devices, continue to allow /dev/binder traffic
     binder_use(mediacodec)
+    binder_service(mediacodec)
+    add_service(mediacodec, mediacodec_service)
+    allow mediacodec mediametrics_service:service_manager find;
+    allow mediacodec surfaceflinger_service:service_manager find;
 ')
 binder_call(mediacodec, binderservicedomain)
 binder_call(mediacodec, appdomain)
-binder_service(mediacodec)
 
 # Allow mediacodec access to composer sync fences
 allow mediacodec hal_graphics_composer:fd use;
 
-# TODO(b/36604251): Remove this once OMX HAL stops using Binder
-typeattribute mediacodec binder_in_vendor_violators;
-add_service(mediacodec, mediacodec_service)
-allow mediacodec mediametrics_service:service_manager find;
-allow mediacodec surfaceflinger_service:service_manager find;
 allow mediacodec gpu_device:chr_file rw_file_perms;
 allow mediacodec video_device:chr_file rw_file_perms;
 allow mediacodec video_device:dir search;
diff --git a/public/mediaserver.te b/public/mediaserver.te
index 01cc4d8..8c9ef31 100644
--- a/public/mediaserver.te
+++ b/public/mediaserver.te
@@ -132,6 +132,8 @@
 
 hal_client_domain(mediaserver, hal_allocator)
 
+binder_call(mediaserver, mediacodec)
+
 ###
 ### neverallow rules
 ###