From d7c88ddf5adc109d61441d281e5387297f25624a Mon Sep 17 00:00:00 2001
From: Mikhail Naganov <mnaganov@google.com>
Date: Thu, 9 Mar 2017 14:32:16 -0800
Subject: [PATCH] hal_audio: Allow writing dump info into pipes

The following HAL methods use file descriptors to write dump
info comprising audioflinger debug dump:

IDevice.debugDump
IEffectsFactory.debugDump
IStream.debugDump

Bug: 36074936
Test: check contents of 'adb shell dumpsys media.audio_flinger'
      on -userdebug builds

Change-Id: Ie2bec95c6b73c6f10941e2b0a95a25d6a7a6e4c1
---
 public/hal_audio.te | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/public/hal_audio.te b/public/hal_audio.te
index 1d27c81be..f62056294 100644
--- a/public/hal_audio.te
+++ b/public/hal_audio.te
@@ -20,6 +20,10 @@ r_dir_file(hal_audio, proc)
 allow hal_audio audio_device:dir r_dir_perms;
 allow hal_audio audio_device:chr_file rw_file_perms;
 
+# Needed to provide debug dump output via dumpsys' pipes.
+allow hal_audio shell:fd use;
+allow hal_audio shell:fifo_file write;
+
 # Needed on some devices for playing audio on paired BT device,
 # but seems appropriate for all devices.
 unix_socket_connect(hal_audio, bluetooth, bluetooth)
-- 
GitLab