Merge "Introduce interrupts module for debug and trace" into main
diff --git a/gps/pixel/sepolicy/hal_gnss_pixel.te b/gps/pixel/sepolicy/hal_gnss_pixel.te
index e3e4d92..b9e1bd4 100644
--- a/gps/pixel/sepolicy/hal_gnss_pixel.te
+++ b/gps/pixel/sepolicy/hal_gnss_pixel.te
@@ -24,3 +24,6 @@
 # Allow access ssrdump information
 allow hal_gnss_pixel sscoredump_vendor_data_crashinfo_file:file r_file_perms;
 allow hal_gnss_pixel sscoredump_vendor_data_crashinfo_file:dir r_dir_perms;
+
+# Allow pixel gnss access vendor_gps_file
+allow hal_gnss_pixel vendor_gps_file:file create_file_perms;
diff --git a/gril/aidl/2.1/compatibility_matrix.xml b/gril/aidl/2.1/compatibility_matrix.xml
new file mode 100644
index 0000000..c1ce8f9
--- /dev/null
+++ b/gril/aidl/2.1/compatibility_matrix.xml
@@ -0,0 +1,10 @@
+<compatibility-matrix version="1.0" type="framework">
+    <hal format="aidl" optional="true">
+        <name>vendor.google.radio_ext</name>
+        <version>3</version>
+        <interface>
+            <name>IRadioExt</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</compatibility-matrix>
diff --git a/gril/aidl/2.1/gril_aidl.mk b/gril/aidl/2.1/gril_aidl.mk
new file mode 100644
index 0000000..d5bc3fc
--- /dev/null
+++ b/gril/aidl/2.1/gril_aidl.mk
@@ -0,0 +1,4 @@
+PRODUCT_PACKAGES += vendor.google.radioext@1.0-service
+DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/gril/aidl/2.1/compatibility_matrix.xml
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/aidl/2.1/sepolicy
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/common/sepolicy
diff --git a/gril/aidl/2.1/sepolicy/file_contexts b/gril/aidl/2.1/sepolicy/file_contexts
new file mode 100644
index 0000000..9973b80
--- /dev/null
+++ b/gril/aidl/2.1/sepolicy/file_contexts
@@ -0,0 +1 @@
+/vendor/bin/hw/vendor\.google\.radioext@1\.0-service                        u:object_r:hal_aidl_radio_ext_exec:s0
diff --git a/gril/aidl/2.1/sepolicy/grilservice_app.te b/gril/aidl/2.1/sepolicy/grilservice_app.te
new file mode 100644
index 0000000..812c8a2
--- /dev/null
+++ b/gril/aidl/2.1/sepolicy/grilservice_app.te
@@ -0,0 +1,4 @@
+# allow grilservice_app to find hal_radio_ext_service
+allow grilservice_app hal_radio_ext_service:service_manager find;
+binder_call(grilservice_app, hal_aidl_radio_ext)
+binder_call(grilservice_app, twoshay)
diff --git a/gril/aidl/2.1/sepolicy/hal_aidl_radio_ext.te b/gril/aidl/2.1/sepolicy/hal_aidl_radio_ext.te
new file mode 100644
index 0000000..eaff153
--- /dev/null
+++ b/gril/aidl/2.1/sepolicy/hal_aidl_radio_ext.te
@@ -0,0 +1,36 @@
+# hal_aidl_radio_ext domain
+type hal_aidl_radio_ext, domain;
+type hal_aidl_radio_ext_exec, vendor_file_type, exec_type, file_type;
+
+init_daemon_domain(hal_aidl_radio_ext)
+
+get_prop(hal_aidl_radio_ext, hwservicemanager_prop)
+get_prop(hal_aidl_radio_ext, telephony_modemtype_prop)
+set_prop(hal_aidl_radio_ext, vendor_gril_prop)
+
+binder_call(hal_aidl_radio_ext, servicemanager)
+binder_call(hal_aidl_radio_ext, grilservice_app)
+binder_call(hal_aidl_radio_ext, hal_bluetooth_btlinux)
+
+add_service(hal_aidl_radio_ext, hal_radio_ext_service)
+
+# RW /dev/oem_ipc0
+allow hal_aidl_radio_ext radio_device:chr_file rw_file_perms;
+
+# RW MIPI Freq files
+allow hal_aidl_radio_ext radio_vendor_data_file:dir create_dir_perms;
+allow hal_aidl_radio_ext radio_vendor_data_file:file create_file_perms;
+
+# Bluetooth
+allow hal_aidl_radio_ext hal_bluetooth_coexistence_hwservice:hwservice_manager find;
+allow hal_aidl_radio_ext hal_bluetooth_coexistence_service:service_manager find;
+
+# Allow access to the backlight driver to set ssc_mode
+allow hal_aidl_radio_ext sysfs_leds:dir search;
+allow hal_aidl_radio_ext sysfs_leds:file rw_file_perms;
+
+# legacy/zuma/vendor
+allow hal_aidl_radio_ext sysfs_display:file rw_file_perms;
+
+# Allow access to read display port info
+allow hal_aidl_radio_ext sysfs:file r_file_perms;
diff --git a/gril/aidl/2.1/sepolicy/hal_camera_default.te b/gril/aidl/2.1/sepolicy/hal_camera_default.te
new file mode 100644
index 0000000..61f8001
--- /dev/null
+++ b/gril/aidl/2.1/sepolicy/hal_camera_default.te
@@ -0,0 +1,2 @@
+# allow hal_camera_default to binder call hal_aidl_radio_ext
+binder_call(hal_camera_default, hal_aidl_radio_ext);
diff --git a/gril/aidl/2.1/sepolicy/twoshay.te b/gril/aidl/2.1/sepolicy/twoshay.te
new file mode 100644
index 0000000..f7d3fe1
--- /dev/null
+++ b/gril/aidl/2.1/sepolicy/twoshay.te
@@ -0,0 +1,2 @@
+# allow twoshay to binder call hal_aidl_radio_ext
+binder_call(twoshay, hal_aidl_radio_ext)
diff --git a/gxp/sepolicy/edgetpu_tachyon_service.te b/gxp/sepolicy/edgetpu_tachyon_service.te
index 35987dd..31b7e7b 100644
--- a/gxp/sepolicy/edgetpu_tachyon_service.te
+++ b/gxp/sepolicy/edgetpu_tachyon_service.te
@@ -1,3 +1,7 @@
 # Allow Tachyon service to access the GXP device and read GXP properties.
 allow edgetpu_tachyon_server gxp_device:chr_file rw_file_perms;
 get_prop(edgetpu_tachyon_server, vendor_gxp_prop)
