gps: turn off asserts am: 2c923f467d
am: 4d66bf3fd0

Change-Id: I76dd775c051c2e9cce56d56b57aae4921b1fe0a5
diff --git a/VolantisKeyboard/res/values-be-rBY/strings.xml b/VolantisKeyboard/res/values-be-rBY/strings.xml
deleted file mode 100644
index c9d7297..0000000
--- a/VolantisKeyboard/res/values-be-rBY/strings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="8309373558371161520">"Клавіятура Volantis"</string>
-    <string name="keyboard_layouts_label" msgid="771692943642467584">"Кампактная клавіятура Nexus"</string>
-    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"англійская (Вялікабрытанія)"</string>
-    <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"англійская (ЗША)"</string>
-    <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"Англійская (ЗША, міжнародная)"</string>
-    <string name="keyboard_layout_volantis_german_label" msgid="1115175249339065508">"Нямецкая"</string>
-    <string name="keyboard_layout_volantis_french_label" msgid="7039437279465504539">"Французская"</string>
-    <string name="keyboard_layout_volantis_french_ca_label" msgid="773887798068625483">"Французская (Канада)"</string>
-    <string name="keyboard_layout_volantis_italian_label" msgid="2487824389457459330">"Італьянская"</string>
-    <string name="keyboard_layout_volantis_japanese_label" msgid="893728776095514102">"Японская"</string>
-    <string name="keyboard_layout_volantis_spanish_label" msgid="7072256682329860171">"Іспанская"</string>
-    <string name="keyboard_layout_volantis_belgian_label" msgid="8875281999639372179">"Бельгійская"</string>
-    <string name="keyboard_layout_volantis_swedish_label" msgid="7072561947207061024">"Шведская"</string>
-    <string name="keyboard_layout_volantis_korean_label" msgid="4119892422942692947">"Карэйская"</string>
-    <string name="keyboard_layout_volantis_zhuyin_label" msgid="1056309325803786283">"Кітайская (Чжуінь)"</string>
-    <string name="keyboard_layout_volantis_cangjie_label" msgid="4711081327905634320">"Кітайская (Цанцзе)"</string>
-</resources>
diff --git a/VolantisKeyboard/res/values-bs-rBA/strings.xml b/VolantisKeyboard/res/values-bs-rBA/strings.xml
deleted file mode 100644
index 2edce0f..0000000
--- a/VolantisKeyboard/res/values-bs-rBA/strings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="8309373558371161520">"Volantis tastatura"</string>
-    <string name="keyboard_layouts_label" msgid="771692943642467584">"Nexus kompaktna tastatura"</string>
-    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"engleski (UK)"</string>
-    <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"engleski (SAD)"</string>
-    <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"engleski (SAD, međunarodni stil)"</string>
-    <string name="keyboard_layout_volantis_german_label" msgid="1115175249339065508">"njemački"</string>
-    <string name="keyboard_layout_volantis_french_label" msgid="7039437279465504539">"francuski"</string>
-    <string name="keyboard_layout_volantis_french_ca_label" msgid="773887798068625483">"francuski (Kanada)"</string>
-    <string name="keyboard_layout_volantis_italian_label" msgid="2487824389457459330">"italijanski"</string>
-    <string name="keyboard_layout_volantis_japanese_label" msgid="893728776095514102">"japanski"</string>
-    <string name="keyboard_layout_volantis_spanish_label" msgid="7072256682329860171">"španski"</string>
-    <string name="keyboard_layout_volantis_belgian_label" msgid="8875281999639372179">"belgijski"</string>
-    <string name="keyboard_layout_volantis_swedish_label" msgid="7072561947207061024">"švedski"</string>
-    <string name="keyboard_layout_volantis_korean_label" msgid="4119892422942692947">"koreanski"</string>
-    <string name="keyboard_layout_volantis_zhuyin_label" msgid="1056309325803786283">"kineski (Zhuyin)"</string>
-    <string name="keyboard_layout_volantis_cangjie_label" msgid="4711081327905634320">"kineski (Cangjie)"</string>
-</resources>
diff --git a/VolantisKeyboard/res/values-da/strings.xml b/VolantisKeyboard/res/values-da/strings.xml
index 57e1887..fb2b8c2 100644
--- a/VolantisKeyboard/res/values-da/strings.xml
+++ b/VolantisKeyboard/res/values-da/strings.xml
@@ -3,7 +3,7 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="app_label" msgid="8309373558371161520">"Volantis-tastatur"</string>
     <string name="keyboard_layouts_label" msgid="771692943642467584">"Kompakt Nexus-tastatur"</string>
