angler: switch to using fingerprint HIDL interface

Test: enroll, unlock, navigation. Boot with no errors related to fingerprint

Bug: 33199080
Change-Id: Ie07a26c648d991232d94b43498592db8dc17d275
diff --git a/device.mk b/device.mk
index 3c350ad..0dc290c 100644
--- a/device.mk
+++ b/device.mk
@@ -95,10 +95,10 @@
 PRODUCT_PACKAGES += \
     AnglerLayout
 
-# include fingerprintd
+# Fingerprint Sensor
 PRODUCT_PACKAGES += \
-    fingerprintd \
-    android.hardware.biometrics.fingerprint@2.1-impl
+    fingerprint.angler \
+    android.hardware.biometrics.fingerprint@2.1-service
 
 # Delegation for OEM customization
 PRODUCT_OEM_PROPERTIES := \
diff --git a/init.angler.rc b/init.angler.rc
index ff80591..00f7de7 100755
--- a/init.angler.rc
+++ b/init.angler.rc
@@ -406,12 +406,6 @@
     group camera system inet input graphics
     writepid /dev/cpuset/camera-daemon/tasks
 
-service fingerprintd /system/bin/fingerprintd
-    class late_start
-    user system
-    group input
-    writepid /dev/cpuset/system-background/tasks
-
 service wpa_supplicant /system/bin/wpa_supplicant \
         -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
         -I/system/etc/wifi/p2p_supplicant_overlay.conf \
diff --git a/sepolicy/hal_fingerprint.te b/sepolicy/hal_fingerprint.te
new file mode 100644
index 0000000..fe6409e
--- /dev/null
+++ b/sepolicy/hal_fingerprint.te
@@ -0,0 +1,18 @@
+# Access to /dev/tee
+allow hal_fingerprint tee_device:chr_file rw_file_perms;
+
+# Read /dev/input
+allow hal_fingerprint input_device:dir r_dir_perms;
+allow hal_fingerprint input_device:chr_file r_file_perms;
+
+# for SW20.6 navigation
+allow hal_fingerprint uhid_device:chr_file rw_file_perms;
+allow hal_fingerprint fingerprintd_data_file:sock_file create_file_perms;
+
+# write /sys/bus/spi/devices/spi12.0/spi_prepare
+allow hal_fingerprint sysfs_fingerprintd:file rw_file_perms;
+allow hal_fingerprint sysfs_fingerprintd:dir search;
+allow hal_fingerprint sysfs_fingerprintd:dir r_dir_perms;
+
+# read sysfs (required for fpc driver to read SOC files)
+allow hal_fingerprint sysfs:dir { read open };