diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 45aec6e..b3c0334 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -69,6 +69,7 @@ TARGET_FS_CONFIG_GEN := $(COMMON_PATH)/config.fs ifeq ($(TARGET_HAS_FOD),true) SOONG_CONFIG_NAMESPACES += XIAOMI_KONA_FOD SOONG_CONFIG_XIAOMI_KONA_FOD := POS_X POS_Y SIZE +TARGET_SURFACEFLINGER_FOD_LIB := //$(COMMON_PATH):libfod_extension.xiaomi_kona endif # HIDL diff --git a/fod/Android.bp b/fod/Android.bp index ffaffd0..a602baa 100644 --- a/fod/Android.bp +++ b/fod/Android.bp @@ -52,3 +52,11 @@ cc_binary { ], vendor: true, } + +cc_library_static { + name: "libfod_extension.xiaomi_kona", + srcs: ["FodExtension.cpp"], + include_dirs: [ + "frameworks/native/services/surfaceflinger/CompositionEngine/include" + ], +} diff --git a/fod/FodExtension.cpp b/fod/FodExtension.cpp new file mode 100644 index 0000000..a9dfd38 --- /dev/null +++ b/fod/FodExtension.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2021 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +uint32_t getFodZOrder(uint32_t z, bool touched) { + if (touched) { + z |= 0x9000000; + } + return z; +} + +uint64_t getFodUsageBits(uint64_t usageBits, bool) { + return usageBits; +}