-    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"engelsk (UK)"</string>
+    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"Engelsk (UK)"</string>
     <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"Engelsk (USA)"</string>
     <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"Engelsk (international amerikansk)"</string>
     <string name="keyboard_layout_volantis_german_label" msgid="1115175249339065508">"Tysk"</string>
diff --git a/VolantisKeyboard/res/values-fa/strings.xml b/VolantisKeyboard/res/values-fa/strings.xml
index b89ba1e..87eac52 100644
--- a/VolantisKeyboard/res/values-fa/strings.xml
+++ b/VolantisKeyboard/res/values-fa/strings.xml
@@ -4,7 +4,7 @@
     <string name="app_label" msgid="8309373558371161520">"Volantis Keyboard"</string>
     <string name="keyboard_layouts_label" msgid="771692943642467584">"‏صفحه‌کلید فشرده Nexus"</string>
     <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"انگلیسی (بریتانیا)"</string>
-    <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"انگلیسی (امریکا)"</string>
+    <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"انگلیسی (آمریکا)"</string>
     <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"انگلیسی (آمریکایی بین‌المللی)"</string>
     <string name="keyboard_layout_volantis_german_label" msgid="1115175249339065508">"آلمانی"</string>
     <string name="keyboard_layout_volantis_french_label" msgid="7039437279465504539">"فرانسوی"</string>
diff --git a/VolantisKeyboard/res/values-kn-rIN/strings.xml b/VolantisKeyboard/res/values-kn-rIN/strings.xml
index 8defbf3..a5e95d9 100644
--- a/VolantisKeyboard/res/values-kn-rIN/strings.xml
+++ b/VolantisKeyboard/res/values-kn-rIN/strings.xml
@@ -3,7 +3,7 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="app_label" msgid="8309373558371161520">"ವೊಲಾಂಟಿಸ್ ಕೀಬೋರ್ಡ್"</string>
     <string name="keyboard_layouts_label" msgid="771692943642467584">"Nexus ಕಾಂಪ್ಯಾಕ್ಟ್ ಕೀಬೋರ್ಡ್"</string>
-    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"ಇಂಗ್ಲಿಷ್ (ಯುಕೆ)"</string>
+    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"ಇಂಗ್ಲಿಷ್ (UK)"</string>
     <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"ಇಂಗ್ಲಿಷ್ (US)"</string>
     <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"ಇಂಗ್ಲಿಷ್ (US ಅಂತರರಾಷ್ಟ್ರೀಯ)"</string>
     <string name="keyboard_layout_volantis_german_label" msgid="1115175249339065508">"ಜರ್ಮನ್"</string>
diff --git a/VolantisKeyboard/res/values-pa-rIN/strings.xml b/VolantisKeyboard/res/values-pa-rIN/strings.xml
index e895905..d6f1b0a 100644
--- a/VolantisKeyboard/res/values-pa-rIN/strings.xml
+++ b/VolantisKeyboard/res/values-pa-rIN/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="8309373558371161520">"Volantis ਕੀ-ਬੋਰਡ"</string>
-    <string name="keyboard_layouts_label" msgid="771692943642467584">"Nexus ਕੰਪੈਕਟ ਕੀ-ਬੋਰਡ"</string>
+    <string name="app_label" msgid="8309373558371161520">"Volantis ਕੀਬੋਰਡ"</string>
+    <string name="keyboard_layouts_label" msgid="771692943642467584">"Nexus ਕੰਪੈਕਟ ਕੀਬੋਰਡ"</string>
     <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"ਅੰਗਰੇਜ਼ੀ (ਯੂਕੇ)"</string>
     <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"ਅੰਗਰੇਜ਼ੀ (ਅਮਰੀਕਾ)"</string>
     <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"ਅੰਗਰੇਜ਼ੀ (ਅਮਰੀਕਾ ਅੰਤਰਰਾਸ਼ਟਰੀ)"</string>
