Make libstatssocket shared
Also make private versions of the libraries available to link statically
for tests. We should try to figure out a better long term solution.
Test: m
Test: bit statsd_test:*
Test: atest LibStatsPullTests
Test: bit libstatssocket_test:*
Test: atest GtsStatsdHostTestCases
Bug: 149340100
Change-Id: I05b91efab2a657aec75d436575aff4373f86ed3f
diff --git a/apex/statsd/aidl/Android.bp b/apex/statsd/aidl/Android.bp
index 487c8e1..404c632 100644
--- a/apex/statsd/aidl/Android.bp
+++ b/apex/statsd/aidl/Android.bp
@@ -31,7 +31,7 @@
],
backend: {
java: {
- enabled: false, // the platform uses statsd_java_aidl
+ enabled: false, // framework-statsd and service-statsd use framework-statsd-aidl-sources
},
cpp: {
enabled: false,
diff --git a/apex/statsd/tests/libstatspull/Android.bp b/apex/statsd/tests/libstatspull/Android.bp
index e813964..2d64f19 100644
--- a/apex/statsd/tests/libstatspull/Android.bp
+++ b/apex/statsd/tests/libstatspull/Android.bp
@@ -48,9 +48,13 @@
"-Werror",
],
shared_libs: [
- "libbinder",
- "libutils",
- "libstatspull",
- "libstatssocket",
+ "libbinder_ndk",
+ "statsd-aidl-ndk_platform",
],
-}
\ No newline at end of file
+ static_libs: [
+ "libstatspull_private",
+ "libstatssocket_private",
+ "libutils",
+ "libcutils",
+ ],
+}
diff --git a/apex/statsd/tests/libstatspull/jni/stats_pull_helper.cpp b/apex/statsd/tests/libstatspull/jni/stats_pull_helper.cpp
index 22daa8e..eb97f65 100644
--- a/apex/statsd/tests/libstatspull/jni/stats_pull_helper.cpp
+++ b/apex/statsd/tests/libstatspull/jni/stats_pull_helper.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include <binder/ProcessState.h>
+#include <android/binder_process.h>
#include <jni.h>
#include <log/log.h>
#include <stats_event.h>
@@ -24,7 +24,6 @@
#include <thread>
using std::this_thread::sleep_for;
-using namespace android;
namespace {
static int32_t sAtomTag;
@@ -39,10 +38,8 @@
if (!initialized) {
initialized = true;
// Set up the binder
- sp<ProcessState> ps(ProcessState::self());
- ps->setThreadPoolMaxThreadCount(9);
- ps->startThreadPool();
- ps->giveThreadPoolName();
+ ABinderProcess_setThreadPoolMaxThreadCount(9);
+ ABinderProcess_startThreadPool();
}
}