summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayant Chowdhary <jchowdhary@google.com>2023-05-12 13:44:40 -0700
committerJayant Chowdhary <jchowdhary@google.com>2023-05-12 14:41:23 -0700
commit4f9166b813b777f1810b9e651b6604bf9c616198 (patch)
tree56c799cbc1d442c9bd01117fd0daaee74f73ef9e
parent9dfdbfd7827825c24d0fa001ed3052ce9a1ce7ed (diff)
downloadcamera-4f9166b813b777f1810b9e651b6604bf9c616198.tar.gz
Make the contents of /proc/<hal-pid>/comm a predictable string.
libbinder sets the main binder threads name to something like (vnd)binder:tid_y (https://android-review.git.corp.google.com/c/platform/frameworks/native/+/2000050) procfs shows the name in /proc/<pid>/task<main-thread>/comm in /proc/<pid>/comm as well. So set the main threads name to something predictable. Bug: 227257453 Test: cat /proc/<camera-hal-pid/comm> Change-Id: Iad2c8810c78c2e9a012dd0d6f5d38d38939961dd Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
-rw-r--r--common/hal/aidl_service/aidl_service.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/hal/aidl_service/aidl_service.cc b/common/hal/aidl_service/aidl_service.cc
index 91f52b1..a98753a 100644
--- a/common/hal/aidl_service/aidl_service.cc
+++ b/common/hal/aidl_service/aidl_service.cc
@@ -28,6 +28,7 @@
#include <cutils/properties.h>
#include <hidl/HidlTransportSupport.h>
#include <malloc.h>
+#include <utils/AndroidThreads.h>
#include <utils/Errors.h>
#include <cinttypes>
@@ -101,6 +102,7 @@ int main() {
return android::NO_INIT;
}
}
+ androidSetThreadName("google.camera.provider");
ABinderProcess_joinThreadPool();
// In normal operation, the threadpool should never return.