diff options
author | Badhri Jagan Sridharan <badhri@google.com> | 2018-10-17 18:26:37 -0700 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-11-19 00:28:33 +0000 |
commit | bae664d283ff3068768e6ef790d17c78778ab4d8 (patch) | |
tree | 8251cf809095926f853fe89a8818a16f57a723a4 | |
parent | d59140fa0fa7ea098d0dd2e81726cab9d28dcc67 (diff) | |
download | core-bae664d283ff3068768e6ef790d17c78778ab4d8.tar.gz |
usbd: Do not join the thread pool
Work around for the following crash:
02-08 05:34:20.968 root 990 990 F DEBUG : #00 pc 000000000001447c /system/lib64/libhwbinder.so (android::hardware::IPCThreadState::joinThreadPool(bool)+28)
02-08 05:34:20.968 root 990 990 F DEBUG : #01 pc 000000000001c174 /system/lib64/libhwbinder.so (android::hardware::PoolThread::threadLoop()+24)
02-08 05:34:20.968 root 990 990 F DEBUG : #02 pc 000000000000f934 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
02-08 05:34:20.968 root 990 990 F DEBUG : #03 pc 00000000000821e0 /system/lib64/libc.so (__pthread_start(void*)+36)
02-08 05:34:20.968 root 990 990 F DEBUG : #04 pc 0000000000023178 /system/lib64/libc.so (__start_thread+68)
Bug: 117470462
Change-Id: I1e8f28a7d0f3041d9be8138a3dc9ed9c74419f91
(cherry picked from commit f123d45ce15601f446eaac487431cd59e2cdccf5)
-rw-r--r-- | usbd/usbd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usbd/usbd.cpp b/usbd/usbd.cpp index 41cd8dd9b..191fb92fb 100644 --- a/usbd/usbd.cpp +++ b/usbd/usbd.cpp @@ -22,15 +22,20 @@ #include <android-base/properties.h> #include <android/hardware/usb/gadget/1.0/IUsbGadget.h> +#include <hidl/HidlTransportSupport.h> + #define PERSISTENT_USB_CONFIG "persist.sys.usb.config" using android::base::GetProperty; using android::base::SetProperty; +using android::hardware::configureRpcThreadpool; using android::hardware::usb::gadget::V1_0::GadgetFunction; using android::hardware::usb::gadget::V1_0::IUsbGadget; using android::hardware::Return; int main(int /*argc*/, char** /*argv*/) { + configureRpcThreadpool(1, true /*callerWillJoin*/); + android::sp<IUsbGadget> gadget = IUsbGadget::getService(); Return<void> ret; |