diff --git a/aoc/aoc.mk b/aoc/aoc.mk index 136bb42..9ee4517 100644 --- a/aoc/aoc.mk +++ b/aoc/aoc.mk @@ -4,12 +4,6 @@ PRODUCT_PACKAGES += dump_aoc \ aocd \ aocxd -ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) -# IAudioMetricExt HIDL -PRODUCT_PACKAGES += \ - vendor.google.audiometricext@1.0-service-vendor -endif - # If AoC Daemon is not present on this build, load firmware at boot via rc ifeq ($(wildcard vendor/google/whitechapel/aoc/aocd),) PRODUCT_COPY_FILES += \ 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 11f01c7..570c5d4 100644 --- a/audio/aidl/device_framework_matrix_product.xml +++ b/audio/aidl/device_framework_matrix_product.xml @@ -1,12 +1,4 @@ - - vendor.google.audiometricext - 1.0 - - IAudioMetricExt - default - - vendor.google.whitechapel.audio.extension 4 diff --git a/audio/aidl/manifest.xml b/audio/aidl/manifest.xml index 237aa4a..daeb1c4 100644 --- a/audio/aidl/manifest.xml +++ b/audio/aidl/manifest.xml @@ -1,11 +1,2 @@ - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - diff --git a/audio/hidl_gs101.mk b/audio/hidl_gs101.mk index f764e7a..4ccbbfb 100644 --- a/audio/hidl_gs101.mk +++ b/audio/hidl_gs101.mk @@ -32,8 +32,14 @@ PRODUCT_PACKAGES += \ libamcsextfile \ audio_amcs_ext \ +ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) +# IAudioMetricExt HIDL +PRODUCT_PACKAGES += \ + vendor.google.audiometricext@1.0-service-vendor +endif + BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hidl include device/google/gs-common/audio/common.mk -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/audio/hidl/device_framework_matrix_product_gs101.xml +DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/audio/hidl/device_framework_matrix_product_gs101.xml \ No newline at end of file diff --git a/audio/hidl_gs201.mk b/audio/hidl_gs201.mk index 1438b27..c183b9a 100644 --- a/audio/hidl_gs201.mk +++ b/audio/hidl_gs201.mk @@ -32,6 +32,12 @@ PRODUCT_PACKAGES += \ audio_spk_35l41 \ sound_trigger.primary.$(TARGET_BOARD_PLATFORM) +ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) +# IAudioMetricExt HIDL +PRODUCT_PACKAGES += \ + vendor.google.audiometricext@1.0-service-vendor +endif + BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hidl include device/google/gs-common/audio/common.mk diff --git a/audio/hidl_zuma.mk b/audio/hidl_zuma.mk index 41dd02a..6fb3449 100644 --- a/audio/hidl_zuma.mk +++ b/audio/hidl_zuma.mk @@ -35,6 +35,12 @@ PRODUCT_PACKAGES += \ audio_hdmi_aoc \ sound_trigger.primary.$(TARGET_BOARD_PLATFORM) +ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) +# IAudioMetricExt HIDL +PRODUCT_PACKAGES += \ + vendor.google.audiometricext@1.0-service-vendor +endif + BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hidl BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio diff --git a/audio/sepolicy/common/hal_audio_default.te b/audio/sepolicy/common/hal_audio_default.te index f6e0e5d..e917b73 100644 --- a/audio/sepolicy/common/hal_audio_default.te +++ b/audio/sepolicy/common/hal_audio_default.te @@ -15,6 +15,7 @@ allow hal_audio_default amcs_device:chr_file rw_file_perms; allow hal_audio_default sysfs_pixelstats:file rw_file_perms; allow hal_audio_default sysfs_extcon:dir search; allow hal_audio_default sysfs_extcon:file r_file_perms; +allow hal_audio_default vendor_usb_debugfs:dir search; #allow access to aoc and kernel boottime allow hal_audio_default sysfs_aoc:dir { search }; diff --git a/bluetooth/bluetooth.mk b/bluetooth/bluetooth.mk new file mode 100644 index 0000000..29ddb9c --- /dev/null +++ b/bluetooth/bluetooth.mk @@ -0,0 +1,16 @@ +PRODUCT_SOONG_NAMESPACES += vendor/google/connectivity/bluetooth/common +PRODUCT_PACKAGES += \ + android.hardware.bluetooth-V1-ndk.so \ + android.hardware.bluetooth.finder-V1-ndk.so \ + android.hardware.bluetooth.ranging-V1-ndk.so \ + android.hardware.bluetooth-service.pixel \ + vendor.google.bluetooth_ext-V1-ndk.so \ + bt_vendor.conf \ + android.hardware.bluetooth.prebuilt.xml \ + android.hardware.bluetooth_le.prebuilt.xml + +BOARD_SEPOLICY_DIRS += device/google/gs-common/bluetooth/sepolicy +BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/powerstats + +DEVICE_MANIFEST_FILE += device/google/gs-common/bluetooth/manifest_bluetooth.xml +DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/bluetooth/compatibility_matrix.xml diff --git a/bluetooth/compatibility_matrix.xml b/bluetooth/compatibility_matrix.xml new file mode 100644 index 0000000..65b0c6d --- /dev/null +++ b/bluetooth/compatibility_matrix.xml @@ -0,0 +1,30 @@ + + + vendor.google.bluetooth_ext + 1 + + IBluetoothFinder + default + + + IBluetoothCcc + default + + + IBTChannelAvoidance + default + + + IBluetoothSar + default + + + IBluetoothExt + default + + + IBluetoothEwp + default + + + diff --git a/bluetooth/dump/Android.bp b/bluetooth/dump/Android.bp new file mode 100644 index 0000000..72e83b4 --- /dev/null +++ b/bluetooth/dump/Android.bp @@ -0,0 +1,20 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_binary { + name: "dump_bt", + srcs: ["dump.cpp"], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + ], + shared_libs: [ + "libbase", + "libdump", + "liblog", + ], + vendor: true, + relative_install_path: "dump", +} diff --git a/bluetooth/dump/dump.cpp b/bluetooth/dump/dump.cpp new file mode 100644 index 0000000..db92c3c --- /dev/null +++ b/bluetooth/dump/dump.cpp @@ -0,0 +1,44 @@ +/* + * Copyright 2023 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 +#include + +#define PIXELBT_ACTIVITY_LOG_DIRECTORY "/data/vendor/bluetooth" +#define PIXELBT_SNOOP_LOG_DIRECTORY "/data/vendor/bluetooth" +#define PIXELBT_FW_LOG_DIRECTORY "/data/vendor/ssrdump/coredump" +#define PIXELBT_SNOOP_LOG_PREFIX "btsnoop_hci_vnd" +#define PIXELBT_BACKUP_SNOOP_LOG_PREFIX "backup_btsnoop_hci_vnd" +#define PIXELBT_FW_DUMP_LOG_PREFIX "coredump_bt_socdump_" +#define PIXELBT_CHRE_DUMP_LOG_PREFIX "coredump_bt_chredump_" +#define PIXELBT_HAL_DUMP_LOG_PREFIX "coredump_bt_" +#define PIXELBT_ACTIVITY_LOG_PREFIX "bt_activity_" + +int main() { + std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "bt"); + if (mkdir(outputDir.c_str(), 0777) == -1) { + printf("Unable to create folder: %s\n", outputDir.c_str()); + return 0; + } + + dumpLogs(PIXELBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 4, + PIXELBT_SNOOP_LOG_PREFIX); + dumpLogs(PIXELBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, PIXELBT_BACKUP_SNOOP_LOG_PREFIX); + dumpLogs(PIXELBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_FW_DUMP_LOG_PREFIX); + dumpLogs(PIXELBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_CHRE_DUMP_LOG_PREFIX); + dumpLogs(PIXELBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_HAL_DUMP_LOG_PREFIX); + dumpLogs(PIXELBT_ACTIVITY_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_ACTIVITY_LOG_PREFIX); + return 0; +} diff --git a/bluetooth/dump/dumplog.mk b/bluetooth/dump/dumplog.mk new file mode 100644 index 0000000..51c3b3c --- /dev/null +++ b/bluetooth/dump/dumplog.mk @@ -0,0 +1,3 @@ +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bluetooth/dump/sepolicy/ + +PRODUCT_PACKAGES_DEBUG += dump_bt diff --git a/bluetooth/dump/sepolicy/dump.te b/bluetooth/dump/sepolicy/dump.te new file mode 100644 index 0000000..fdd123e --- /dev/null +++ b/bluetooth/dump/sepolicy/dump.te @@ -0,0 +1,12 @@ +# pixel bluetooth common hal service +pixel_bugreport(dump_bt) + +allow hal_dumpstate_default vendor_bt_data_file:dir { open read search }; +allow hal_dumpstate_default vendor_bt_data_file:file read; +allow dump_bt radio_vendor_data_file:dir create_dir_perms; +allow dump_bt radio_vendor_data_file:file create_file_perms; +allow dump_bt vendor_bt_data_file:dir r_dir_perms; +allow dump_bt vendor_bt_data_file:file r_file_perms; +allow dump_bt sscoredump_vendor_data_crashinfo_file:dir search; +allow dump_bt sscoredump_vendor_data_coredump_file:dir r_dir_perms; +allow dump_bt sscoredump_vendor_data_coredump_file:file r_file_perms; diff --git a/bluetooth/dump/sepolicy/file_contexts b/bluetooth/dump/sepolicy/file_contexts new file mode 100644 index 0000000..da28d10 --- /dev/null +++ b/bluetooth/dump/sepolicy/file_contexts @@ -0,0 +1,2 @@ +# bt common hal dump_bt service +/vendor/bin/dump/dump_bt u:object_r:dump_bt_exec:s0 diff --git a/bluetooth/manifest_bluetooth.xml b/bluetooth/manifest_bluetooth.xml new file mode 100644 index 0000000..a72f1c9 --- /dev/null +++ b/bluetooth/manifest_bluetooth.xml @@ -0,0 +1,27 @@ + + + android.hardware.bluetooth + 1 + IBluetoothHci/default + + + android.hardware.bluetooth.finder + 1 + IBluetoothFinder/default + + + android.hardware.bluetooth.ranging + 1 + IBluetoothChannelSounding/default + + + vendor.google.bluetooth_ext + 1 + IBTChannelAvoidance/default + IBluetoothCcc/default + IBluetoothEwp/default + IBluetoothExt/default + IBluetoothFinder/default + IBluetoothSar/default + + diff --git a/bluetooth/sepolicy/device.te b/bluetooth/sepolicy/device.te new file mode 100644 index 0000000..a256332 --- /dev/null +++ b/bluetooth/sepolicy/device.te @@ -0,0 +1,3 @@ +# Bt Wifi Coexistence device +type wb_coexistence_dev, dev_type; + diff --git a/bluetooth/sepolicy/file_contexts b/bluetooth/sepolicy/file_contexts new file mode 100644 index 0000000..e7c2617 --- /dev/null +++ b/bluetooth/sepolicy/file_contexts @@ -0,0 +1,6 @@ +# Bluetooth +/vendor/bin/hw/android\.hardware\.bluetooth-service\.pixel u:object_r:hal_bluetooth_btlinux_exec:s0 + +/dev/wbrc u:object_r:wb_coexistence_dev:s0 +/dev/ttySAC16 u:object_r:hci_attach_dev:s0 + diff --git a/bluetooth/sepolicy/genfs_contexts b/bluetooth/sepolicy/genfs_contexts new file mode 100644 index 0000000..899041b --- /dev/null +++ b/bluetooth/sepolicy/genfs_contexts @@ -0,0 +1,8 @@ +# Bluetooth pin control device node +genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 +genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill2/state u:object_r:sysfs_bluetooth_writable:s0 +genfscon proc /bluetooth/sleep/lpm u:object_r:proc_bluetooth_writable:s0 +genfscon proc /bluetooth/sleep/btwrite u:object_r:proc_bluetooth_writable:s0 +genfscon proc /bluetooth/sleep/btwake u:object_r:proc_bluetooth_writable:s0 +genfscon proc /bluetooth/timesync u:object_r:proc_bluetooth_writable:s0 + diff --git a/bluetooth/sepolicy/hal_bluetooth_btlinux.te b/bluetooth/sepolicy/hal_bluetooth_btlinux.te new file mode 100644 index 0000000..0c85cb0 --- /dev/null +++ b/bluetooth/sepolicy/hal_bluetooth_btlinux.te @@ -0,0 +1,19 @@ +# coexistence device file node +add_hwservice(hal_bluetooth_btlinux, hal_bluetooth_coexistence_hwservice); +add_service(hal_bluetooth_btlinux, hal_bluetooth_coexistence_service); +allow hal_bluetooth_btlinux wb_coexistence_dev:chr_file rw_file_perms; + +# power stats +allow hal_bluetooth_btlinux hal_power_stats_vendor_service:service_manager find; +binder_call(hal_bluetooth_btlinux, hal_power_stats_default) + +# bt firmware dump +allow hal_bluetooth_btlinux aconfig_storage_metadata_file:dir search; +allow hal_bluetooth_btlinux sscoredump_vendor_data_crashinfo_file:dir rw_dir_perms; +allow hal_bluetooth_btlinux sscoredump_vendor_data_crashinfo_file:file rw_file_perms; + +userdebug_or_eng(` + allow hal_bluetooth_btlinux sscoredump_vendor_data_coredump_file:dir create_dir_perms; + allow hal_bluetooth_btlinux sscoredump_vendor_data_coredump_file:file create_file_perms; + allow hal_bluetooth_btlinux logbuffer_device:chr_file r_file_perms; +') diff --git a/bluetooth/sepolicy/hwservice.te b/bluetooth/sepolicy/hwservice.te new file mode 100644 index 0000000..5e36cd0 --- /dev/null +++ b/bluetooth/sepolicy/hwservice.te @@ -0,0 +1,3 @@ +# Bluetooth HAL extension +type hal_bluetooth_coexistence_hwservice, hwservice_manager_type, vendor_hwservice_type; + diff --git a/bluetooth/sepolicy/hwservice_contexts b/bluetooth/sepolicy/hwservice_contexts new file mode 100644 index 0000000..8480b4e --- /dev/null +++ b/bluetooth/sepolicy/hwservice_contexts @@ -0,0 +1,6 @@ +# Bluetooth HAL extension +hardware.google.bluetooth.bt_channel_avoidance::IBTChannelAvoidance u:object_r:hal_bluetooth_coexistence_hwservice:s0 +hardware.google.bluetooth.sar::IBluetoothSar u:object_r:hal_bluetooth_coexistence_hwservice:s0 +hardware.google.bluetooth.ccc::IBluetoothCcc u:object_r:hal_bluetooth_coexistence_hwservice:s0 +hardware.google.bluetooth.ewp::IBluetoothEwp u:object_r:hal_bluetooth_coexistence_hwservice:s0 +hardware.google.bluetooth.ext::IBluetoothExt u:object_r:hal_bluetooth_coexistence_hwservice:s0 diff --git a/bluetooth/sepolicy/service.te b/bluetooth/sepolicy/service.te new file mode 100644 index 0000000..b8403da --- /dev/null +++ b/bluetooth/sepolicy/service.te @@ -0,0 +1,2 @@ +# Bluetooth HAL extension +type hal_bluetooth_coexistence_service, hal_service_type, service_manager_type; diff --git a/bluetooth/sepolicy/service_contexts b/bluetooth/sepolicy/service_contexts new file mode 100644 index 0000000..4aecc90 --- /dev/null +++ b/bluetooth/sepolicy/service_contexts @@ -0,0 +1,7 @@ +# Bluetooth HAL extension +vendor.google.bluetooth_ext.IBTChannelAvoidance/default u:object_r:hal_bluetooth_coexistence_service:s0 +vendor.google.bluetooth_ext.IBluetoothSar/default u:object_r:hal_bluetooth_coexistence_service:s0 +vendor.google.bluetooth_ext.IBluetoothCcc/default u:object_r:hal_bluetooth_coexistence_service:s0 +vendor.google.bluetooth_ext.IBluetoothEwp/default u:object_r:hal_bluetooth_coexistence_service:s0 +vendor.google.bluetooth_ext.IBluetoothExt/default u:object_r:hal_bluetooth_coexistence_service:s0 +vendor.google.bluetooth_ext.IBluetoothFinder/default u:object_r:hal_bluetooth_coexistence_service:s0 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 @@ endif $(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 @@ userdebug_or_eng(` 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/dump_chip_info/Android.bp b/dump_chip_info/Android.bp new file mode 100644 index 0000000..4a13160 --- /dev/null +++ b/dump_chip_info/Android.bp @@ -0,0 +1,20 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_binary { + name: "dump_chip_info", + srcs: ["dump_chip_info.cpp"], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + ], + shared_libs: [ + "libbase", + "libdump", + "liblog", + ], + vendor: true, + relative_install_path: "dump", +} diff --git a/dump_chip_info/chip_info.mk b/dump_chip_info/chip_info.mk new file mode 100644 index 0000000..a0d8317 --- /dev/null +++ b/dump_chip_info/chip_info.mk @@ -0,0 +1,3 @@ +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dump_chip_info/sepolicy + +PRODUCT_PACKAGES += dump_chip_info diff --git a/dump_chip_info/dump_chip_info.cpp b/dump_chip_info/dump_chip_info.cpp new file mode 100644 index 0000000..dd83743 --- /dev/null +++ b/dump_chip_info/dump_chip_info.cpp @@ -0,0 +1,24 @@ +/* + * 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 +#include + +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"); + + return 0; +} diff --git a/dump_chip_info/sepolicy/dump_chip_info.te b/dump_chip_info/sepolicy/dump_chip_info.te new file mode 100644 index 0000000..936d425 --- /dev/null +++ b/dump_chip_info/sepolicy/dump_chip_info.te @@ -0,0 +1,3 @@ +# +pixel_bugreport(dump_chip_info) +allow dump_chip_info sysfs_chip_info:file r_file_perms; diff --git a/dump_chip_info/sepolicy/file.te b/dump_chip_info/sepolicy/file.te new file mode 100644 index 0000000..80900b0 --- /dev/null +++ b/dump_chip_info/sepolicy/file.te @@ -0,0 +1,2 @@ +# +type sysfs_chip_info, sysfs_type, fs_type; diff --git a/dump_chip_info/sepolicy/file_contexts b/dump_chip_info/sepolicy/file_contexts new file mode 100644 index 0000000..b9f4b21 --- /dev/null +++ b/dump_chip_info/sepolicy/file_contexts @@ -0,0 +1 @@ +/vendor/bin/dump/dump_chip_info u:object_r:dump_chip_info_exec:s0 diff --git a/dump_chip_info/sepolicy/genfs_contexts b/dump_chip_info/sepolicy/genfs_contexts new file mode 100644 index 0000000..3fda2de --- /dev/null +++ b/dump_chip_info/sepolicy/genfs_contexts @@ -0,0 +1,2 @@ +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 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 @@ PRODUCT_PACKAGES += \ # 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/esim/init.esim-gs.rc b/esim/init.esim-gs.rc index 291f9ee..ce27334 100644 --- a/esim/init.esim-gs.rc +++ b/esim/init.esim-gs.rc @@ -2,6 +2,10 @@ on property:ro.build.type=user && property:ro.boot.flash.locked=0 setprop setupwizard.feature.provisioning_profile_mode false +# Disable bootstrap for UGS devices +on property:ro.boot.warranty.sku=UGS + setprop setupwizard.feature.provisioning_profile_mode false + # Disable bootstrap for DVT devices shipping to non-US carriers on property:ro.boot.warranty.sku=BOF setprop setupwizard.feature.provisioning_profile_mode false diff --git a/gcam_app/sepolicy/product/public/debug_camera_app.te b/gcam_app/sepolicy/product/public/debug_camera_app.te deleted file mode 100644 index 0572eee..0000000 --- a/gcam_app/sepolicy/product/public/debug_camera_app.te +++ /dev/null @@ -1,2 +0,0 @@ -# GCA-Eng and GCA-Next -type debug_camera_app, domain; diff --git a/gcam_app/sepolicy/product/public/google_camera_app.te b/gcam_app/sepolicy/product/public/google_camera_app.te deleted file mode 100644 index a8d6512..0000000 --- a/gcam_app/sepolicy/product/public/google_camera_app.te +++ /dev/null @@ -1,2 +0,0 @@ -# GCA-Release and GCA-Dogfood -type google_camera_app, domain; 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 radio_vendor_data_file:file create_file_perms; 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/gps/dump/dump_gps.cpp b/gps/dump/dump_gps.cpp index 62f69f8..e073732 100644 --- a/gps/dump/dump_gps.cpp +++ b/gps/dump/dump_gps.cpp @@ -13,13 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#include -#include #include +#include +#include +#include +#include +#include #define GPS_LOG_NUMBER_PROPERTY "persist.vendor.gps.aol.log_num" #define GPS_LOG_DIRECTORY "/data/vendor/gps/logs" +#define GPS_RESOURCE_DIRECTORY "/data/vendor/gps/resource" #define GPS_TMP_LOG_DIRECTORY "/data/vendor/gps/logs/.tmp" #define GPS_LOG_PREFIX "gl-" #define GPS_MCU_LOG_PREFIX "esw-" @@ -29,6 +32,40 @@ #define GPS_RAWLOG_PREFIX "rawbin" #define GPS_MEMDUMP_LOG_PREFIX "memdump_" +static void copyDirectory(const std::string &source, + const std::string &outputDir) { + DIR *dir = opendir(source.c_str()); + if (dir == nullptr) { + return; + } + + if (mkdir(outputDir.c_str(), 0777) == -1) { + closedir(dir); + return; + } + + struct dirent *entry; + while ((entry = readdir(dir)) != nullptr) { + std::string entryName = entry->d_name; + if (entryName == "." || entryName == "..") { + continue; + } + + std::string sourcePath = source + "/" + entryName; + std::string destPath = outputDir + "/" + entryName; + + struct stat st; + if (stat(sourcePath.c_str(), &st) == 0) { + if (S_ISDIR(st.st_mode)) + copyDirectory(sourcePath, destPath); + else + copyFile(sourcePath.c_str(), destPath.c_str()); + } + } + closedir(dir); + 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"); @@ -50,6 +87,7 @@ int main() { } dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, 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/gxp/sepolicy/dump_gxp.te b/gxp/sepolicy/dump_gxp.te index 8d285c5..322a01f 100644 --- a/gxp/sepolicy/dump_gxp.te +++ b/gxp/sepolicy/dump_gxp.te @@ -1,3 +1,4 @@ +# Dump GXP logs to bugreport. pixel_bugreport(dump_gxp) userdebug_or_eng(` @@ -7,7 +8,5 @@ userdebug_or_eng(` allow dump_gxp sscoredump_vendor_data_coredump_file:file r_file_perms; allow dump_gxp sscoredump_vendor_data_crashinfo_file:dir r_dir_perms; allow dump_gxp sscoredump_vendor_data_crashinfo_file:file r_file_perms; - # Allow dump_gxp to access gxp properties. - get_prop(google_camera_app, vendor_gxp_prop) ') diff --git a/insmod/insmod.sh b/insmod/insmod.sh index 8cac37e..dfc4fdd 100755 --- a/insmod/insmod.sh +++ b/insmod/insmod.sh @@ -1,11 +1,11 @@ #!/vendor/bin/sh -############################################################# -### init.insmod.cfg format: ### -### ----------------------------------------------------- ### -### [insmod|setprop|enable/moprobe|wait] [path|prop name] ### -### ... ### -############################################################# +################################################################### +### init.insmod.cfg format: ### +### ----------------------------------------------------------- ### +### [insmod|setprop|enable|moprobe|rmmod|wait] [path|prop name] ### +### ... ### +################################################################### modules_dir= system_modules_dir= @@ -96,6 +96,7 @@ if [ -f $cfg_file ]; then modprobe -a -d "${modules_dir}" $arg fi ;; + "rmmod") rmmod $arg ;; "wait") wait_for_file $arg ;; esac done < $cfg_file 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_server_domain(mediacodec_google, hal_codec2) 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/mte/OWNERS b/mte/OWNERS index 929e941..57da09d 100644 --- a/mte/OWNERS +++ b/mte/OWNERS @@ -1,4 +1,4 @@ eugenis@google.com pcc@google.com -mitchp@google.com fmayer@google.com +nnk@google.com diff --git a/ramdump_and_coredump/sepolicy/ramdump_app.te b/ramdump_and_coredump/sepolicy/ramdump_app.te index 85d4bfd..9eebc98 100644 --- a/ramdump_and_coredump/sepolicy/ramdump_app.te +++ b/ramdump_and_coredump/sepolicy/ramdump_app.te @@ -1,8 +1,12 @@ +# SEpolicy for com.android.ramdump type ramdump_app, domain; userdebug_or_eng(` app_domain(ramdump_app) + # For using Firebase Cloud Firestore + net_domain(ramdump_app) + allow ramdump_app app_api_service:service_manager find; allow ramdump_app ramdump_vendor_data_file:file create_file_perms; diff --git a/storage/dump_storage.cpp b/storage/dump_storage.cpp index e6b3e4c..272b1ee 100644 --- a/storage/dump_storage.cpp +++ b/storage/dump_storage.cpp @@ -221,14 +221,23 @@ int main() { read_buffer(18, 131072, "kioxia_12_ufs_err_history.dat"); break; case 0x1AD: //SKhynix - read_buffer(0, 4096, "hynix_00_ufs_err_history.dat"); - read_buffer(16, 131072, "skhynix_10_ufs_err_history.dat"); - read_buffer(17, 131072, "skhynix_11_ufs_err_history.dat"); - read_buffer(18, 131072, "skhynix_12_ufs_err_history.dat"); - read_buffer(19, 131072, "skhynix_13_ufs_err_history.dat"); + if (!strcmp(ufs_ver.c_str(), "0x0310")) { + read_buffer(0, 4096, "skhynix_00_ufs_err_history.dat"); + read_buffer(16, 131072, "skhynix_10_ufs_err_history.dat"); + read_buffer(17, 131072, "skhynix_11_ufs_err_history.dat"); + read_buffer(18, 131072, "skhynix_12_ufs_err_history.dat"); + read_buffer(19, 131072, "skhynix_13_ufs_err_history.dat"); + } else { + read_buffer(0, 4096, "skhynix_00_ufs_err_history.dat"); + read_buffer(16, 8388608, "skhynix_10_ufs_err_history.dat"); + read_buffer(17, 8388608, "skhynix_11_ufs_err_history.dat"); + } break; case 0x1CE: //SAMSUNG - read_buffer(16, 8404992, "samsung_10_ufs_err_history.dat"); + if (!strcmp(ufs_ver.c_str(), "0x0310")) + read_buffer(16, 8404992, "samsung_10_ufs_err_history.dat"); + else + read_buffer(16, 12599296, "samsung_10_ufs_err_history.dat"); break; default: break; 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 @@ on init 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/touch/gti/sepolicy/hal_sensors_default.te b/touch/gti/sepolicy/hal_sensors_default.te new file mode 100644 index 0000000..37b93fd --- /dev/null +++ b/touch/gti/sepolicy/hal_sensors_default.te @@ -0,0 +1,2 @@ +# Support SW_LID event from SensorHAL to configure touch input and gesture +set_prop(hal_sensors_default, vendor_gti_prop) diff --git a/vibrator/flags/VibratorFlags.aconfig b/vibrator/flags/VibratorFlags.aconfig index ec6e2d4..3e0a6fd 100644 --- a/vibrator/flags/VibratorFlags.aconfig +++ b/vibrator/flags/VibratorFlags.aconfig @@ -8,3 +8,11 @@ flag { description: "This flag controls the removal of utilizing Capo at the HAL level" bug: "290223630" } + +flag { + name: "enable_pwle_v2" + namespace: "vibrator" + is_exported: true + description: "This flag enables the PWLE V2 APIs guarded by the CAP_COMPOSE_PWLE_EFFECTS_V2 compatability" + bug: "346570576" +} \ No newline at end of file