diff --git a/VolantisKeyboard/res/values-tl/strings.xml b/VolantisKeyboard/res/values-tl/strings.xml
index cce6e2c..68541f5 100644
--- a/VolantisKeyboard/res/values-tl/strings.xml
+++ b/VolantisKeyboard/res/values-tl/strings.xml
@@ -3,9 +3,9 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="app_label" msgid="8309373558371161520">"Volantis Keyboard"</string>
     <string name="keyboard_layouts_label" msgid="771692943642467584">"Nexus Compact Keyboard"</string>
-    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"English (UK)"</string>
-    <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"English (US)"</string>
-    <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"English (US International)"</string>
+    <string name="keyboard_layout_volantis_english_uk_label" msgid="1425137404576186880">"Ingles (UK)"</string>
+    <string name="keyboard_layout_volantis_english_us_label" msgid="953130059365065614">"Ingles (US)"</string>
+    <string name="keyboard_layout_volantis_english_us_intl_label" msgid="8444053619141689693">"Ingles (US International)"</string>
     <string name="keyboard_layout_volantis_german_label" msgid="1115175249339065508">"German"</string>
     <string name="keyboard_layout_volantis_french_label" msgid="7039437279465504539">"French"</string>
     <string name="keyboard_layout_volantis_french_ca_label" msgid="773887798068625483">"French (Canada)"</string>
diff --git a/VolantisLayout/res/values-be-rBY/strings.xml b/VolantisLayout/res/values-be-rBY/strings.xml
deleted file mode 100644
index c4ab79a..0000000
--- a/VolantisLayout/res/values-be-rBY/strings.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--  Copyright (C) 2014 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="4333089353149619778">"Галоўны экран Nexus 9"</string>
-    <string name="google_folder_title" msgid="375890659159312012">"Google"</string>
-    <string name="create_folder_title" msgid="5720573466924789097">"Стварыць"</string>
-    <string name="play_folder_title" msgid="3260420724119064282">"Play"</string>
-</resources>
diff --git a/VolantisLayout/res/values-bs-rBA/strings.xml b/VolantisLayout/res/values-bs-rBA/strings.xml
deleted file mode 100644
index 1658c75..0000000
--- a/VolantisLayout/res/values-bs-rBA/strings.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--  Copyright (C) 2014 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="4333089353149619778">"Nexus 9 početni ekran"</string>
-    <string name="google_folder_title" msgid="375890659159312012">"Google"</string>
-    <string name="create_folder_title" msgid="5720573466924789097">"Kreiraj"</string>
-    <string name="play_folder_title" msgid="3260420724119064282">"Reproduciraj"</string>
-</resources>
diff --git a/device.mk b/device.mk
index 6c10fb0..b6ece56 100644
--- a/device.mk
+++ b/device.mk
@@ -17,6 +17,7 @@
 PRODUCT_PACKAGES := \
     libwpa_client \
     hostapd \
+    wificond \
     wpa_supplicant \
     wpa_supplicant.conf
 
diff --git a/init.flounder.rc b/init.flounder.rc
index 324b797..469043c 100644
--- a/init.flounder.rc
+++ b/init.flounder.rc
@@ -203,7 +203,7 @@
     oneshot
     keycodes 114 115 116
 
