diff options
author | 2025-03-20 10:47:39 -0700 | |
---|---|---|
committer | 2025-03-21 09:36:14 -0700 | |
commit | 96bf4b2f0e0aca171e10663a9ab7d396b298ca3f (patch) | |
tree | 21f8e06f3f739e216d5c411a356554daa52ead0b /libs | |
parent | fa3aaa18b696d08dd4c7d5a8faf40d780b211532 (diff) |
Make Bitmap.cpp use aconfig flags on host side too
Fix: 403462359
Test: atest CtsGraphicsTestCasesRavenwood:android.graphics.cts.BitmapTest
(and treehugger)
Flag: EXEMPT host side change only
Change-Id: I0d229a1edbd302ec770c62ccce9c298ba99acbea
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/Android.bp | 8 | ||||
-rw-r--r-- | libs/hwui/jni/Bitmap.cpp | 14 |
2 files changed, 12 insertions, 10 deletions
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp index ab1be7e6128d..1bde5ff43aa8 100644 --- a/libs/hwui/Android.bp +++ b/libs/hwui/Android.bp @@ -168,6 +168,14 @@ cc_defaults { "libutils", ], }, + host_linux: { + shared_libs: [ + "libaconfig_storage_read_api_cc", + ], + whole_static_libs: [ + "hwui_flags_cc_lib", + ], + }, }, } diff --git a/libs/hwui/jni/Bitmap.cpp b/libs/hwui/jni/Bitmap.cpp index b6a2ad7064a9..1a258e022dd0 100644 --- a/libs/hwui/jni/Bitmap.cpp +++ b/libs/hwui/jni/Bitmap.cpp @@ -2,6 +2,9 @@ #include "Bitmap.h" #include <android-base/unique_fd.h> +#ifdef __linux__ +#include <com_android_graphics_hwui_flags.h> +#endif #include <hwui/Bitmap.h> #include <hwui/Paint.h> #include <inttypes.h> @@ -33,15 +36,6 @@ #endif #include "android_nio_utils.h" -#ifdef __ANDROID__ -#include <com_android_graphics_hwui_flags.h> -namespace hwui_flags = com::android::graphics::hwui::flags; -#else -namespace hwui_flags { -constexpr bool bitmap_parcel_ashmem_as_immutable() { return false; } -} -#endif - #define DEBUG_PARCEL 0 static jclass gBitmap_class; @@ -861,7 +855,7 @@ static bool shouldParcelAsMutable(SkBitmap& bitmap, AParcel* parcel) { return false; } - if (!hwui_flags::bitmap_parcel_ashmem_as_immutable()) { + if (!com::android::graphics::hwui::flags::bitmap_parcel_ashmem_as_immutable()) { return true; } |