diff --git a/apex/statsd/aidl/Android.bp b/apex/statsd/aidl/Android.bp index 487c8e1b216de..404c63232da94 100644 --- a/apex/statsd/aidl/Android.bp +++ b/apex/statsd/aidl/Android.bp @@ -31,7 +31,7 @@ aidl_interface { ], 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 e81396405d313..2d64f190839c5 100644 --- a/apex/statsd/tests/libstatspull/Android.bp +++ b/apex/statsd/tests/libstatspull/Android.bp @@ -48,9 +48,13 @@ cc_library_shared { "-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 22daa8eb6b3e4..eb97f6559b6d1 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 +#include #include #include #include @@ -24,7 +24,6 @@ #include using std::this_thread::sleep_for; -using namespace android; namespace { static int32_t sAtomTag; @@ -39,10 +38,8 @@ static void init() { if (!initialized) { initialized = true; // Set up the binder - sp ps(ProcessState::self()); - ps->setThreadPoolMaxThreadCount(9); - ps->startThreadPool(); - ps->giveThreadPoolName(); + ABinderProcess_setThreadPoolMaxThreadCount(9); + ABinderProcess_startThreadPool(); } } diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp index 73a8f666b78eb..0c3a49a9d340f 100644 --- a/cmds/statsd/Android.bp +++ b/cmds/statsd/Android.bp @@ -302,11 +302,7 @@ cc_test { static_libs: [ "libgmock", "libplatformprotos", - - // TODO(b/149842105): Make libstatssocket shared and remove libcutils once statsd_test is - // moved to the apex. - "libstatssocket", - "libcutils", + "libstatssocket_private", ], proto: { diff --git a/tools/stats_log_api_gen/Android.bp b/tools/stats_log_api_gen/Android.bp index d5031d7d46283..843e82023afe9 100644 --- a/tools/stats_log_api_gen/Android.bp +++ b/tools/stats_log_api_gen/Android.bp @@ -121,7 +121,6 @@ cc_library { shared_libs: [ "liblog", "libcutils", - "libstatssocket", ], apex_available: [ "//apex_available:platform", @@ -129,5 +128,13 @@ cc_library { "com.android.os.statsd", "test_com.android.os.statsd", ], + target: { + android: { + shared_libs: ["libstatssocket"], + }, + host: { + static_libs: ["libstatssocket"], + }, + }, }