-service p2p_supplicant /system/bin/wpa_supplicant \
+service wpa_supplicant /system/bin/wpa_supplicant \
     -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
     -I/system/etc/wifi/p2p_supplicant_overlay.conf \
     -puse_p2p_group_interface=1p2p_device=1 \
@@ -221,15 +221,6 @@
     socket gps seqpacket 0660 gps system
     group system wakelock inet sdcard_rw sdcard_r
 
-service wpa_supplicant /system/bin/wpa_supplicant \
-    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-    -I/system/etc/wifi/wpa_supplicant_overlay.conf \
-    -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
-    class late_start
-    socket wpa_wlan0 dgram 660 wifi wifi
-    disabled
-    oneshot
-
 service kickstart /vendor/bin/qcks -i /vendor/firmware/mdm/image/ -r /data/qcks/mdm/
     class late_start
     disabled
diff --git a/sepolicy/attributes b/sepolicy/attributes
new file mode 100644
index 0000000..d140949
--- /dev/null
+++ b/sepolicy/attributes
@@ -0,0 +1,4 @@
+# domain_deprecated attribute is being removed from core policy. Leave it
+# in device-specific policy for device-specific domains. Unlike core policy,
+# device-specific policy will eventually be deprecated.
+attribute device_domain_deprecated;
diff --git a/sepolicy/device.te b/sepolicy/device.te
index 4eee900..ea8f456 100644
--- a/sepolicy/device.te
+++ b/sepolicy/device.te
@@ -9,3 +9,5 @@
 
 # mmc rpmb partition block device
 type mmc_rpmb_block_device, dev_type;
+
+type gps_device, dev_type;
diff --git a/sepolicy/device_domain_deprecated.te b/sepolicy/device_domain_deprecated.te
new file mode 100644
index 0000000..bbe0b71
--- /dev/null
+++ b/sepolicy/device_domain_deprecated.te
@@ -0,0 +1,36 @@
+allow device_domain_deprecated adbd:unix_stream_socket connectto;
+allow device_domain_deprecated adbd:fd use;
+allow device_domain_deprecated adbd:unix_stream_socket { getattr getopt ioctl read write shutdown };
+allow device_domain_deprecated rootfs:dir r_dir_perms;
+allow device_domain_deprecated rootfs:file r_file_perms;
+allow device_domain_deprecated rootfs:lnk_file r_file_perms;
+allow device_domain_deprecated device:file read;
+allow device_domain_deprecated system_file:dir r_dir_perms;
+allow device_domain_deprecated system_file:file r_file_perms;
+allow device_domain_deprecated system_file:lnk_file r_file_perms;
+allow device_domain_deprecated system_data_file:file { getattr read };
+allow device_domain_deprecated system_data_file:lnk_file r_file_perms;
+allow device_domain_deprecated apk_data_file:dir { getattr search };
+allow device_domain_deprecated apk_data_file:file r_file_perms;
+allow device_domain_deprecated apk_data_file:lnk_file r_file_perms;
+allow device_domain_deprecated dalvikcache_data_file:dir { search getattr };
+allow device_domain_deprecated dalvikcache_data_file:file r_file_perms;
+allow device_domain_deprecated cache_file:dir r_dir_perms;
+allow device_domain_deprecated cache_file:file { getattr read };
+allow device_domain_deprecated cache_file:lnk_file r_file_perms;
+allow device_domain_deprecated ion_device:chr_file rw_file_perms;
+allow device_domain_deprecated proc:dir r_dir_perms;
+allow device_domain_deprecated proc:{ file lnk_file } r_file_perms;
+allow device_domain_deprecated sysfs:dir r_dir_perms;
+allow device_domain_deprecated sysfs:{ file lnk_file } r_file_perms;
+allow device_domain_deprecated inotify:dir r_dir_perms;
+allow device_domain_deprecated inotify:{ file lnk_file } r_file_perms;
+allow device_domain_deprecated cgroup:dir r_dir_perms;
+allow device_domain_deprecated cgroup:{ file lnk_file } r_file_perms;
+allow device_domain_deprecated proc_meminfo:file r_file_perms;
+allow device_domain_deprecated proc_net:dir r_dir_perms;
+allow device_domain_deprecated proc_net:{ file lnk_file } r_file_perms;
+allow device_domain_deprecated selinuxfs:dir r_dir_perms;
+allow device_domain_deprecated selinuxfs:file r_file_perms;
+allow device_domain_deprecated asec_public_file:file r_file_perms;
+allow device_domain_deprecated { asec_public_file asec_apk_file }:dir r_dir_perms;
diff --git a/sepolicy/file.te b/sepolicy/file.te
index ab4c950..713c84f 100644
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -19,3 +19,7 @@
 type sysfs_tegra_fuse, sysfs_type, fs_type;
 
 type debugfs_nvmap, debugfs_type, fs_type;
