Merge "Support AR one-shot fuse on the new platform" into main
diff --git a/audio/sepolicy/common/property_contexts b/audio/sepolicy/common/property_contexts
index 96e678c..9f88e55 100644
--- a/audio/sepolicy/common/property_contexts
+++ b/audio/sepolicy/common/property_contexts
@@ -1,3 +1,6 @@
+# for serial no
+vendor.audio_hal.device.serialno u:object_r:vendor_audio_prop:s0
+
# for audio
vendor.audio_hal.period_multiplier u:object_r:vendor_audio_prop:s0
vendor.audiodump.enable u:object_r:vendor_audio_prop:s0
diff --git a/camera/lyric.mk b/camera/lyric.mk
index 7762f4d..30e06d1 100644
--- a/camera/lyric.mk
+++ b/camera/lyric.mk
@@ -5,6 +5,9 @@
$(call soong_config_set,google3a_config,gcam_awb,true)
$(call soong_config_set,google3a_config,ghawb_truetone,true)
+# Flag controls whether Lyric apex can be located in the dist-directory.
+$(call soong_config_set, lyric, dist_lyric_apex, $(RELEASE_PIXEL_DIST_LYRIC_APEX))
+
# Select GCH backend.
# TODO(b/192681010): This dependency inversion should be removed.
ifneq ($(wildcard vendor/google/services/LyricCameraHAL/src),)
diff --git a/gps/brcm/sepolicy/genfs_contexts b/gps/brcm/sepolicy/genfs_contexts
index 446fc45..a551e96 100644
--- a/gps/brcm/sepolicy/genfs_contexts
+++ b/gps/brcm/sepolicy/genfs_contexts
@@ -1,3 +1,4 @@
# GPS
genfscon sysfs /devices/virtual/pps/pps0/assert_elapsed u:object_r:sysfs_gps_assert:s0
+genfscon sysfs /devices/platform/bbd_pps/pps_assert u:object_r:sysfs_gps_assert:s0
diff --git a/insmod/16k/Android.bp b/insmod/16k/Android.bp
deleted file mode 100644
index 975c5dc..0000000
--- a/insmod/16k/Android.bp
+++ /dev/null
@@ -1,14 +0,0 @@
-
-soong_namespace {
-}
-
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-sh_binary {
- name: "insmod.sh",
- src: "insmod.sh",
- init_rc: ["init.module.rc"],
- vendor: true,
-}
diff --git a/insmod/16k/init.module.rc b/insmod/16k/init.module.rc
deleted file mode 100644
index de23b5b..0000000
--- a/insmod/16k/init.module.rc
+++ /dev/null
@@ -1,10 +0,0 @@
-on init
- # Loading common kernel modules in background
- start insmod_sh
-
-service insmod_sh /vendor/bin/insmod.sh /vendor/etc/init.common.cfg
- class main
- user root
- group root system
- disabled
- oneshot
diff --git a/insmod/16k/insmod.sh b/insmod/16k/insmod.sh
deleted file mode 100644
index 8ec8199..0000000
--- a/insmod/16k/insmod.sh
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/vendor/bin/sh
-
-#############################################################
-### init.insmod.cfg format: ###
-### ----------------------------------------------------- ###
-### [insmod|setprop|enable/moprobe|wait] [path|prop name] ###
-### ... ###
-#############################################################
-
-modules_dir=
-system_modules_dir=
-vendor_modules_dir=
-
-
-pagesize=$(getconf PAGESIZE)
-# bootoption=$(getprop ro.product.build.16k_page.enabled)
-# We do not need to check ro.product.build.16k_page.enabled , because this
-# version of insmod.sh will only be used if PRODUCT_16K_DEVELOPER_OPTION
-# is set to true
-
-if [ "$pagesize" != "4096" ] ; then
- echo "Device has page size $pagesize , skip loading modules from vendor_dlkm/system_dlkm because all modules are stored on vendor_boot"
- setprop vendor.common.modules.ready 1
- setprop vendor.device.modules.ready 1
- setprop vendor.all.modules.ready 1
- setprop vendor.all.devices.ready 1
- return 0
-fi
-
-
-for dir in system vendor; do
- for f in /${dir}/lib/modules/*/modules.dep /${dir}/lib/modules/modules.dep; do
- if [[ -f "$f" ]]; then
- if [[ "${dir}" == "system" ]]; then
- system_modules_dir="$(dirname "$f")"
- else
- vendor_modules_dir="$(dirname "$f")"
- modules_dir=${vendor_modules_dir}
- fi
- break
- fi
- done
-done
-
-if [[ -z "${system_modules_dir}" ]]; then
- echo "Unable to locate system kernel modules directory" 2>&1
-fi
-
-if [[ -z "${vendor_modules_dir}" ]]; then
- echo "Unable to locate vendor kernel modules directory" 2>&1
- exit 1
-fi
-
-# imitates wait_for_file() in init
-wait_for_file()
-{
- filename="${1}"
- timeout="${2:-5}"
-
- expiry=$(($(date "+%s")+timeout))
- while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]]
- do
- sleep 0.01
- done
-}
-
-if [ $# -eq 1 ]; then
- cfg_file=$1
-else
- # Set property even if there is no insmod config
- # to unblock early-boot trigger
- setprop vendor.common.modules.ready 1
- setprop vendor.device.modules.ready 1
- setprop vendor.all.modules.ready 1
- setprop vendor.all.devices.ready 1
- exit 1
-fi
-
-if [ -f $cfg_file ]; then
- while IFS="|" read -r action arg
- do
- case $action in
- "insmod") insmod $arg ;;
- "setprop") setprop $arg 1 ;;
- "enable") echo 1 > $arg ;;
- "condinsmod")
- prop=$(echo $arg | cut -d '|' -f 1)
- module1=$(echo $arg | cut -d '|' -f 2)
- module2=$(echo $arg | cut -d '|' -f 3)
- value=$(getprop $prop)
- if [[ ${value} == "true" ]]; then
- insmod ${vendor_modules_dir}/${module1}
- else
- insmod ${vendor_modules_dir}/${module2}
- fi
- ;;
- "modprobe")
- case ${arg} in
- "system -b *" | "system -b")
- modules_dir=${system_modules_dir}
- arg="-b --all=${system_modules_dir}/modules.load" ;;
- "system *" | "system")
- modules_dir=${system_modules_dir}
- arg="--all=${system_modules_dir}/modules.load" ;;
- "-b *" | "-b" | "vendor -b *" | "vendor -b")
- modules_dir=${vendor_modules_dir}
- arg="-b --all=${vendor_modules_dir}/modules.load" ;;
- "*" | "" | "vendor *" | "vendor")
- modules_dir=${vendor_modules_dir}
- arg="--all=${vendor_modules_dir}/modules.load" ;;
- esac
- if [[ -d "${modules_dir}" ]]; then
- modprobe -a -d "${modules_dir}" $arg
- fi
- ;;
- "wait") wait_for_file $arg ;;
- esac
- done < $cfg_file
-fi
diff --git a/insmod/4k/Android.bp b/insmod/4k/Android.bp
deleted file mode 100644
index ddfec40..0000000
--- a/insmod/4k/Android.bp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-soong_namespace {
-}
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-sh_binary {
- name: "insmod.sh",
- src: "insmod.sh",
- init_rc: ["init.module.rc"],
- vendor: true,
-}
diff --git a/insmod/Android.bp b/insmod/Android.bp
index 143e777..eed35ec 100644
--- a/insmod/Android.bp
+++ b/insmod/Android.bp
@@ -2,6 +2,13 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
+sh_binary {
+ name: "insmod.sh",
+ src: "insmod.sh",
+ init_rc: ["init.module.rc"],
+ vendor: true,
+}
+
prebuilt_etc {
name: "init.common.cfg",
src: "init.common.cfg",
diff --git a/insmod/4k/init.module.rc b/insmod/init.module.rc
similarity index 100%
rename from insmod/4k/init.module.rc
rename to insmod/init.module.rc
diff --git a/insmod/insmod.mk b/insmod/insmod.mk
index 0d8da9e..aa2261a 100644
--- a/insmod/insmod.mk
+++ b/insmod/insmod.mk
@@ -1,9 +1,3 @@
-ifeq (true,$(PRODUCT_16K_DEVELOPER_OPTION))
-PRODUCT_SOONG_NAMESPACES += device/google/gs-common/insmod/16k
-else
-PRODUCT_SOONG_NAMESPACES += device/google/gs-common/insmod/4k
-endif
-
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/insmod/sepolicy
PRODUCT_PACKAGES += \
insmod.sh \
diff --git a/insmod/4k/insmod.sh b/insmod/insmod.sh
similarity index 100%
rename from insmod/4k/insmod.sh
rename to insmod/insmod.sh
diff --git a/touch/gti/predump_sepolicy/genfs_contexts b/touch/gti/predump_sepolicy/genfs_contexts
index 45d3b53..1dd4bad 100644
--- a/touch/gti/predump_sepolicy/genfs_contexts
+++ b/touch/gti/predump_sepolicy/genfs_contexts
@@ -1,4 +1,6 @@
# Touch
genfscon sysfs /devices/virtual/goog_touch_interface u:object_r:sysfs_touch_gti:s0
+genfscon sysfs /devices/virtual/goog_touch_interface/gti.0/wakeup u:object_r:sysfs_wakeup:s0
+genfscon sysfs /devices/virtual/goog_touch_interface/gti.1/wakeup u:object_r:sysfs_wakeup:s0
genfscon proc /goog_touch_interface u:object_r:proc_touch_gti:s0
diff --git a/touch/gti/sepolicy/genfs_contexts b/touch/gti/sepolicy/genfs_contexts
index 45d3b53..1dd4bad 100644
--- a/touch/gti/sepolicy/genfs_contexts
+++ b/touch/gti/sepolicy/genfs_contexts
@@ -1,4 +1,6 @@
# Touch
genfscon sysfs /devices/virtual/goog_touch_interface u:object_r:sysfs_touch_gti:s0
+genfscon sysfs /devices/virtual/goog_touch_interface/gti.0/wakeup u:object_r:sysfs_wakeup:s0
+genfscon sysfs /devices/virtual/goog_touch_interface/gti.1/wakeup u:object_r:sysfs_wakeup:s0
genfscon proc /goog_touch_interface u:object_r:proc_touch_gti:s0
diff --git a/touch/nvt/nvt-spi20.mk b/touch/nvt/nvt-spi20.mk
new file mode 100644
index 0000000..ad46fcc
--- /dev/null
+++ b/touch/nvt/nvt-spi20.mk
@@ -0,0 +1,2 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/nvt/sepolicy
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/nvt/sepolicy-spi20
diff --git a/touch/nvt/sepolicy-spi20/genfs_contexts b/touch/nvt/sepolicy-spi20/genfs_contexts
new file mode 100644
index 0000000..05467a3
--- /dev/null
+++ b/touch/nvt/sepolicy-spi20/genfs_contexts
@@ -0,0 +1,8 @@
+# Touch
+genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0 u:object_r:sysfs_touch:s0
+
+# System suspend wakeup files
+genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/power_supply/nvt-pen-battery/wakeup u:object_r:sysfs_wakeup:s0
+genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/power_supply/USI_Stylus_Battery/wakeup u:object_r:sysfs_wakeup:s0
+genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/input/input2/wakeup u:object_r:sysfs_wakeup:s0
+genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/wakeup u:object_r:sysfs_wakeup:s0
diff --git a/touch/nvt/sepolicy/file.te b/touch/nvt/sepolicy/file.te
index e310df7..05a770b 100644
--- a/touch/nvt/sepolicy/file.te
+++ b/touch/nvt/sepolicy/file.te
@@ -1 +1,2 @@
type sysfs_touch, sysfs_type, fs_type;
+type proc_touch, proc_type, fs_type;
diff --git a/touch/nvt/sepolicy/genfs_contexts b/touch/nvt/sepolicy/genfs_contexts
new file mode 100644
index 0000000..b120511
--- /dev/null
+++ b/touch/nvt/sepolicy/genfs_contexts
@@ -0,0 +1,12 @@
+genfscon proc /nvt_baseline u:object_r:proc_touch:s0
+genfscon proc /nvt_cc_uniformity u:object_r:proc_touch:s0
+genfscon proc /nvt_diff u:object_r:proc_touch:s0
+genfscon proc /nvt_fw_update u:object_r:proc_touch:s0
+genfscon proc /nvt_fw_version u:object_r:proc_touch:s0
+genfscon proc /nvt_heatmap u:object_r:proc_touch:s0
+genfscon proc /nvt_pen_1d_diff u:object_r:proc_touch:s0
+genfscon proc /nvt_pen_2d_baseline u:object_r:proc_touch:s0
+genfscon proc /nvt_pen_2d_diff u:object_r:proc_touch:s0
+genfscon proc /nvt_pen_2d_raw u:object_r:proc_touch:s0
+genfscon proc /nvt_raw u:object_r:proc_touch:s0
+genfscon proc /nvt_selftest u:object_r:proc_touch:s0
diff --git a/touch/nvt/sepolicy/vendor_init.te b/touch/nvt/sepolicy/vendor_init.te
new file mode 100644
index 0000000..8b844dd
--- /dev/null
+++ b/touch/nvt/sepolicy/vendor_init.te
@@ -0,0 +1,5 @@
+allow vendor_init sysfs_touch:dir r_dir_perms;
+allow vendor_init sysfs_touch:file rw_file_perms;
+allow vendor_init proc_touch:dir r_dir_perms;
+allow vendor_init proc_touch:file rw_file_perms;
+set_prop(vendor_init, gesture_prop)