From 5fd362679576a3fb450413763a808fd55def4fc6 Mon Sep 17 00:00:00 2001
From: Steven Moreland <smoreland@google.com>
Date: Fri, 20 Jan 2017 15:19:32 -0800
Subject: [PATCH] shell: hwbinder_use

In order to dump hardware services using dumpsys, dumpsys needs to be
able to talk to the hwservicemanager.

Bug: 33382892
Test: dumpsys --hw works from unrooted shell
Change-Id: I31f0982193991428da465507f93d50646cb38726
---
 public/shell.te | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/public/shell.te b/public/shell.te
index 5f7af0b48..d643b7e7a 100644
--- a/public/shell.te
+++ b/public/shell.te
@@ -83,6 +83,10 @@ allow shell servicemanager:service_manager list;
 allow shell { service_manager_type -gatekeeper_service -netd_service -installd_service}:service_manager find;
 allow shell dumpstate:binder call;
 
+# allow shell to get information from hwservicemanager
+# for instance, listing hardware services with dumpsys
+hwbinder_use(shell)
+
 # allow shell to look through /proc/ for ps, top, netstat
 r_dir_file(shell, proc)
 r_dir_file(shell, proc_net)
-- 
GitLab