Add lazy loading support to libstatspull. There are a few clients (surfaceflinger, bootanimation dependencies) that run before the statsd apex is mounted and cannot link libstatspull.so when the process starts. Lazy loading will load the library when the apis to set/clear callbacks or create PullAtomMetadata get called. This change is modeled heavily off of aosp/1570701, which added libnativehelper_lazy. Bug: 178480419 Test: atest libstatspull_lazy_test Change-Id: I9956f5a690aec8c7ff9f0834a3f36387e5d8b23f
44 lines
No EOL
1.1 KiB
Text
44 lines
No EOL
1.1 KiB
Text
// Lazy loading version of libstatspull that can be used by code
|
|
// that is running before the statsd APEX is mounted and
|
|
// libstatspull.so is available.
|
|
cc_library_static {
|
|
name: "libstatspull_lazy",
|
|
header_libs: [
|
|
"libstatspull_headers",
|
|
"libstatssocket_headers",
|
|
],
|
|
export_header_lib_headers: [
|
|
"libstatspull_headers",
|
|
],
|
|
apex_available: ["//apex_available:platform"],
|
|
srcs: ["libstatspull_lazy.cpp"],
|
|
}
|
|
|
|
cc_test {
|
|
name: "libstatspull_lazy_test",
|
|
srcs: [
|
|
"tests/libstatspull_lazy_test.cpp",
|
|
],
|
|
static_libs: [
|
|
"libstatspull_lazy",
|
|
"libstatssocket_lazy",
|
|
],
|
|
shared_libs: ["liblog"],
|
|
cflags: [
|
|
"-Wall",
|
|
"-Werror",
|
|
],
|
|
test_suites: ["device-tests", "mts-statsd"],
|
|
test_config: "libstatspull_lazy_test.xml",
|
|
// TODO(b/153588990): Remove when the build system properly separates.
|
|
// 32bit and 64bit architectures.
|
|
compile_multilib: "both",
|
|
multilib: {
|
|
lib64: {
|
|
suffix: "64",
|
|
},
|
|
lib32: {
|
|
suffix: "32",
|
|
},
|
|
},
|
|
} |