sepolicy: Add hal_lineage_fod domain

Change-Id: I067ead0c2f60493a974bc220b67d7039acea4823
diff --git a/common/dynamic/hal_lineage_fod.te b/common/dynamic/hal_lineage_fod.te
new file mode 100644
index 0000000..7872599
--- /dev/null
+++ b/common/dynamic/hal_lineage_fod.te
@@ -0,0 +1,8 @@
+# HwBinder IPC from client to server
+binder_call(hal_lineage_fod_client, hal_lineage_fod_server)
+
+add_hwservice(hal_lineage_fod_server, hal_lineage_fod_hwservice)
+allow hal_lineage_fod_client hal_lineage_fod_hwservice:hwservice_manager find;
+
+# Allow binder communication with platform_app
+binder_call(hal_lineage_fod, platform_app)
diff --git a/common/dynamic/hwservice.te b/common/dynamic/hwservice.te
index 5f70c67..dbf5478 100644
--- a/common/dynamic/hwservice.te
+++ b/common/dynamic/hwservice.te
@@ -1,4 +1,5 @@
 type hal_lineage_camera_motor_hwservice, hwservice_manager_type;
+type hal_lineage_fod_hwservice, hwservice_manager_type;
 type hal_lineage_livedisplay_hwservice, hwservice_manager_type;
 type hal_lineage_touch_hwservice, hwservice_manager_type;
 type hal_lineage_trust_hwservice, hwservice_manager_type;
diff --git a/common/dynamic/hwservice_contexts b/common/dynamic/hwservice_contexts
index ecdc880..36df92e 100644
--- a/common/dynamic/hwservice_contexts
+++ b/common/dynamic/hwservice_contexts
@@ -1,16 +1,17 @@
-vendor.lineage.camera.motor::ICameraMotor            u:object_r:hal_lineage_camera_motor_hwservice:s0
-vendor.lineage.livedisplay::IAdaptiveBacklight       u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IAutoContrast            u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IColorBalance            u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IColorEnhancement        u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IDisplayColorCalibration u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IDisplayModes            u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IPictureAdjustment       u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::IReadingEnhancement      u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.livedisplay::ISunlightEnhancement     u:object_r:hal_lineage_livedisplay_hwservice:s0
-vendor.lineage.power::ILineagePower                  u:object_r:hal_power_hwservice:s0
-vendor.lineage.touch::IGloveMode                     u:object_r:hal_lineage_touch_hwservice:s0
-vendor.lineage.touch::IKeyDisabler                   u:object_r:hal_lineage_touch_hwservice:s0
-vendor.lineage.touch::IStylusMode                    u:object_r:hal_lineage_touch_hwservice:s0
-vendor.lineage.touch::ITouchscreenGesture            u:object_r:hal_lineage_touch_hwservice:s0
-vendor.lineage.trust::IUsbRestrict                   u:object_r:hal_lineage_trust_hwservice:s0
+vendor.lineage.biometrics.fingerprint.inscreen::IFingerprintInscreen    u:object_r:hal_lineage_fod_hwservice:s0
+vendor.lineage.camera.motor::ICameraMotor                               u:object_r:hal_lineage_camera_motor_hwservice:s0
+vendor.lineage.livedisplay::IAdaptiveBacklight                          u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IAutoContrast                               u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IColorBalance                               u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IColorEnhancement                           u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IDisplayColorCalibration                    u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IDisplayModes                               u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IPictureAdjustment                          u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::IReadingEnhancement                         u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.livedisplay::ISunlightEnhancement                        u:object_r:hal_lineage_livedisplay_hwservice:s0
+vendor.lineage.power::ILineagePower                                     u:object_r:hal_power_hwservice:s0
+vendor.lineage.touch::IGloveMode                                        u:object_r:hal_lineage_touch_hwservice:s0
+vendor.lineage.touch::IKeyDisabler                                      u:object_r:hal_lineage_touch_hwservice:s0
+vendor.lineage.touch::IStylusMode                                       u:object_r:hal_lineage_touch_hwservice:s0
+vendor.lineage.touch::ITouchscreenGesture                               u:object_r:hal_lineage_touch_hwservice:s0
+vendor.lineage.trust::IUsbRestrict                                      u:object_r:hal_lineage_trust_hwservice:s0
diff --git a/common/private/platform_app.te b/common/private/platform_app.te
index cd3d97e..8156095 100644
--- a/common/private/platform_app.te
+++ b/common/private/platform_app.te
@@ -1,5 +1,8 @@
 # Allow NFC service to be found
 allow platform_app nfc_service:service_manager find;
 
+# Allow FOD HAL service to be found
+hal_client_domain(platform_app, hal_lineage_fod)
+
 # Allow LiveDisplay HAL service to be found
 hal_client_domain(platform_app, hal_lineage_livedisplay)
diff --git a/common/private/system_server.te b/common/private/system_server.te
index 8284a82..db788a3 100644
--- a/common/private/system_server.te
+++ b/common/private/system_server.te
@@ -1,6 +1,7 @@
 allow system_server storage_stub_file:dir getattr;
 
 # Use HALs
+hal_client_domain(system_server, hal_lineage_fod)
 hal_client_domain(system_server, hal_lineage_livedisplay)
 hal_client_domain(system_server, hal_lineage_touch)
 hal_client_domain(system_server, hal_lineage_trust)
diff --git a/common/public/attributes b/common/public/attributes
index a1d990d..6bc04a0 100644
--- a/common/public/attributes
+++ b/common/public/attributes
@@ -1,5 +1,6 @@
 # HALs
 hal_attribute(lineage_camera_motor)
+hal_attribute(lineage_fod)
 hal_attribute(lineage_livedisplay)
 hal_attribute(lineage_touch)
 hal_attribute(lineage_trust)
diff --git a/common/vendor/hal_lineage_fod_default.te b/common/vendor/hal_lineage_fod_default.te
new file mode 100644
index 0000000..732d002
--- /dev/null
+++ b/common/vendor/hal_lineage_fod_default.te
@@ -0,0 +1,5 @@
+type hal_lineage_fod_default, domain;
+hal_server_domain(hal_lineage_fod_default, hal_lineage_fod)
+
+type hal_lineage_fod_default_exec, exec_type, vendor_file_type, file_type;
+init_daemon_domain(hal_lineage_fod_default)