From ff0f79c195f71a822a97abe8ee4e5995477244b5 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 27 Nov 2018 15:21:43 -0800 Subject: [PATCH] [gpuservice] allow "adb shell cmd gpu vkjson" Also allow adb shell dumpsys gpu to not return error. Bug: 120095213 Test: flash non-eng build and adb shell cmd gpu vkjson Change-Id: Ia4a50a475ce76ec35e082dd52d4a6c80dde7f571 --- private/gpuservice.te | 3 +++ private/shell.te | 3 +++ 2 files changed, 6 insertions(+) diff --git a/private/gpuservice.te b/private/gpuservice.te index 6cbd89c28..5e8aab5f3 100644 --- a/private/gpuservice.te +++ b/private/gpuservice.te @@ -22,6 +22,9 @@ hwbinder_use(gpuservice) allow gpuservice graphics_device:dir search; allow gpuservice graphics_device:chr_file rw_file_perms; +# Needed for dumpsys pipes. +allow gpuservice shell:fifo_file write; + # Use socket supplied by adbd, for cmd gpu vkjson etc. allow gpuservice adbd:unix_stream_socket { read write getattr }; diff --git a/private/shell.te b/private/shell.te index ee5b73cac..885714dc4 100644 --- a/private/shell.te +++ b/private/shell.te @@ -55,6 +55,9 @@ allow shell perfetto_traces_data_file:file r_file_perms; # Allow shell-based "dumpsys" to call into bufferhubd. binder_call(shell, bufferhubd); +# Allow shell to run adb shell cmd gpu commands. +binder_call(shell, gpuservice); + # Allow shell to use atrace HAL hal_client_domain(shell, hal_atrace)