From 96bf4b2f0e0aca171e10663a9ab7d396b298ca3f Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Thu, 20 Mar 2025 10:47:39 -0700 Subject: 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 --- libs/hwui/Android.bp | 8 ++++++++ libs/hwui/jni/Bitmap.cpp | 14 ++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'libs') 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 +#ifdef __linux__ +#include +#endif #include #include #include @@ -33,15 +36,6 @@ #endif #include "android_nio_utils.h" -#ifdef __ANDROID__ -#include -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; } -- cgit v1.2.3-59-g8ed1b