Merge "Allow command line tools to access Tachyon service in user builds." into main
diff --git a/audio/aidl.mk b/audio/aidl.mk
index 7dd56bc..68458dd 100644
--- a/audio/aidl.mk
+++ b/audio/aidl.mk
@@ -16,7 +16,11 @@
libhapticgeneratoraidl \
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/aidl
-BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio
+ifeq ($(AUDIO_USE_DPTX_SEPOLICY),true)
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio/dptx
+else
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio/drmdp
+endif
include device/google/gs-common/audio/common.mk
diff --git a/audio/hidl_zuma.mk b/audio/hidl_zuma.mk
index 6fb3449..64ad2ba 100644
--- a/audio/hidl_zuma.mk
+++ b/audio/hidl_zuma.mk
@@ -42,7 +42,7 @@
endif
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hidl
-BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio/drmdp
include device/google/gs-common/audio/common.mk
diff --git a/audio/sepolicy/hdmi_audio/dptx/genfs_contexts b/audio/sepolicy/hdmi_audio/dptx/genfs_contexts
new file mode 100644
index 0000000..64803be
--- /dev/null
+++ b/audio/sepolicy/hdmi_audio/dptx/genfs_contexts
@@ -0,0 +1 @@
+genfscon sysfs /devices/platform/dwc_dptx-audio/extcon/hdmi_audio u:object_r:sysfs_extcon:s0
diff --git a/audio/sepolicy/hdmi_audio/genfs_contexts b/audio/sepolicy/hdmi_audio/drmdp/genfs_contexts
similarity index 100%
rename from audio/sepolicy/hdmi_audio/genfs_contexts
rename to audio/sepolicy/hdmi_audio/drmdp/genfs_contexts
diff --git a/camera/lyric.mk b/camera/lyric.mk
index c886138..0ec1d6d 100644
--- a/camera/lyric.mk
+++ b/camera/lyric.mk
@@ -20,8 +20,20 @@
# All shipping releases will switch to prebuilts (trunk+)
# if this condition is not true, then build from source.
-ifneq ($(RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT),true)
+# Fallback if the prebuilts directory does not exist, then we must
+# build from source no matter what, so we log a warning
+ifeq ($(RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT),true)
+ ifeq ($(wildcard vendor/google/services/LyricCameraHAL/prebuilt),)
+ $(warning Lyric prebuilt directory is missing, it will be built from source)
+ BUILD_LYRIC_FROM_SOURCE := true
+ else
+ BUILD_LYRIC_FROM_SOURCE := false
+ endif
+else
+ BUILD_LYRIC_FROM_SOURCE := true
+endif # RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT
+ifeq ($(BUILD_LYRIC_FROM_SOURCE),true)
PRODUCT_SOONG_NAMESPACES += \
vendor/google/camera \
vendor/google/camera/google_3a/libs_v4 \
@@ -41,7 +53,7 @@
# Calibration tool for debug builds
PRODUCT_PACKAGES_DEBUG += tarasque_test
PRODUCT_PACKAGES_DEBUG += ProtoCalibGenerator
-endif # RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT check
+endif # BUILD_LYRIC_FROM_SOURCE
# Init-time log settings for Google 3A
PRODUCT_PACKAGES += libg3a_standalone_gabc_rc
diff --git a/camera/lyric_soong_variables.md b/camera/lyric_soong_variables.md
index b442943..4289109 100644
--- a/camera/lyric_soong_variables.md
+++ b/camera/lyric_soong_variables.md
@@ -44,3 +44,13 @@
$(call soong_config_set,google3a_config,target_device,oriole)
```
A mixture of `camera_hardware` and `tuning_product` used by 3A.
+
+## `radioext_interface_type`
+
+Example:
+```
+$(call soong_config_set,lyric,radioext_interface_type,aidl)
+```
+Specifies which interface type to use in the RadioExt client when communicating
+with the RadioExt service. The possible values are "hidl" and "aidl".
+Devices launching with Android 15 no longer support HIDL.
diff --git a/chre/sepolicy/hal_contexthub_default.te b/chre/sepolicy/hal_contexthub_default.te
index 87e3a42..50e7ca3 100644
--- a/chre/sepolicy/hal_contexthub_default.te
+++ b/chre/sepolicy/hal_contexthub_default.te
@@ -35,3 +35,6 @@
# Allow binder calls with clients
binder_call(hal_contexthub_default, hal_sensors_default)
+
+# Allow access for AoC properties.
+get_prop(hal_contexthub_default, vendor_aoc_prop)
diff --git a/dump_chip_info/dump_chip_info.cpp b/dump_chip_info/dump_chip_info.cpp
index dd83743..bbd0065 100644
--- a/dump_chip_info/dump_chip_info.cpp
+++ b/dump_chip_info/dump_chip_info.cpp
@@ -19,6 +19,10 @@
int main() {
dumpFileContent("ap_rom_patch_ver", "/sys/devices/system/goog-chip-info/ap_rom_patch_ver");
dumpFileContent("gpcm_asic_id", "/sys/devices/system/goog-chip-info/gpcm_asic_id");
+ dumpFileContent("device_table", "/sys/devices/system/goog-chip-info/device_table");
+ dumpFileContent("dvfs_table", "/sys/devices/system/goog-chip-info/dvfs_table");
+ dumpFileContent("hw_feature_table", "/sys/devices/system/goog-chip-info/hw_feature_table");
+ dumpFileContent("ids_table", "/sys/devices/system/goog-chip-info/ids_table");
return 0;
}
diff --git a/dump_chip_info/sepolicy/genfs_contexts b/dump_chip_info/sepolicy/genfs_contexts
index 3fda2de..ce42be1 100644
--- a/dump_chip_info/sepolicy/genfs_contexts
+++ b/dump_chip_info/sepolicy/genfs_contexts
@@ -1,2 +1,6 @@
genfscon sysfs /devices/system/goog-chip-info/ap_rom_patch_ver u:object_r:sysfs_chip_info:s0
genfscon sysfs /devices/system/goog-chip-info/gpcm_asic_id u:object_r:sysfs_chip_info:s0
+genfscon sysfs /devices/system/goog-chip-info/device_table u:object_r:sysfs_chip_info:s0
+genfscon sysfs /devices/system/goog-chip-info/dvfs_table u:object_r:sysfs_chip_info:s0
+genfscon sysfs /devices/system/goog-chip-info/hw_feature_table u:object_r:sysfs_chip_info:s0
+genfscon sysfs /devices/system/goog-chip-info/ids_table u:object_r:sysfs_chip_info:s0
diff --git a/esim/esim.mk b/esim/esim.mk
index 47e21b7..487f15e 100644
--- a/esim/esim.mk
+++ b/esim/esim.mk
@@ -1,5 +1,10 @@
+## Configuration for eSIM bootstrap
+
+# Enable eSIM bootstrap by default
+PRODUCT_PRODUCT_PROPERTIES += setupwizard.feature.provisioning_profile_mode=true
+
+# init.rc and sepolcy to conditionally disable eSIM bootstrap
PRODUCT_PACKAGES += init.esim-gs.rc
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/esim/sepolicy/vendor
-# system_ext
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/esim/sepolicy/system_ext/public
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/esim/sepolicy/system_ext/private
diff --git a/gcam_app/sepolicy/product/private/debug_camera_app.te b/gcam_app/sepolicy/product/private/debug_camera_app.te
index 4402e55..9d4643d 100644
--- a/gcam_app/sepolicy/product/private/debug_camera_app.te
+++ b/gcam_app/sepolicy/product/private/debug_camera_app.te
@@ -1,28 +1,16 @@
# GCANext and GCAEng.
-# b/363018500
typeattribute debug_camera_app coredomain;
userdebug_or_eng(`
app_domain(debug_camera_app)
net_domain(debug_camera_app)
- allow debug_camera_app activity_service:service_manager find;
- allow debug_camera_app activity_task_service:service_manager find;
+ allow debug_camera_app app_api_service:service_manager find;
allow debug_camera_app audioserver_service:service_manager find;
- allow debug_camera_app batterystats_service:service_manager find;
allow debug_camera_app cameraserver_service:service_manager find;
- allow debug_camera_app device_policy_service:service_manager find;
- allow debug_camera_app device_state_service:service_manager find;
- allow debug_camera_app gpu_service:service_manager find;
allow debug_camera_app mediaextractor_service:service_manager find;
allow debug_camera_app mediametrics_service:service_manager find;
allow debug_camera_app mediaserver_service:service_manager find;
- allow debug_camera_app powerstats_service:service_manager find;
- allow debug_camera_app sensorservice_service:service_manager find;
- allow debug_camera_app thermal_service:service_manager find;
- allow debug_camera_app trust_service:service_manager find;
- allow debug_camera_app vibrator_manager_service:service_manager find;
- allow debug_camera_app virtual_device_native_service:service_manager find;
# Allows GCA_Eng & GCA-Next to access the PowerHAL.
hal_client_domain(debug_camera_app, hal_power)
diff --git a/gcam_app/sepolicy/vendor/google_camera_app.te b/gcam_app/sepolicy/vendor/google_camera_app.te
index 81f91ac..a1c3ddb 100644
--- a/gcam_app/sepolicy/vendor/google_camera_app.te
+++ b/gcam_app/sepolicy/vendor/google_camera_app.te
@@ -1,12 +1,12 @@
# GCARelease and GCADogfood.
# Allows GCA to acccess the GXP device & properties.
-#allow google_camera_app gxp_device:chr_file rw_file_perms;
+allow google_camera_app gxp_device:chr_file rw_file_perms;
get_prop(google_camera_app, vendor_gxp_prop)
# Allows GCA to find and access the EdgeTPU.
-#allow google_camera_app edgetpu_app_service:service_manager find;
-#allow google_camera_app edgetpu_device:chr_file { getattr read write ioctl map };
+allow google_camera_app edgetpu_app_service:service_manager find;
+allow google_camera_app edgetpu_device:chr_file { read write ioctl };
# Allows GCA to access the hw_jpeg /dev/video12.
#allow google_camera_app hw_jpg_device:chr_file rw_file_perms;
diff --git a/gps/dump/dump_gps.cpp b/gps/dump/dump_gps.cpp
index e073732..7906a1f 100644
--- a/gps/dump/dump_gps.cpp
+++ b/gps/dump/dump_gps.cpp
@@ -17,6 +17,7 @@
#include <android-base/properties.h>
#include <dirent.h>
#include <dump/pixel_dump.h>
+#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -66,6 +67,58 @@
return;
}
+int compareFileExtensions(const struct dirent **a, const struct dirent **b) {
+ int num_a, num_b;
+ sscanf((*a)->d_name, "rawbinlog.out.%d", &num_a);
+ sscanf((*b)->d_name, "rawbinlog.out.%d", &num_b);
+
+ return num_a - num_b;
+}
+
+void dumpLogsAscending(const char* SrcDir, const char* DestDir, int limit, const char* prefix) {
+
+ struct dirent **dirent_list = NULL;
+ int num_entries = scandir(SrcDir, &dirent_list, 0, (int (*)(const struct dirent **, const struct dirent **)) alphasort);
+ if (!dirent_list) {
+ printf("Unable to scan dir: %s.\n", SrcDir);
+ return;
+ } else if (num_entries <= 0) {
+ printf("No file is found.\n");
+ return;
+ }
+
+ if (access(DestDir, R_OK)) {
+ printf("Unable to find folder: %s\n", DestDir);
+ return;
+ }
+
+ qsort(dirent_list, num_entries, sizeof(struct dirent *), (int (*)(const void *, const void *)) compareFileExtensions);
+
+ int copiedFiles = 0;
+
+ for (int i = 0 ; i < num_entries; i++) {
+
+ if (0 != strncmp(dirent_list[i]->d_name, prefix, strlen(prefix))) {
+ continue;
+ }
+
+ if ((copiedFiles >= limit) && (limit != -1)) {
+ printf("Skipped %s\n", dirent_list[i]->d_name);
+ continue;
+ }
+
+ copiedFiles++;
+ copyFile(concatenatePath(SrcDir, dirent_list[i]->d_name).c_str(), concatenatePath(DestDir, dirent_list[i]->d_name).c_str());
+ }
+
+ while (num_entries--) {
+ free(dirent_list[num_entries]);
+ }
+
+ free(dirent_list);
+ return;
+}
+
int main() {
if(!::android::base::GetBoolProperty("vendor.gps.aol.enabled", false)) {
printf("vendor.gps.aol.enabled is false. gps logging is not running.\n");
@@ -85,9 +138,8 @@
if (access(GPS_VENDOR_CHIP_INFO, F_OK) == 0) {
copyFile(GPS_VENDOR_CHIP_INFO, concatenatePath(outputDir.c_str(), "chip.info").c_str());
}
- dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, GPS_RAWLOG_PREFIX);
+ dumpLogsAscending(GPS_LOG_DIRECTORY, outputDir.c_str(), 5, GPS_RAWLOG_PREFIX);
dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 18, GPS_MEMDUMP_LOG_PREFIX);
copyDirectory(GPS_RESOURCE_DIRECTORY, concatenatePath(outputDir.c_str(), "resource"));
return 0;
}
-
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/gril/hidl/1.7/sepolicy/grilservice_app.te b/gril/hidl/1.7/sepolicy/grilservice_app.te
index 3a170b8..fd20fb4 100644
--- a/gril/hidl/1.7/sepolicy/grilservice_app.te
+++ b/gril/hidl/1.7/sepolicy/grilservice_app.te
@@ -2,3 +2,5 @@
allow grilservice_app hal_radio_ext_service:service_manager find;
# allow grilservice_app to binder call hal_radioext_default
binder_call(grilservice_app, hal_radioext_default)
+# allow grilservice_app to binder call twoshay
+binder_call(grilservice_app, twoshay)
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/input/gia/aidl/compatibility_matrix.xml b/input/gia/aidl/compatibility_matrix.xml
new file mode 100644
index 0000000..1a348ea
--- /dev/null
+++ b/input/gia/aidl/compatibility_matrix.xml
@@ -0,0 +1,10 @@
+<compatibility-matrix type="framework" version="1.0">
+ <hal format="aidl" optional="true">
+ <name>com.google.input.gia.core</name>
+ <interface>
+ <name>IGiaService</name>
+ <instance>default</instance>
+ </interface>
+ <version>1</version>
+ </hal>
+</compatibility-matrix>
\ No newline at end of file
diff --git a/input/gia/aidl/manifest.xml b/input/gia/aidl/manifest.xml
new file mode 100644
index 0000000..98303c8
--- /dev/null
+++ b/input/gia/aidl/manifest.xml
@@ -0,0 +1,10 @@
+<manifest type="device" version="1.0">
+ <hal format="aidl" optional="true">
+ <name>com.google.input.gia.core</name>
+ <interface>
+ <name>IGiaService</name>
+ <instance>default</instance>
+ </interface>
+ <version>1</version>
+ </hal>
+</manifest>
\ No newline at end of file
diff --git a/input/gia/gia.mk b/input/gia/gia.mk
new file mode 100644
index 0000000..ea079ca
--- /dev/null
+++ b/input/gia/gia.mk
@@ -0,0 +1,11 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/input/gia/sepolicy
+
+PRODUCT_PACKAGES += gia
+PRODUCT_PACKAGES += com.google.input.gia.giaservicemanager
+
+PRODUCT_SOONG_NAMESPACES += vendor/google/interfaces
+PRODUCT_SOONG_NAMESPACES += vendor/google/input/gia/core
+PRODUCT_SOONG_NAMESPACES += vendor/google/input/gia/core-servicemanager
+
+DEVICE_MANIFEST_FILE += device/google/gs-common/input/gia/aidl/manifest.xml
+DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/input/gia/aidl/compatibility_matrix.xml
diff --git a/input/gia/sepolicy/attributes b/input/gia/sepolicy/attributes
new file mode 100644
index 0000000..1d61ad3
--- /dev/null
+++ b/input/gia/sepolicy/attributes
@@ -0,0 +1,2 @@
+# This macro produces: define hal_gia, hal_gia_client, hal_gia_server
+hal_attribute(gia)
diff --git a/input/gia/sepolicy/file_contexts b/input/gia/sepolicy/file_contexts
new file mode 100644
index 0000000..99d6857
--- /dev/null
+++ b/input/gia/sepolicy/file_contexts
@@ -0,0 +1,2 @@
+# chmod +x in SEPolicy language
+/vendor/bin/gia u:object_r:gia_exec:s0
diff --git a/input/gia/sepolicy/gia.te b/input/gia/sepolicy/gia.te
new file mode 100644
index 0000000..2c84e7c
--- /dev/null
+++ b/input/gia/sepolicy/gia.te
@@ -0,0 +1,18 @@
+# SEPolicies for GIA (Google Input interface Abstraction layer)
+type gia, domain;
+type gia_exec, exec_type, vendor_file_type, file_type;
+
+# Macro transferring gia_exec to the gia domain
+init_daemon_domain(gia)
+
+# let this domain use the hal service
+hal_client_domain(gia, hal_gia)
+# allow binder communication with service_manager
+binder_use(gia)
+
+# let this domain serve the hal service
+hal_server_domain(gia, hal_gia)
+
+# allow gia for accessing touch related system file-nodes
+allow gia sysfs_touch_gti:dir r_dir_perms;
+allow gia sysfs_touch_gti:file rw_file_perms;
diff --git a/input/gia/sepolicy/hal_gia.te b/input/gia/sepolicy/hal_gia.te
new file mode 100644
index 0000000..b75c9fb
--- /dev/null
+++ b/input/gia/sepolicy/hal_gia.te
@@ -0,0 +1,8 @@
+# allow binder connection from client to server
+binder_call(hal_gia_client, hal_gia_server)
+
+# allow client to find the service & allow server to register the service
+hal_attribute_service(hal_gia, hal_gia_service)
+
+# allow binder communication from server to service_manager
+binder_use(hal_gia_server)
diff --git a/input/gia/sepolicy/service.te b/input/gia/sepolicy/service.te
new file mode 100644
index 0000000..aed1135
--- /dev/null
+++ b/input/gia/sepolicy/service.te
@@ -0,0 +1,2 @@
+# Declares GIA related services
+type hal_gia_service, hal_service_type, protected_service, service_manager_type;
diff --git a/input/gia/sepolicy/service_contexts b/input/gia/sepolicy/service_contexts
new file mode 100644
index 0000000..b1773ec
--- /dev/null
+++ b/input/gia/sepolicy/service_contexts
@@ -0,0 +1,2 @@
+# Attaches GIA services to the cooresponding SEPolicy group
+com.google.input.gia.core.IGiaService/default u:object_r:hal_gia_service:s0
diff --git a/interrupts/Android.bp b/interrupts/Android.bp
new file mode 100644
index 0000000..a4f62bc
--- /dev/null
+++ b/interrupts/Android.bp
@@ -0,0 +1,21 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_binary {
+ name: "dump_interrupts_traces",
+ srcs: ["traces/dump_interrupts_traces.cpp"],
+ init_rc: ["init.interrupts.rc"],
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libbase",
+ "libdump",
+ "liblog",
+ ],
+ vendor: true,
+ relative_install_path: "dump",
+}
diff --git a/interrupts/init.interrupts.rc b/interrupts/init.interrupts.rc
new file mode 100644
index 0000000..9492fdc
--- /dev/null
+++ b/interrupts/init.interrupts.rc
@@ -0,0 +1,23 @@
+on init
+ # Create the directory for the trace instance during early init
+ mkdir /sys/kernel/tracing/instances/irq_gia_google 0755 root root
+ chown system system /sys/kernel/tracing/instances/irq_gia_google
+ chown system system /sys/kernel/tracing/instances/irq_gia_google/trace
+
+ # Enable gia events
+ write /sys/kernel/tracing/instances/irq_gia_google/events/irq_gia/enable 1
+
+ # There are some very high frequency IRQ events happening all the time. Tracing
+ # them is not absolute necessity, but a flood of them is noise for more interesting
+ # events that we want to capture. All these high frequency IRQs have virq < 11.
+ write /sys/kernel/tracing/instances/irq_gia_google/events/irq/filter "irq > 11"
+ write /sys/kernel/tracing/instances/irq_gia_google/events/irq/irq_handler_entry/enable 1
+ write /sys/kernel/tracing/instances/irq_gia_google/events/irq/irq_handler_exit/enable 1
+
+ # Keep the buffer size small. This size is practically enough for debug purpose.
+ # Having low size helps because this entire buffer gets dumped in bugreport.
+ # Having a large size can impact bugreport size and time it takes to pack/unpack.
+ write /sys/kernel/tracing/instances/irq_gia_google/buffer_size_kb 512
+
+ # Go!
+ write /sys/kernel/tracing/instances/irq_gia_google/tracing_on 1
diff --git a/interrupts/interrupts.mk b/interrupts/interrupts.mk
new file mode 100644
index 0000000..bf14f97
--- /dev/null
+++ b/interrupts/interrupts.mk
@@ -0,0 +1,3 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/interrupts/traces/sepolicy
+
+PRODUCT_PACKAGES += dump_interrupts_traces
diff --git a/interrupts/traces/dump_interrupts_traces.cpp b/interrupts/traces/dump_interrupts_traces.cpp
new file mode 100644
index 0000000..da747a3
--- /dev/null
+++ b/interrupts/traces/dump_interrupts_traces.cpp
@@ -0,0 +1,30 @@
+/*
+ * Copyright 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.
+ */
+#include <dump/pixel_dump.h>
+#include <android-base/file.h>
+
+int main() {
+ std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "interrupts");
+ if (mkdir(outputDir.c_str(), 0777) == -1) {
+ printf("Unable to create folder: %s\n", outputDir.c_str());
+ return 0;
+ }
+
+ copyFile("/sys/kernel/tracing/instances/irq_gia_google/trace",
+ concatenatePath(outputDir.c_str(), "interrupts_trace").c_str());
+
+ return 0;
+}
diff --git a/interrupts/traces/sepolicy/dump_interrupts_traces.te b/interrupts/traces/sepolicy/dump_interrupts_traces.te
new file mode 100644
index 0000000..bc3952a
--- /dev/null
+++ b/interrupts/traces/sepolicy/dump_interrupts_traces.te
@@ -0,0 +1,7 @@
+#
+pixel_bugreport(dump_interrupts_traces)
+
+allow dump_interrupts_traces radio_vendor_data_file:dir { search add_name create write };
+allow dump_interrupts_traces radio_vendor_data_file:file { getattr create write open };
+allow dump_interrupts_traces debugfs_tracing_instances:dir search;
+allow dump_interrupts_traces tracefs_instances_interrupts:file { getattr read open };
diff --git a/interrupts/traces/sepolicy/file.te b/interrupts/traces/sepolicy/file.te
new file mode 100644
index 0000000..4decea9
--- /dev/null
+++ b/interrupts/traces/sepolicy/file.te
@@ -0,0 +1,2 @@
+#
+type tracefs_instances_interrupts, sysfs_type, fs_type;
diff --git a/interrupts/traces/sepolicy/file_contexts b/interrupts/traces/sepolicy/file_contexts
new file mode 100644
index 0000000..5a010e9
--- /dev/null
+++ b/interrupts/traces/sepolicy/file_contexts
@@ -0,0 +1 @@
+/vendor/bin/dump/dump_interrupts_traces u:object_r:dump_interrupts_traces_exec:s0
diff --git a/interrupts/traces/sepolicy/genfs_contexts b/interrupts/traces/sepolicy/genfs_contexts
new file mode 100644
index 0000000..70223b7
--- /dev/null
+++ b/interrupts/traces/sepolicy/genfs_contexts
@@ -0,0 +1 @@
+genfscon tracefs /instances/irq_gia_google/trace u:object_r:tracefs_instances_interrupts:s0
diff --git a/mailbox/Android.bp b/mailbox/Android.bp
new file mode 100644
index 0000000..6969685
--- /dev/null
+++ b/mailbox/Android.bp
@@ -0,0 +1,21 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_binary {
+ name: "dump_mailbox",
+ srcs: ["dump/dump_mailbox.cpp"],
+ init_rc: ["init.mailbox.rc"],
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libbase",
+ "libdump",
+ "liblog",
+ ],
+ vendor: true,
+ relative_install_path: "dump",
+}
diff --git a/mailbox/dump/dump_mailbox.cpp b/mailbox/dump/dump_mailbox.cpp
new file mode 100644
index 0000000..8f63b30
--- /dev/null
+++ b/mailbox/dump/dump_mailbox.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright 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.
+ */
+#include <dump/pixel_dump.h>
+#include <android-base/file.h>
+
+int main() {
+ std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "mailbox");
+ if (mkdir(outputDir.c_str(), 0777) == -1) {
+ printf("Unable to create folder: %s\n", outputDir.c_str());
+ return 0;
+ }
+
+ copyFile("/sys/kernel/tracing/instances/goog_cpm_mailbox/trace",
+ concatenatePath(outputDir.c_str(), "goog_cpm_mailbox_trace").c_str());
+ copyFile("/sys/kernel/tracing/instances/goog_nq_mailbox/trace",
+ concatenatePath(outputDir.c_str(), "goog_nq_mailbox_trace").c_str());
+
+ return 0;
+}
diff --git a/mailbox/dump/sepolicy/dump_mailbox.te b/mailbox/dump/sepolicy/dump_mailbox.te
new file mode 100644
index 0000000..64f184c
--- /dev/null
+++ b/mailbox/dump/sepolicy/dump_mailbox.te
@@ -0,0 +1,7 @@
+#
+pixel_bugreport(dump_mailbox)
+allow dump_mailbox radio_vendor_data_file:dir create_dir_perms;
+allow dump_mailbox radio_vendor_data_file:file create_file_perms;
+allow dump_mailbox debugfs_tracing_instances:file r_file_perms;
+allow dump_mailbox debugfs_tracing_instances:dir search;
+allow dump_mailbox debugfs_tracing_instances_mailbox:file r_file_perms;
diff --git a/mailbox/dump/sepolicy/file.te b/mailbox/dump/sepolicy/file.te
new file mode 100644
index 0000000..5bb7bc4
--- /dev/null
+++ b/mailbox/dump/sepolicy/file.te
@@ -0,0 +1,2 @@
+#
+type debugfs_tracing_instances_mailbox, sysfs_type, fs_type;
diff --git a/mailbox/dump/sepolicy/file_contexts b/mailbox/dump/sepolicy/file_contexts
new file mode 100644
index 0000000..b9bea15
--- /dev/null
+++ b/mailbox/dump/sepolicy/file_contexts
@@ -0,0 +1 @@
+/vendor/bin/dump/dump_mailbox u:object_r:dump_mailbox_exec:s0
diff --git a/mailbox/dump/sepolicy/genfs_contexts b/mailbox/dump/sepolicy/genfs_contexts
new file mode 100644
index 0000000..0bac5e8
--- /dev/null
+++ b/mailbox/dump/sepolicy/genfs_contexts
@@ -0,0 +1,2 @@
+genfscon tracefs /instances/goog_cpm_mailbox/trace u:object_r:debugfs_tracing_instances_mailbox:s0
+genfscon tracefs /instances/goog_nq_mailbox/trace u:object_r:debugfs_tracing_instances_mailbox:s0
diff --git a/mailbox/init.mailbox.rc b/mailbox/init.mailbox.rc
new file mode 100644
index 0000000..7659290
--- /dev/null
+++ b/mailbox/init.mailbox.rc
@@ -0,0 +1,8 @@
+on property:sys.boot_completed=1
+ chown system system /sys/kernel/tracing/instances/goog_cpm_mailbox
+ chown system system /sys/kernel/tracing/instances/goog_cpm_mailbox/trace
+ write /sys/kernel/tracing/instances/goog_cpm_mailbox/buffer_size_kb 512
+
+ chown system system /sys/kernel/tracing/instances/goog_nq_mailbox
+ chown system system /sys/kernel/tracing/instances/goog_nq_mailbox/trace
+ write /sys/kernel/tracing/instances/goog_nq_mailbox/buffer_size_kb 512
diff --git a/mailbox/mailbox.mk b/mailbox/mailbox.mk
new file mode 100644
index 0000000..aeefb9a
--- /dev/null
+++ b/mailbox/mailbox.mk
@@ -0,0 +1,3 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/mailbox/dump/sepolicy
+
+PRODUCT_PACKAGES += dump_mailbox
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 77057cd..943c483 100644
--- a/storage/init.storage.rc
+++ b/storage/init.storage.rc
@@ -1,3 +1,11 @@
+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
@@ -34,17 +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
- # 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
+ write /dev/sys/block/bootdevice/manual_gc 0
# Pixelstats
chown system system /dev/sys/block/bootdevice/slowio_read_cnt
diff --git a/widevine/sepolicy/hal_drm_widevine.te b/widevine/sepolicy/hal_drm_widevine.te
index 9b4792e..98b49e6 100644
--- a/widevine/sepolicy/hal_drm_widevine.te
+++ b/widevine/sepolicy/hal_drm_widevine.te
@@ -10,4 +10,5 @@
allow hal_drm_widevine mediadrm_vendor_data_file:dir create_dir_perms;
#L1
-#TODO(snehalreddy@) : Add L1 permissions
+allow hal_drm_widevine dmabuf_system_heap_device:chr_file r_file_perms;
+