sepolicy: isolate power HAL policies into a new subdirectory

This makes power HAL policies opt-in. Primary reason to do this is to
avoid breaking Pixel builds, which have several conflicting policies.

Change-Id: I66197a7145d424984acf31fe07d282d6e5bcdc8b
diff --git a/common/vendor/property.te b/common/vendor/property.te
index 1f3aaad..70e937d 100644
--- a/common/vendor/property.te
+++ b/common/vendor/property.te
@@ -1,5 +1,2 @@
 # FM Radio app
 vendor_public_prop(vendor_fm_radio_app_prop);
-
-# Power HAL
-vendor_public_prop(vendor_power_prop);
diff --git a/common/vendor/property_contexts b/common/vendor/property_contexts
index e727578..826b777 100644
--- a/common/vendor/property_contexts
+++ b/common/vendor/property_contexts
@@ -1,6 +1,3 @@
 # FM Radio app
 ro.vendor.builtin_fm_antenna_support   u:object_r:vendor_fm_radio_app_prop:s0 exact bool
 ro.vendor.fm.use_audio_session         u:object_r:vendor_fm_radio_app_prop:s0 exact bool
-
-# Power HAL
-vendor.powerhal.                   u:object_r:vendor_power_prop:s0
diff --git a/common/vendor/vendor_init.te b/common/vendor/vendor_init.te
index ab5869c..1514e94 100644
--- a/common/vendor/vendor_init.te
+++ b/common/vendor/vendor_init.te
@@ -1,8 +1,5 @@
 # FM Radio app properties
 set_prop(vendor_init, vendor_fm_radio_app_prop);
 
-# To set powerhal init property
-set_prop(vendor_init, vendor_power_prop)
-
 # To write to VM nodes
 allow vendor_init proc_dirty:file w_file_perms;
diff --git a/libperfmgr/sepolicy.mk b/libperfmgr/sepolicy.mk
new file mode 100644
index 0000000..46a7497
--- /dev/null
+++ b/libperfmgr/sepolicy.mk
@@ -0,0 +1,2 @@
+BOARD_VENDOR_SEPOLICY_DIRS += \
+    device/lineage/sepolicy/libperfmgr/vendor
diff --git a/common/vendor/hal_power_default.te b/libperfmgr/vendor/hal_power_default.te
similarity index 100%
rename from common/vendor/hal_power_default.te
rename to libperfmgr/vendor/hal_power_default.te
diff --git a/libperfmgr/vendor/property.te b/libperfmgr/vendor/property.te
new file mode 100644
index 0000000..df317c6
--- /dev/null
+++ b/libperfmgr/vendor/property.te
@@ -0,0 +1,2 @@
+# Power HAL
+vendor_public_prop(vendor_power_prop);
diff --git a/libperfmgr/vendor/property_contexts b/libperfmgr/vendor/property_contexts
new file mode 100644
index 0000000..e37ced2
--- /dev/null
+++ b/libperfmgr/vendor/property_contexts
@@ -0,0 +1,2 @@
+# Power HAL
+vendor.powerhal.                   u:object_r:vendor_power_prop:s0
diff --git a/libperfmgr/vendor/vendor_init.te b/libperfmgr/vendor/vendor_init.te
new file mode 100644
index 0000000..f48eff3
--- /dev/null
+++ b/libperfmgr/vendor/vendor_init.te
@@ -0,0 +1,2 @@
+# To set powerhal init property
+set_prop(vendor_init, vendor_power_prop)