+
+# /data/gps
+type gps_data_file, file_type, data_file_type;
+type gps_socket, file_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index c9619fd..d403ec2 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -15,17 +15,17 @@
 # nfc
 /dev/bcm2079x			u:object_r:nfc_device:s0
 # camera devices
-/dev/camera.pcl			u:object_r:video_device:s0
-/dev/nvhost-ctrl-vi.*		u:object_r:video_device:s0
-/dev/nvhost-vi.*		u:object_r:video_device:s0
-/dev/nvhost-ctrl-isp.*		u:object_r:video_device:s0
-/dev/nvhost-isp.*		u:object_r:video_device:s0
-/dev/nvhost-msenc		u:object_r:video_device:s0
-/dev/imx219			u:object_r:video_device:s0
-/dev/focuser			u:object_r:video_device:s0
-/dev/ov9760			u:object_r:video_device:s0
-/dev/torch.*			u:object_r:video_device:s0
-/dev/mipi-cal			u:object_r:video_device:s0
+/dev/camera.pcl			u:object_r:camera_device:s0
+/dev/nvhost-ctrl-vi.*		u:object_r:camera_device:s0
+/dev/nvhost-vi.*		u:object_r:camera_device:s0
+/dev/nvhost-ctrl-isp.*		u:object_r:camera_device:s0
+/dev/nvhost-isp.*		u:object_r:camera_device:s0
+/dev/nvhost-msenc		u:object_r:camera_device:s0
+/dev/imx219			u:object_r:camera_device:s0
+/dev/focuser			u:object_r:camera_device:s0
+/dev/ov9760			u:object_r:camera_device:s0
+/dev/torch.*			u:object_r:camera_device:s0
+/dev/mipi-cal			u:object_r:camera_device:s0
 
 # rt5506 Audio device
 /dev/rt5506                     u:object_r:audio_device:s0
@@ -40,6 +40,8 @@
 # gps
 /system/bin/glgps		u:object_r:gpsd_exec:s0
 /dev/ttyTHS1			u:object_r:gps_device:s0
+/dev/socket/gps		        u:object_r:gps_socket:s0
+/data/gps(/.*)?		        u:object_r:gps_data_file:s0
 
 # touch_fusion
 /vendor/bin/touch_fusion	u:object_r:touch_fusion_exec:s0
@@ -114,5 +116,8 @@
 # tlk_daemon
 /vendor/bin/tlk_daemon                 u:object_r:tee_exec:s0
 
+# sysfs files used by wifi
+/sys/module/bcmdhd/parameters/firmware_path u:object_r:sysfs_wlan_fwpath:s0
+
 # label the wifi MAC address
 /sys/devices/platform/sdhci-tegra\.0/mmc_host/mmc1/mmc1:0001/mmc1:0001:2/net/wlan0/address u:object_r:sysfs_mac_address:s0
