Merge "touch: Support SW_LID event from sensor HAL" into main
diff --git a/aoc/sepolicy/file_contexts b/aoc/sepolicy/file_contexts
index 73293f7..778de0c 100644
--- a/aoc/sepolicy/file_contexts
+++ b/aoc/sepolicy/file_contexts
@@ -34,6 +34,9 @@
 /dev/acd-chre_bt_offload_ctl        u:object_r:aoc_device:s0
 /dev/acd-chre_bt_offload_data_tx    u:object_r:aoc_device:s0
 /dev/acd-chre_bt_offload_data_rx    u:object_r:aoc_device:s0
+/dev/acd-chre_ctl                   u:object_r:aoc_device:s0
+/dev/acd-chre_data_tx               u:object_r:aoc_device:s0
+/dev/acd-chre_data_rx               u:object_r:aoc_device:s0
 
 # AoC vendor binaries
 /vendor/bin/aocd                    u:object_r:aocd_exec:s0
diff --git a/audio/aidl/device_framework_matrix_product.xml b/audio/aidl/device_framework_matrix_product.xml
index 0e7e998..11f01c7 100644
--- a/audio/aidl/device_framework_matrix_product.xml
+++ b/audio/aidl/device_framework_matrix_product.xml
@@ -9,7 +9,7 @@
     </hal>
     <hal format="aidl">
         <name>vendor.google.whitechapel.audio.extension</name>
-        <version>3</version>
+        <version>4</version>
         <interface>
             <name>IAudioExtension</name>
             <instance>default</instance>
diff --git a/battery_mitigation/sepolicy/vendor/dumpstate.te b/battery_mitigation/sepolicy/vendor/dumpstate.te
index bb84ff2..b3bb1d4 100644
--- a/battery_mitigation/sepolicy/vendor/dumpstate.te
+++ b/battery_mitigation/sepolicy/vendor/dumpstate.te
@@ -1,21 +1,3 @@
 # To call battery_mitigation hal
 allow dumpstate hal_battery_mitigation_service:service_manager find;
 binder_call(dumpstate, battery_mitigation);