+
+# Allow tachyon service to log to stats service for reporting metrics.
+allow edgetpu_tachyon_server fwk_stats_service:service_manager find;
+binder_call(edgetpu_tachyon_server, system_server);
diff --git a/mediacodec/vpu/sepolicy/mediacodec_google.te b/mediacodec/vpu/sepolicy/mediacodec_google.te
index 99a3c8d..cf9dfc5 100644
--- a/mediacodec/vpu/sepolicy/mediacodec_google.te
+++ b/mediacodec/vpu/sepolicy/mediacodec_google.te
@@ -13,6 +13,7 @@
 
 allow mediacodec_google dmabuf_system_heap_device:chr_file r_file_perms;
 allow mediacodec_google video_device:chr_file { read write open ioctl map };
+allow mediacodec_google gpu_device:chr_file rw_file_perms;
 
 # mediacodec_google should never execute any executable without a domain transition
 neverallow mediacodec_google { file_type fs_type }:file execute_no_trans;
diff --git a/performance/Android.bp b/performance/Android.bp
index 5c0e0b2..6dae537 100644
--- a/performance/Android.bp
+++ b/performance/Android.bp
@@ -5,7 +5,10 @@
 cc_binary {
     name: "dump_perf",
     srcs: ["dump_perf.cpp"],
-    init_rc: ["init.pixel-mm-gs.rc"],
+    init_rc: [
+        "init.pixel-mm-gs.rc",
+        "init.pixel-perf.rc",
+    ],
     cflags: [
         "-Wall",
         "-Wextra",
diff --git a/performance/init.pixel-perf.rc b/performance/init.pixel-perf.rc
new file mode 100644
index 0000000..36c487f
--- /dev/null
+++ b/performance/init.pixel-perf.rc
@@ -0,0 +1,45 @@
+# 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.
+
+on init
+    # cpufreq governor setting
+    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor sched_pixel
+    write /sys/devices/system/cpu/cpu8/cpufreq/scaling_governor sched_pixel
+
+    write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu1/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu2/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu3/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu5/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu7/cpufreq/sched_pixel/up_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu8/cpufreq/sched_pixel/up_rate_limit_us 500
+
+    write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu1/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu2/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu3/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu5/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu7/cpufreq/sched_pixel/down_rate_limit_us 500
+    write /sys/devices/system/cpu/cpu8/cpufreq/sched_pixel/down_rate_limit_us 500
diff --git a/storage/init.storage.rc b/storage/init.storage.rc
index 9e4acd4..943c483 100644
--- a/storage/init.storage.rc
+++ b/storage/init.storage.rc
@@ -42,10 +42,13 @@
 
     # UFS
     write /dev/sys/block/bootdevice/clkgate_enable 0
+    write /dev/sys/block/bootdevice/wb_on 0
+    write /dev/sys/block/bootdevice/enable_wb_buf_flush 0
 
 on property:sys.boot_completed=1
     # Health Storage HAL
     chown system system /dev/sys/block/bootdevice/manual_gc
+    write /dev/sys/block/bootdevice/manual_gc 0
 
     # Pixelstats
     chown system system /dev/sys/block/bootdevice/slowio_read_cnt