Merge "HwInfo: Move hardware info sepolicy to pixel common" am: d579f9a5b8

Original change: https://android-review.googlesource.com/c/platform/hardware/google/pixel-sepolicy/+/2164962

Change-Id: I790d45cb8fd7dfcb90c9e7032cd48880c113f18c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/hardware_info_app/device.te b/hardware_info_app/device.te
new file mode 100644
index 0000000..ceaf547
--- /dev/null
+++ b/hardware_info_app/device.te
@@ -0,0 +1,2 @@
+# Battery history
+type battery_history_device, dev_type;
diff --git a/hardware_info_app/file.te b/hardware_info_app/file.te
new file mode 100644
index 0000000..f891722
--- /dev/null
+++ b/hardware_info_app/file.te
@@ -0,0 +1,12 @@
+# Storage Health HAL
+type sysfs_scsi_devices_0000, sysfs_type, fs_type;
+
+# PixelStats_vendor
+type sysfs_pixelstats, fs_type, sysfs_type;
+
+# Display
+type sysfs_display, sysfs_type, fs_type;
+
+# SoC
+type sysfs_soc, sysfs_type, fs_type;
+type sysfs_chip_id, sysfs_type, fs_type;
diff --git a/hardware_info_app/hardware_info_app.te b/hardware_info_app/hardware_info_app.te
new file mode 100644
index 0000000..751bb88
--- /dev/null
+++ b/hardware_info_app/hardware_info_app.te
@@ -0,0 +1,26 @@
+type hardware_info_app, domain;
+app_domain(hardware_info_app)
+
+allow hardware_info_app app_api_service:service_manager find;
+
+# Storage
+allow hardware_info_app sysfs_scsi_devices_0000:dir search;
+allow hardware_info_app sysfs_scsi_devices_0000:file r_file_perms;
+
+# Audio
+allow hardware_info_app sysfs_pixelstats:file r_file_perms;
+
+# Batteryinfo
+allow hardware_info_app sysfs_batteryinfo:dir search;
+allow hardware_info_app sysfs_batteryinfo:file r_file_perms;
+
+# Display
+allow hardware_info_app sysfs_display:dir search;
+allow hardware_info_app sysfs_display:file r_file_perms;
+
+# SoC
+allow hardware_info_app sysfs_soc:file r_file_perms;
+allow hardware_info_app sysfs_chip_id:file r_file_perms;
+
+# Batery history
+allow hardware_info_app battery_history_device:chr_file r_file_perms;
diff --git a/hardware_info_app/seapp_contexts b/hardware_info_app/seapp_contexts
new file mode 100644
index 0000000..390f160
--- /dev/null
+++ b/hardware_info_app/seapp_contexts
@@ -0,0 +1,2 @@
+# Hardware Info Collection
+user=_app isPrivApp=true name=com.google.android.hardwareinfo domain=hardware_info_app type=app_data_file levelFrom=user