-
-allow hal_dumpstate_default sysfs_acpm_stats:dir { read open search };
-allow hal_dumpstate_default sysfs_acpm_stats:file { read open getattr };
-allow hal_dumpstate_default sysfs_cpu:file { read open getattr };
-allow hal_dumpstate_default sysfs_batteryinfo:dir { read open search };
-allow hal_dumpstate_default sysfs_batteryinfo:file { read open getattr };
-allow hal_dumpstate_default logbuffer_device:chr_file { read open getattr };
-allow hal_dumpstate_default mitigation_vendor_data_file:file { read open getattr };
-allow hal_dumpstate_default mitigation_vendor_data_file:dir { search };
-allow hal_dumpstate_default sysfs_bcl:dir { read open search };
-allow hal_dumpstate_default sysfs_bcl:file { read open getattr };
-allow hal_dumpstate_default vendor_file:file { execute_no_trans };
-allow hal_dumpstate_default battery_history_device:chr_file { read };
-
-
-userdebug_or_eng(`
-  allow hal_dumpstate_default vendor_pm_genpd_debugfs:file { read open getattr };
-')
diff --git a/dauntless/gsc.mk b/dauntless/gsc.mk
index c1cf0e0..b563cc4 100644
--- a/dauntless/gsc.mk
+++ b/dauntless/gsc.mk
@@ -1,6 +1,6 @@
 # Dauntless
 BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dauntless/sepolicy
-ifneq ($(wildcard vendor),)
+ifneq ($(wildcard vendor/google_nos),)
 PRODUCT_SOONG_NAMESPACES += vendor/google_nos/init/dauntless
 
 PRODUCT_PACKAGES += \
@@ -92,4 +92,4 @@
 $(call dist-for-goals,droid,vendor/google_nos/prebuilts/dauntless/intermediate_images/d3m2_intermediate.ec.bin)
 endif
 
-endif # $(wildcard vendor)
+endif # $(wildcard vendor/google_nos)
diff --git a/display/dump_display_userdebug.sh b/display/dump_display_userdebug.sh
index b66a4fe..84b7311 100644
--- a/display/dump_display_userdebug.sh
+++ b/display/dump_display_userdebug.sh
@@ -1,4 +1,8 @@
 #!/vendor/bin/sh
+display_trace_path="/sys/kernel/tracing/instances/pixel-display/trace"
+echo "------ Display Trace ($display_trace_path)------"
+cat $display_trace_path
+
 echo "------ HWC Fence States ------"
 for f in $(ls /data/vendor/log/hwc/*_hwc_fence_state*.txt)
 do
diff --git a/display/sepolicy/dump_display.te b/display/sepolicy/dump_display.te
index b8fd1b8..3e2cb69 100644
--- a/display/sepolicy/dump_display.te
+++ b/display/sepolicy/dump_display.te
@@ -1,3 +1,4 @@
+# Display (dump for bugreport)
 pixel_bugreport(dump_display)
 
 allow dump_display sysfs_display:file r_file_perms;
diff --git a/display/sepolicy/dump_display_userdebug.te b/display/sepolicy/dump_display_userdebug.te
index a3f83bb..c08fb29 100644
--- a/display/sepolicy/dump_display_userdebug.te
+++ b/display/sepolicy/dump_display_userdebug.te
@@ -1,3 +1,4 @@
+# Display eng/userdebug (dump for bugreport)
 pixel_bugreport(dump_display_userdebug)
 
 userdebug_or_eng(`
@@ -5,4 +6,6 @@
   allow dump_display_userdebug vendor_log_file:dir search;
   allow dump_display_userdebug vendor_hwc_log_file:dir r_dir_perms;
   allow dump_display_userdebug vendor_hwc_log_file:file r_file_perms;
+  allow dump_display_userdebug debugfs_tracing_instances:dir search;
+  allow dump_display_userdebug debugfs_tracing_instances:file r_file_perms;
 ')
diff --git a/edgetpu/edgetpu.mk b/edgetpu/edgetpu.mk
index feb728f..9f7e1de 100644
--- a/edgetpu/edgetpu.mk
+++ b/edgetpu/edgetpu.mk
@@ -19,10 +19,6 @@
 # TPU TFlite Delegate
 PRODUCT_PACKAGES += \
         libedgetpu_util
-# TPU DBA AIDL HAL service
-PRODUCT_PACKAGES += com.google.edgetpu.dba-service
-# TPU DBA C API library
-PRODUCT_PACKAGES += libedgetpu_dba.google
 # TPU Tachyon HAL service
 PRODUCT_PACKAGES += com.google.edgetpu.tachyon-service
 # TPU Tachyon C API library
diff --git a/gear/dumpstate/sepolicy/hal_dumpstate_default.te b/gear/dumpstate/sepolicy/hal_dumpstate_default.te
index 06ebb75..e0f0b09 100644
--- a/gear/dumpstate/sepolicy/hal_dumpstate_default.te
+++ b/gear/dumpstate/sepolicy/hal_dumpstate_default.te
@@ -5,3 +5,8 @@
 allow hal_dumpstate_default shell_data_file:file getattr;
 set_prop(hal_dumpstate_default, vendor_logger_prop)
 
+# All dumps that are executed via hal_dumpstate_default should use their
+# own domain to request their permissions to achieve compartmentalization.
+# go/pixel-bugreport has examples on how to do that.
+neverallow hal_dumpstate_default { vendor_file_type -vendor_toolbox_exec }:file execute_no_trans;
+
diff --git a/mediacodec/vpu/sepolicy/mediacodec_google.te b/mediacodec/vpu/sepolicy/mediacodec_google.te
index 8022675..99a3c8d 100644
--- a/mediacodec/vpu/sepolicy/mediacodec_google.te
+++ b/mediacodec/vpu/sepolicy/mediacodec_google.te
@@ -1,3 +1,4 @@
+# Google Mediacodec
 type mediacodec_google, domain;
 type mediacodec_google_exec, exec_type, vendor_file_type, file_type;
 
@@ -8,6 +9,7 @@
 hal_client_domain(mediacodec_google, hal_graphics_allocator)
 
 add_service(mediacodec_google, eco_service)
+binder_call(mediacodec_google, hal_camera_default)
 
 allow mediacodec_google dmabuf_system_heap_device:chr_file r_file_perms;
 allow mediacodec_google video_device:chr_file { read write open ioctl map };
diff --git a/storage/init.storage.rc b/storage/init.storage.rc
index 9e4acd4..77057cd 100644
--- a/storage/init.storage.rc
+++ b/storage/init.storage.rc
@@ -1,11 +1,3 @@
-on init
-    # Make foreground and background I/O priority different. none-to-rt was
-    # introduced in kernel 5.14. promote-to-rt was introduced in kernel 6.5.
-    # Write none-to-rt first and promote-to-rt next to support both older and
-    # newer kernel versions.
-    write /dev/blkio/blkio.prio.class none-to-rt
-    write /dev/blkio/blkio.prio.class promote-to-rt
-
 on property:ro.build.type=userdebug
     write /dev/sys/block/bootdevice/pixel/enable_pixel_ufs_logging 1
     chown system /dev/sg3
@@ -44,6 +36,13 @@
     write /dev/sys/block/bootdevice/clkgate_enable 0
 
 on property:sys.boot_completed=1
+    # Make foreground and background I/O priority different. none-to-rt was
+    # introduced in kernel 5.14. promote-to-rt was introduced in kernel 6.5.
+    # Write none-to-rt first and promote-to-rt next to support both older and
+    # newer kernel versions.
+    write /dev/blkio/blkio.prio.class none-to-rt
+    write /dev/blkio/blkio.prio.class promote-to-rt
+
     # Health Storage HAL
     chown system system /dev/sys/block/bootdevice/manual_gc
 
diff --git a/vibrator/flags/Android.bp b/vibrator/flags/Android.bp
new file mode 100644
index 0000000..0b36aee
--- /dev/null
+++ b/vibrator/flags/Android.bp
@@ -0,0 +1,43 @@
+//
+// Copyright (C) 2024 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.
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+aconfig_declarations {
+    name: "VibratorFlagsL26",
+    package: "vendor.vibrator.hal.flags",
+    container: "vendor",
+    exportable: true,
+    srcs: ["VibratorFlags.aconfig"],
+}
+
+cc_aconfig_library {
+    name: "PixelVibratorFlagsL26",
+    aconfig_declarations: "VibratorFlagsL26",
+    vendor_available: true,
+    visibility: [
+        "//vendor:__subpackages__",
+        "//device/google/felix:__subpackages__",
+    ],
+}
+
+java_aconfig_library {
+    name: "PixelVibratorFlagsL26_java",
+    aconfig_declarations: "VibratorFlagsL26",
+    mode: "exported",
+    visibility: ["//vendor:__subpackages__"],
+}
diff --git a/vibrator/flags/VibratorFlags.aconfig b/vibrator/flags/VibratorFlags.aconfig
new file mode 100644
index 0000000..ec6e2d4
--- /dev/null
+++ b/vibrator/flags/VibratorFlags.aconfig
@@ -0,0 +1,10 @@
+package: "vendor.vibrator.hal.flags"
+container: "vendor"
+
+flag {
+  name: "remove_capo"
+  namespace: "vibrator"
+  is_exported: true
+  description: "This flag controls the removal of utilizing Capo at the HAL level"
+  bug: "290223630"
+}