Add gnss_device dev_type

This grants default access to the new GNSS subsystem for Linux to the
GNSS HAL default implementation. The GNSS subsystem creates character
devices similar to ttys but without much unneeded complexity. The GNSS
device class is specific to location use cases.

Bug: 151670529
Change-Id: I03b27aa5bbfdf600eb830de1c8748aacb9bf4663
diff --git a/private/compat/29.0/29.0.ignore.cil b/private/compat/29.0/29.0.ignore.cil
index 9c5deb0..0b0a8d2 100644
--- a/private/compat/29.0/29.0.ignore.cil
+++ b/private/compat/29.0/29.0.ignore.cil
@@ -45,6 +45,7 @@
     file_integrity_service
     fwk_automotive_display_hwservice
     gmscore_app
+    gnss_device
     hal_can_bus_hwservice
     hal_can_controller_hwservice
     hal_identity_service
diff --git a/private/file_contexts b/private/file_contexts
index ef4e042..27f8328 100644
--- a/private/file_contexts
+++ b/private/file_contexts
@@ -95,6 +95,7 @@
 /dev/cgroup_info(/.*)?  u:object_r:cgroup_rc_file:s0
 /dev/fscklogs(/.*)?	u:object_r:fscklogs:s0
 /dev/fuse		u:object_r:fuse_device:s0
+/dev/gnss[0-9]+		u:object_r:gnss_device:s0
 /dev/graphics(/.*)?	u:object_r:graphics_device:s0
 /dev/hw_random		u:object_r:hw_random_device:s0
 /dev/hwbinder		u:object_r:hwbinder_device:s0
diff --git a/public/device.te b/public/device.te
index 32563d6..43d6322 100644
--- a/public/device.te
+++ b/public/device.te
@@ -52,6 +52,7 @@
 type usbaccessory_device, dev_type, mlstrustedobject;
 type usb_device, dev_type, mlstrustedobject;
 type usb_serial_device, dev_type;
+type gnss_device, dev_type;
 type properties_device, dev_type;
 type properties_serial, dev_type;
 type property_info, dev_type;
diff --git a/vendor/hal_gnss_default.te b/vendor/hal_gnss_default.te
index 92af53b..cea362f 100644
--- a/vendor/hal_gnss_default.te
+++ b/vendor/hal_gnss_default.te
@@ -3,3 +3,5 @@
 
 type hal_gnss_default_exec, exec_type, vendor_file_type, file_type;
 init_daemon_domain(hal_gnss_default)
+
+allow hal_gnss_default gnss_device:chr_file rw_file_perms;