surfaceflinger: move some libs from shared to static
These libraries are only used by this process on a device and gain no
benifit from being included as shared libraries.
Moving them to static saves disk space, memory, and cpu cycles from the
dynamic linker.
With 3 reboots before and after I'm seeing average savings of 398885 bytes of storage space from installed files, 60KB private dirty memory, 403KB PSS from libraries/binary only, and 780KB PSS from everything in showmap.
go/shared-to-static for more info on how this was determined.
Test: m
Bug: 280829178
Change-Id: Iafe01db89d55fe579b7c97832b0ed45298a424c4
diff --git a/services/displayservice/Android.bp b/services/displayservice/Android.bp
index 8681784..c88f2fc 100644
--- a/services/displayservice/Android.bp
+++ b/services/displayservice/Android.bp
@@ -23,7 +23,7 @@
default_applicable_licenses: ["frameworks_native_license"],
}
-cc_library_shared {
+cc_library_static {
name: "libdisplayservicehidl",
srcs: [
@@ -37,18 +37,24 @@
"libgui",
"libhidlbase",
"libutils",
+ ],
+
+ static_libs: [
"android.frameworks.displayservice@1.0",
],
export_include_dirs: ["include"],
export_shared_lib_headers: [
- "android.frameworks.displayservice@1.0",
"libgui",
"libutils",
],
+ export_static_lib_headers: [
+ "android.frameworks.displayservice@1.0",
+ ],
+
cflags: [
"-Werror",
"-Wall",
- ]
+ ],
}