diff --git a/sepolicy/gpsd.te b/sepolicy/gpsd.te
index b5d151d..7d83c1a 100644
--- a/sepolicy/gpsd.te
+++ b/sepolicy/gpsd.te
@@ -1 +1,23 @@
+# gpsd - GPS daemon
+type gpsd, domain;
+type gpsd_exec, exec_type, file_type;
+
+init_daemon_domain(gpsd)
+net_domain(gpsd)
 wakelock_use(gpsd)
+
+allow gpsd gps_data_file:dir rw_dir_perms;
+allow gpsd gps_data_file:notdevfile_class_set create_file_perms;
+# Socket is created by the daemon, not by init, and under /data/gps,
+# not under /dev/socket.
+type_transition gpsd gps_data_file:sock_file gps_socket;
+allow gpsd gps_socket:sock_file create_file_perms;
+# XXX Label sysfs files with a specific type?
+allow gpsd sysfs:file rw_file_perms;
+
+allow gpsd gps_device:chr_file rw_file_perms;
+
+# Execute the shell or system commands.
+allow gpsd shell_exec:file rx_file_perms;
+allow gpsd system_file:file rx_file_perms;
+allow gpsd toolbox_exec:file rx_file_perms;
diff --git a/sepolicy/kickstart.te b/sepolicy/kickstart.te
index 3cf82d0..15937bb 100644
--- a/sepolicy/kickstart.te
+++ b/sepolicy/kickstart.te
@@ -1,5 +1,5 @@
 # kickstart processes and scripts (system process)
-type kickstart, domain, domain_deprecated;
+type kickstart, domain, device_domain_deprecated;
 type kickstart_exec, file_type, exec_type;
 
 init_daemon_domain(kickstart)
diff --git a/sepolicy/netmgrd.te b/sepolicy/netmgrd.te
index 113ec17..df591dd 100644
--- a/sepolicy/netmgrd.te
+++ b/sepolicy/netmgrd.te
@@ -1,5 +1,5 @@
 # Network utilities (radio process)
-type netmgrd, domain, domain_deprecated;
+type netmgrd, domain, device_domain_deprecated;
 type netmgrd_exec, exec_type, file_type;
 
 # Started by init
diff --git a/sepolicy/qmuxd.te b/sepolicy/qmuxd.te
index fb90db8..d6a5d16 100644
--- a/sepolicy/qmuxd.te
+++ b/sepolicy/qmuxd.te
@@ -1,5 +1,5 @@
 # Qualcomm Management Interface Multiplexer
-type qmuxd, domain, domain_deprecated;
+type qmuxd, domain, device_domain_deprecated;
 type qmuxd_exec, exec_type, file_type;
 
 # Started by init
diff --git a/sepolicy/rild.te b/sepolicy/rild.te
index 76f5689..a6e4978 100644
--- a/sepolicy/rild.te
+++ b/sepolicy/rild.te
@@ -4,3 +4,6 @@
 
 # Grant access to Qualcomm MSM Interface (QMI) radio sockets to RILD
 qmux_socket(rild)
+
+# Read/Write to uart driver (for GPS)
+allow rild gps_device:chr_file rw_file_perms;
diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te
index b7272a5..e6877a5 100644
--- a/sepolicy/system_server.te
+++ b/sepolicy/system_server.te
@@ -13,3 +13,6 @@
 allow system_server sysfs_gpu:file r_file_perms;
 allow system_server sysfs_socinfo:file r_file_perms;
 allow system_server sysfs_swap:file r_file_perms;
+
+unix_socket_connect(system_server, gps, gpsd)
+allow system_server gps_device:chr_file rw_file_perms;
diff --git a/sepolicy/touch_fusion.te b/sepolicy/touch_fusion.te
index 2652ef1..eb3e52e 100644
--- a/sepolicy/touch_fusion.te
+++ b/sepolicy/touch_fusion.te
@@ -1,5 +1,5 @@
 # touch_fusion
-type touch_fusion, domain, domain_deprecated;
+type touch_fusion, domain, device_domain_deprecated;
 type touch_fusion_exec, exec_type, file_type;
 
 # Why net_admin?