zenfone8: add UDFPS extension

Mark pressed fingerprint layer.

Change-Id: I49891f89350839ff93ff1a762a83996bfd56ec18
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 1d77674..0e47288 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -55,6 +55,9 @@
 # Bluetooth
 BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth
 
+# Biometrics
+TARGET_SURFACEFLINGER_UDFPS_LIB := //$(DEVICE_PATH):libudfps_extension.sake
+
 # Bootloader
 TARGET_BOOTLOADER_BOARD_NAME := lahaina
 TARGET_NO_BOOTLOADER := true
diff --git a/fingerprint/Android.bp b/fingerprint/Android.bp
index dfe623e..9293943 100644
--- a/fingerprint/Android.bp
+++ b/fingerprint/Android.bp
@@ -24,3 +24,14 @@
     ],
 
 }
+
+cc_library_static {
+    name: "libudfps_extension.sake",
+    srcs: ["UdfpsExtension.cpp"],
+    include_dirs: [
+        "frameworks/native/services/surfaceflinger/CompositionEngine/include"
+    ],
+    header_libs: [
+        "generated_kernel_headers",
+    ],
+}
diff --git a/fingerprint/UdfpsExtension.cpp b/fingerprint/UdfpsExtension.cpp
new file mode 100644
index 0000000..f51a9e3
--- /dev/null
+++ b/fingerprint/UdfpsExtension.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2022 The LineageOS Project
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include <compositionengine/UdfpsExtension.h>
+#include <display/drm/sde_drm.h>
+
+uint32_t getUdfpsZOrder(uint32_t z, bool touched) {
+    if (touched) {
+        z |= FOD_PRESSED_LAYER_ZORDER;
+    }
+    return z;
+}
+
+uint64_t getUdfpsUsageBits(uint64_t usageBits, bool) {
+    return usageBits;
+}