Stop hwbinder threads from app_process.
To prevent it from hanging up.
Bug: 37500397
Bug: 34085250
Test: DismissDialogsInstrumentation test
Change-Id: Ia69f6a5676666bc9286272b82f242d7b1d0ee286
diff --git a/cmds/app_process/Android.mk b/cmds/app_process/Android.mk
index eaad3a7..72fe051 100644
--- a/cmds/app_process/Android.mk
+++ b/cmds/app_process/Android.mk
@@ -5,6 +5,7 @@
libbinder \
libcutils \
libdl \
+ libhwbinder \
liblog \
libnativeloader \
libutils \
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 0ea141c..e56417b 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -14,7 +14,7 @@
#include <unistd.h>
#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
+#include <hwbinder/IPCThreadState.h>
#include <utils/Log.h>
#include <cutils/memory.h>
#include <cutils/properties.h>
@@ -85,6 +85,7 @@
ar->callMain(mClassName, mClass, mArgs);
IPCThreadState::self()->stopProcess();
+ hardware::IPCThreadState::self()->stopProcess();
}
virtual void onZygoteInit()
@@ -99,6 +100,7 @@
if (mClassName.isEmpty()) {
// if zygote
IPCThreadState::self()->stopProcess();
+ hardware::IPCThreadState::self()->stopProcess();
}
AndroidRuntime::onExit(code);