Mark all clients of Allocator HAL

This change associates all domains which are clients of Allocator HAL
with hal_allocator_client and the, required for all HAL client
domains, halclientdomain.

This enables this commit to remove the now unnecessary hwallocator_use
macro because its binder_call(..., hal_allocator_server) is covered by
binder_call(hal_allocator_client, hal_allocator_server) added in this
commit.

Unfortunately apps, except isolated app, are clients of Allocator HAL
as well. This makes it hard to use the hal_client_domain(...,
hal_allocator) macro because it translates into "typeattribute" which
currently does not support being provided with a set of types, such as
{ appdomain -isolated_app }. As a workaround, hopefully until
typeattribute is improved, this commit expresses the necessary
association operation in CIL. private/technical_debt.cil introduced by
this commit is appended into the platform policy CIL file, thus
ensuring that the hack has effect on the final monolithic policy.

P. S. This change also removes Allocator HAL access from isolated_app.
Isolated app shouldn't have access to this HAL anyway.

Test: Google Play Music plays back radios
Test: Google Camera records video with sound and that video is then
      successfully played back with sound
Test: YouTube app plays back clips with sound
Test: YouTube in Chrome plays back clips with sound
Bug: 34170079
Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
diff --git a/public/hal_allocator.te b/public/hal_allocator.te
new file mode 100644
index 0000000..b444593
--- /dev/null
+++ b/public/hal_allocator.te
@@ -0,0 +1,2 @@
+# HwBinder IPC from client to server
+binder_call(hal_allocator_client, hal_allocator_server)
diff --git a/public/hal_audio.te b/public/hal_audio.te
index a195c93..3531944 100644
--- a/public/hal_audio.te
+++ b/public/hal_audio.te
@@ -2,14 +2,8 @@
 binder_call(hal_audio_client, hal_audio_server)
 binder_call(hal_audio_server, hal_audio_client)
 
-# Both client and the server need to use hwallocator
-hwallocator_use(hal_audio_client)
-hwallocator_use(hal_audio_server)
-
 allow hal_audio ion_device:chr_file r_file_perms;
 
-allow hal_audio system_file:dir { open read };
-
 userdebug_or_eng(`
   # used for pcm capture for debug.
   allow hal_audio audiohal_data_file:dir create_dir_perms;
diff --git a/public/mediacodec.te b/public/mediacodec.te
index f0e7e9a..469c8ba 100644
--- a/public/mediacodec.te
+++ b/public/mediacodec.te
@@ -25,10 +25,7 @@
 
 crash_dump_fallback(mediacodec)
 
-# hidl access
-hwbinder_use(mediacodec)
-hwallocator_use(mediacodec)
-allow mediacodec system_file:dir { open read };
+hal_client_domain(mediacodec, hal_allocator)
 
 # Recieve gralloc buffer FDs from bufferhubd. Note that mediacodec never
 # directly connects to bufferhubd via PDX. Instead, a VR app acts as a bridge
diff --git a/public/mediaserver.te b/public/mediaserver.te
index 46140b3..93f1548 100644
--- a/public/mediaserver.te
+++ b/public/mediaserver.te
@@ -136,9 +136,7 @@
 
 allow mediaserver system_server:fd use;
 
-# hidl access
-hwbinder_use(mediaserver)
-hwallocator_use(mediaserver)
+hal_client_domain(mediaserver, hal_allocator)
 
 ###
 ### neverallow rules
diff --git a/public/te_macros b/public/te_macros
index 52f2e1b..57a038a 100644
--- a/public/te_macros
+++ b/public/te_macros
@@ -328,14 +328,6 @@
 ')
 
 #####################################
-# hwallocator_use(domain)
-# Allow a domain to use Hidl shared memory
-define(`hwallocator_use', `
-# Call into the allocator hal
-binder_call($1, hal_allocator_server);
-')
-
-#####################################
 # wakelock_use(domain)
 # Allow domain to manage wake locks
 define(`wakelock_use', `