aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-28 01:07:30 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-28 01:07:30 +0000
commit0aa9c3125e9956658e08ccfb593d1d5a91dd35b8 (patch)
tree6b7d8ccadb67598fce931444ee5ee444be511b05
parentfcd729c4f98c3adebb31a133635e3cfef95cb9eb (diff)
parent6df49ca5905edfe4f44df864835d8c0855127c61 (diff)
downloadgs-common-0aa9c3125e9956658e08ccfb593d1d5a91dd35b8.tar.gz
Snap for 9830776 from 6df49ca5905edfe4f44df864835d8c0855127c61 to udc-release
Change-Id: Ieef79e2cfb70046c5d0131b9fabef21fe595fede
-rw-r--r--edgetpu/sepolicy/edgetpu_dba_service.te4
-rw-r--r--gear/dumpstate/Dumpstate.cpp7
-rw-r--r--gear/dumpstate/sepolicy/hal_dumpstate_default.te1
-rw-r--r--gear/dumpstate/sepolicy/property.te3
-rw-r--r--gear/dumpstate/sepolicy/property_contexts2
5 files changed, 15 insertions, 2 deletions
diff --git a/edgetpu/sepolicy/edgetpu_dba_service.te b/edgetpu/sepolicy/edgetpu_dba_service.te
index ce1f200..3717e20 100644
--- a/edgetpu/sepolicy/edgetpu_dba_service.te
+++ b/edgetpu/sepolicy/edgetpu_dba_service.te
@@ -12,6 +12,10 @@ binder_service(edgetpu_dba_server);
# EdgeTPU DBA service to register the service to service_manager.
add_service(edgetpu_dba_server, edgetpu_dba_service);
+# Allow EdgeTPU DBA service to access the edgetpu_app_service.
+allow edgetpu_dba_server edgetpu_app_service:service_manager find;
+binder_call(edgetpu_dba_server, edgetpu_app_server);
+
# Allow EdgeTPU DBA service to look for TPU instance in /dev/edgetpu or /dev/edgetpu-soc.
allow edgetpu_dba_server edgetpu_device:chr_file rw_file_perms;
diff --git a/gear/dumpstate/Dumpstate.cpp b/gear/dumpstate/Dumpstate.cpp
index 1e4d982..842e67d 100644
--- a/gear/dumpstate/Dumpstate.cpp
+++ b/gear/dumpstate/Dumpstate.cpp
@@ -154,8 +154,10 @@ ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFile
int64_t in_timeoutMillis) {
// Unused arguments.
(void) in_timeoutMillis;
- (void) in_mode;
-
+ if (in_mode < IDumpstateDevice::DumpstateMode::FULL || in_mode > IDumpstateDevice::DumpstateMode::PROTO) {
+ ALOGE("Invalid mode: %d\n", in_mode);
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "Invalid mode");
+ }
if (in_fds.size() < 1) {
ALOGE("no FDs\n");
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
@@ -171,6 +173,7 @@ ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFile
if (in_fds.size() < 2) {
ALOGE("no FD for dumpstate_board binary\n");
+ dumpTextSection(fd, "");
} else {
int fd_bin = in_fds[1].get();
dumpLogSection(fd, fd_bin);
diff --git a/gear/dumpstate/sepolicy/hal_dumpstate_default.te b/gear/dumpstate/sepolicy/hal_dumpstate_default.te
index 3e4db45..96ff573 100644
--- a/gear/dumpstate/sepolicy/hal_dumpstate_default.te
+++ b/gear/dumpstate/sepolicy/hal_dumpstate_default.te
@@ -2,4 +2,5 @@ allow hal_dumpstate_default vendor_toolbox_exec:file execute_no_trans;
allow hal_dumpstate_default radio_vendor_data_file:dir create_dir_perms;
allow hal_dumpstate_default radio_vendor_data_file:file create_file_perms;
allow hal_dumpstate_default shell_data_file:file getattr;
+set_prop(hal_dumpstate_default, vendor_logger_prop)
diff --git a/gear/dumpstate/sepolicy/property.te b/gear/dumpstate/sepolicy/property.te
new file mode 100644
index 0000000..c6f5a4f
--- /dev/null
+++ b/gear/dumpstate/sepolicy/property.te
@@ -0,0 +1,3 @@
+# verbose property
+vendor_internal_prop(vendor_logger_prop)
+
diff --git a/gear/dumpstate/sepolicy/property_contexts b/gear/dumpstate/sepolicy/property_contexts
new file mode 100644
index 0000000..e6b1f76
--- /dev/null
+++ b/gear/dumpstate/sepolicy/property_contexts
@@ -0,0 +1,2 @@
+persist.vendor.verbose_logging_enabled u:object_r:vendor_logger_prop:s0
+