diff --git a/aoc/aoc.mk b/aoc/aoc.mk index e06105e..4f07e1d 100644 --- a/aoc/aoc.mk +++ b/aoc/aoc.mk @@ -4,16 +4,15 @@ PRODUCT_PACKAGES += dump_aoc \ aocd \ aocxd -ifeq (,$(filter aosp_% lineage_%,$(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 PRODUCT_COPY_FILES += \ device/google/gs-common/aoc/conf/init.aoc.daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.aoc.rc +ifneq ($(wildcard vendor/google/whitechapel/aoc/aocx/aidl/aocx/framework_compatibility_matrix.xml),) +DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \ + vendor/google/whitechapel/aoc/aocx/aidl/aocx/framework_compatibility_matrix.xml +endif + # AoC debug support PRODUCT_PACKAGES_ENG += \ aocdump \ 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/aoc/sepolicy/service_contexts b/aoc/sepolicy/service_contexts index de31e51..80346c8 100644 --- a/aoc/sepolicy/service_contexts +++ b/aoc/sepolicy/service_contexts @@ -1 +1 @@ -aocx.IAocx u:object_r:aocx:s0 +aocx.IAocx/default u:object_r:aocx:s0 diff --git a/audio/aidl.mk b/audio/aidl.mk index e06ac0b..68458dd 100644 --- a/audio/aidl.mk +++ b/audio/aidl.mk @@ -16,7 +16,11 @@ PRODUCT_PACKAGES += \ 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 @@ -27,4 +31,11 @@ PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_SYSTEM_EXT_PROPERTIES += \ ro.audio.ihaladaptervendorextension_enabled=true +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +$(call soong_config_set,aoc_audio_func,dump_usecase_data,true) +$(call soong_config_set,aoc_audio_func,hal_socket_control,true) +$(call soong_config_set,aoc_audio_func,record_tuning_keys,true) +$(call soong_config_set,aoc_audio_func,aidl_command_interface,true) +endif + $(call soong_config_set,pixel_audio_hal_type,aidl_build,true) diff --git a/audio/aidl/device_framework_matrix_product.xml b/audio/aidl/device_framework_matrix_product.xml index 0e7e998..570c5d4 100644 --- a/audio/aidl/device_framework_matrix_product.xml +++ b/audio/aidl/device_framework_matrix_product.xml @@ -1,15 +1,7 @@ - - vendor.google.audiometricext - 1.0 - - IAudioMetricExt - default - - vendor.google.whitechapel.audio.extension - 3 + 4 IAudioExtension default 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..64ad2ba 100644 --- a/audio/hidl_zuma.mk +++ b/audio/hidl_zuma.mk @@ -35,8 +35,14 @@ 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 +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/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/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/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/camera/Android.bp b/camera/Android.bp index e845678..2c7ec58 100644 --- a/camera/Android.bp +++ b/camera/Android.bp @@ -34,3 +34,27 @@ prebuilt_etc { src: "com.google.pixel.camera.concurrent_foldable_dual_front.xml", sub_dir: "permissions", } + +prebuilt_etc { + name: "libg3a_standalone_gabc_rc", + vendor: true, + proprietary: true, + init_rc: ["libg3a_gabc.rc"], + src: "libg3a_gabc.rc", +} + +prebuilt_etc { + name: "libg3a_standalone_gaf_rc", + vendor: true, + proprietary: true, + init_rc: ["libg3a_gaf.rc"], + src: "libg3a_gaf.rc", +} + +prebuilt_etc { + name: "libg3a_standalone_ghawb_rc", + vendor: true, + proprietary: true, + init_rc: ["libg3a_ghawb.rc"], + src: "libg3a_ghawb.rc", +} diff --git a/camera/libg3a_gabc.rc b/camera/libg3a_gabc.rc new file mode 100644 index 0000000..c092edd --- /dev/null +++ b/camera/libg3a_gabc.rc @@ -0,0 +1,28 @@ +# override default log levels. +on boot + setprop log.tag.GABC E + +# backward-compatible system props. +on property:persist.vendor.camera.gabc.debug_level=0 + setprop log.tag.GABC S + +on property:persist.vendor.camera.gabc.debug_level=1 + setprop log.tag.GABC V + +on property:persist.vendor.camera.gabc.debug_level=2 + setprop log.tag.GABC V + +on property:persist.vendor.camera.gabc.debug_level=3 + setprop log.tag.GABC D + +on property:persist.vendor.camera.gabc.debug_level=4 + setprop log.tag.GABC I + +on property:persist.vendor.camera.gabc.debug_level=5 + setprop log.tag.GABC W + +on property:persist.vendor.camera.gabc.debug_level=6 + setprop log.tag.GABC E + +on property:persist.vendor.camera.gabc.debug_level=7 + setprop log.tag.GABC A diff --git a/camera/libg3a_gaf.rc b/camera/libg3a_gaf.rc new file mode 100644 index 0000000..214b467 --- /dev/null +++ b/camera/libg3a_gaf.rc @@ -0,0 +1,83 @@ +# override default log levels. +on boot + setprop log.tag.GAF E + +# backward-compatible system props. +on property:persist.vendor.camera.af.debug_level=0 + setprop log.tag.GAF S + +on property:persist.vendor.camera.af.debug_level=1 + setprop log.tag.GAF V + +on property:persist.vendor.camera.af.debug_level=2 + setprop log.tag.GAF V + +on property:persist.vendor.camera.af.debug_level=3 + setprop log.tag.GAF D + +on property:persist.vendor.camera.af.debug_level=4 + setprop log.tag.GAF I + +on property:persist.vendor.camera.af.debug_level=5 + setprop log.tag.GAF W + +on property:persist.vendor.camera.af.debug_level=6 + setprop log.tag.GAF E + +on property:persist.vendor.camera.af.debug_level=7 + setprop log.tag.GAF A + +on property:persist.vendor.camera.af.video_debug_enable=2 + setprop vendor.camera.3a.log_level 1 + setprop log.tag.3a.gcrd.af.parser.input V + setprop log.tag.3a.gcrd.af.parser.output V + setprop log.tag.3a.gcrd.af.processor V + setprop log.tag.3a.gcrd.af.engine V + setprop log.tag.3a.gcrd.dtm V + +on property:persist.vendor.camera.af.video_debug_enable=0 + setprop vendor.camera.3a.log_level 6 + setprop log.tag.3a.gcrd.af.parser.input E + setprop log.tag.3a.gcrd.af.parser.output E + setprop log.tag.3a.gcrd.af.processor E + setprop log.tag.3a.gcrd.af.engine E + setprop log.tag.3a.gcrd.dtm E + +on property:persist.vendor.camera.af.default_focus_only=false + setprop persist.vendor.camera.af.ignore_ctrl_focus_region false + setprop persist.vendor.camera.af.ignore_face 0 + setprop persist.vendor.camera.af.force_saliency_consumption "" + +on property:persist.vendor.camera.af.default_focus_only=true + setprop persist.vendor.camera.af.ignore_ctrl_focus_region true + setprop persist.vendor.camera.af.ignore_face 1 + setprop persist.vendor.camera.af.force_saliency_consumption false + +# Reset every related properties +on property:persist.vendor.camera.af.standalone_searchlet=reset + setprop persist.vendor.camera.af.ignore_pd \"\" + setprop persist.vendor.camera.af.ignore_tof \"\" + setprop persist.vendor.camera.af.ignore_cdaf \"\" + setprop persist.vendor.camera.af.ignore_gyro \"\" + setprop persist.vendor.camera.af.ignore_3a \"\" + setprop vendor.camera.debug.enable_saliency \"\" + +# Standalone framework: PDAF +on property:persist.vendor.camera.af.standalone_searchlet=pdaf + setprop persist.vendor.camera.af.ignore_tof 1 + setprop persist.vendor.camera.af.ignore_gyro 1 + setprop persist.vendor.camera.af.ignore_3a 1 + setprop vendor.camera.debug.enable_saliency 0 + +# Standalone framework: LDAF +on property:persist.vendor.camera.af.standalone_searchlet=ldaf + setprop persist.vendor.camera.af.ignore_pd 7 + setprop persist.vendor.camera.af.ignore_gyro 1 + setprop persist.vendor.camera.af.ignore_3a 1 + setprop vendor.camera.debug.enable_saliency 0 + +# Standalone framework: CDAF +on property:persist.vendor.camera.af.standalone_searchlet=cdaf + setprop persist.vendor.camera.af.ignore_pd 7 + setprop persist.vendor.camera.af.ignore_tof 1 + setprop vendor.camera.debug.enable_saliency 0 diff --git a/camera/libg3a_ghawb.rc b/camera/libg3a_ghawb.rc new file mode 100644 index 0000000..4ca6717 --- /dev/null +++ b/camera/libg3a_ghawb.rc @@ -0,0 +1,28 @@ +# override default log levels. +on boot + setprop log.tag.GHAWB E + +# backward-compatible system props. +on property:persist.vendor.camera.ghawb.debug_level=0 + setprop log.tag.GHAWB S + +on property:persist.vendor.camera.ghawb.debug_level=1 + setprop log.tag.GHAWB V + +on property:persist.vendor.camera.ghawb.debug_level=2 + setprop log.tag.GHAWB V + +on property:persist.vendor.camera.ghawb.debug_level=3 + setprop log.tag.GHAWB D + +on property:persist.vendor.camera.ghawb.debug_level=4 + setprop log.tag.GHAWB I + +on property:persist.vendor.camera.ghawb.debug_level=5 + setprop log.tag.GHAWB W + +on property:persist.vendor.camera.ghawb.debug_level=6 + setprop log.tag.GHAWB E + +on property:persist.vendor.camera.ghawb.debug_level=7 + setprop log.tag.GHAWB A diff --git a/camera/lyric.mk b/camera/lyric.mk index f30b1b9..adffb74 100644 --- a/camera/lyric.mk +++ b/camera/lyric.mk @@ -20,8 +20,20 @@ endif # 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 \ @@ -37,11 +49,7 @@ PRODUCT_SOONG_NAMESPACES += \ vendor/google/camera/google_3a/libs_v4/gAF \ vendor/google/camera/google_3a/libs_v4/gafd \ vendor/google/camera/google_3a/libs_v4/gHAWB/native_coverage - -# Calibration tool for debug builds -PRODUCT_PACKAGES_ENG += tarasque_test -PRODUCT_PACKAGES_ENG += 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 @@ -61,3 +69,7 @@ DEVICE_MATRIX_FILE += \ # sepolicy dir is added in dump.mk. # Make doesn't deduplicate sepolicy dirs, so including it here causes build errors. + +# Calibration tools for debug builds +PRODUCT_PACKAGES_DEBUG += tarasque_test +PRODUCT_PACKAGES_DEBUG += ProtoCalibGenerator 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 @@ Example: $(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 hal_contexthub_default self:global_capability2_class_set block_suspend; # 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/display/dump_display.cpp b/display/dump_display.cpp index 2df6b4b..f57a134 100644 --- a/display/dump_display.cpp +++ b/display/dump_display.cpp @@ -16,15 +16,15 @@ #include #include - int main() { setbuf(stdout, NULL); dumpFileContent("DECON-0 counters /sys/class/drm/card0/device/decon0/counters", "/sys/class/drm/card0/device/decon0/counters"); dumpFileContent("CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event"); runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v"); - dumpFileContent("Primary panel name", "/sys/devices/platform/exynos-drm/primary-panel/panel_name"); - dumpFileContent("Primary panel extra info", "/sys/devices/platform/exynos-drm/primary-panel/panel_extinfo"); - dumpFileContent("Primary panel power Vreg", "/sys/devices/platform/exynos-drm/primary-panel/panel_pwr_vreg"); - dumpFileContent("Primary panel power mode register", "/sys/devices/platform/exynos-drm/primary-panel/power_mode"); + + dumpFileContent("Primary panel name", "/sys/class/drm/card0/device/primary-panel/panel_name"); + dumpFileContent("Primary panel extra info", "/sys/class/drm/card0/device/primary-panel/panel_extinfo"); + dumpFileContent("Primary panel power Vreg", "/sys/class/drm/card0/device/primary-panel/panel_pwr_vreg"); + dumpFileContent("Primary panel power mode register", "/sys/class/drm/card0/device/primary-panel/power_mode"); return 0; -} \ No newline at end of file +} 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/dump_second_display.cpp b/display/dump_second_display.cpp index 80ea909..9590c7f 100644 --- a/display/dump_second_display.cpp +++ b/display/dump_second_display.cpp @@ -18,9 +18,9 @@ int main() { dumpFileContent("DECON-1 counters /sys/class/drm/card0/device/decon1/counters", "/sys/class/drm/card0/device/decon1/counters"); dumpFileContent("CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event"); - dumpFileContent("Secondary panel name", "/sys/devices/platform/exynos-drm/secondary-panel/panel_name"); - dumpFileContent("Secondary panel extra info", "/sys/devices/platform/exynos-drm/secondary-panel/panel_extinfo"); - dumpFileContent("Secondary panel power mode register", "/sys/devices/platform/exynos-drm/secondary-panel/power_mode"); + + dumpFileContent("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name"); + dumpFileContent("Secondary panel extra info", "/sys/class/drm/card0/device/secondary-panel/panel_extinfo"); + dumpFileContent("Secondary panel power mode register", "/sys/class/drm/card0/device/secondary-panel/power_mode"); return 0; } - 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..bbd0065 --- /dev/null +++ b/dump_chip_info/dump_chip_info.cpp @@ -0,0 +1,28 @@ +/* + * 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"); + 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/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..ce42be1 --- /dev/null +++ b/dump_chip_info/sepolicy/genfs_contexts @@ -0,0 +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/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/edgetpu/sepolicy/edgetpu_tachyon_service.te b/edgetpu/sepolicy/edgetpu_tachyon_service.te index 80db366..642b469 100644 --- a/edgetpu/sepolicy/edgetpu_tachyon_service.te +++ b/edgetpu/sepolicy/edgetpu_tachyon_service.te @@ -42,7 +42,7 @@ allow edgetpu_tachyon_server proc_version:file r_file_perms; # Allow Tachyon service to send trace packets to Perfetto with SELinux enabled # under userdebug builds. -userdebug_or_eng(`perfetto_producer(edgetpu_tachyon_server)') +perfetto_producer(edgetpu_tachyon_server) # Allow Tachyon service to read tflite DarwiNN delegate properties get_prop(edgetpu_tachyon_server, vendor_tflite_delegate_prop) @@ -65,6 +65,4 @@ userdebug_or_eng(` ') # For shell level testing -userdebug_or_eng(` - binder_call(edgetpu_tachyon_server, shell); -') +binder_call(edgetpu_tachyon_server, shell); 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/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/esim/sepolicy/system_ext/private/gmscore_app.te b/esim/sepolicy/system_ext/private/gmscore_app.te index 90bc371..4dc1639 100644 --- a/esim/sepolicy/system_ext/private/gmscore_app.te +++ b/esim/sepolicy/system_ext/private/gmscore_app.te @@ -1,2 +1,2 @@ # Allow to read setupwizard_feature_prop -get_prop(priv_app, setupwizard_feature_prop) +get_prop(gmscore_app, setupwizard_feature_prop) diff --git a/fingerprint/sepolicy/service_contexts b/fingerprint/sepolicy/service_contexts new file mode 100644 index 0000000..4cc220f --- /dev/null +++ b/fingerprint/sepolicy/service_contexts @@ -0,0 +1,2 @@ +# Fingerprint HAL extension +vendor.goodix.hardware.biometrics.fingerprint.IGoodixFingerprintDaemon/default u:object_r:hal_fingerprint_service:s0 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/product/private/google_camera_app.te b/gcam_app/sepolicy/product/private/google_camera_app.te index a4c7a79..2d3d73c 100644 --- a/gcam_app/sepolicy/product/private/google_camera_app.te +++ b/gcam_app/sepolicy/product/private/google_camera_app.te @@ -3,12 +3,12 @@ typeattribute google_camera_app coredomain; app_domain(google_camera_app) net_domain(google_camera_app) -#allow google_camera_app app_api_service:service_manager find; -#allow google_camera_app audioserver_service:service_manager find; -#allow google_camera_app cameraserver_service:service_manager find; -#allow google_camera_app mediaextractor_service:service_manager find; -#allow google_camera_app mediametrics_service:service_manager find; -#allow google_camera_app mediaserver_service:service_manager find; +allow google_camera_app app_api_service:service_manager find; +allow google_camera_app audioserver_service:service_manager find; +allow google_camera_app cameraserver_service:service_manager find; +allow google_camera_app mediaextractor_service:service_manager find; +allow google_camera_app mediametrics_service:service_manager find; +allow google_camera_app mediaserver_service:service_manager find; # Allows GCA to access the PowerHAL. hal_client_domain(google_camera_app, hal_power) 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/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/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..7906a1f 100644 --- a/gps/dump/dump_gps.cpp +++ b/gps/dump/dump_gps.cpp @@ -13,13 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#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 +33,92 @@ #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 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"); @@ -48,8 +138,8 @@ int main() { 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 hal_gnss_pixel vendor_gps_file:fifo_file create_file_perms; # 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 @@ + + + vendor.google.radio_ext + 3 + + IRadioExt + default + + + 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/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/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 @@ + + + com.google.input.gia.core + + IGiaService + default + + 1 + + \ 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 @@ + + + com.google.input.gia.core + + IGiaService + default + + 1 + + \ 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/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/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..68bc281 --- /dev/null +++ b/interrupts/init.interrupts.rc @@ -0,0 +1,16 @@ +on init + # Create the directory for the trace instance during early init + chmod 666 /sys/kernel/tracing/instances/irq_gia_google + chmod 666 /sys/kernel/tracing/instances/irq_gia_google/trace + chown system system /sys/kernel/tracing/instances/irq_gia_google + chown system system /sys/kernel/tracing/instances/irq_gia_google/trace + + # 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" + + # 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 64 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 +#include + +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 +#include + +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/mediacodec_google.mk b/mediacodec/vpu/mediacodec_google.mk index 8c1e974..3984501 100644 --- a/mediacodec/vpu/mediacodec_google.mk +++ b/mediacodec/vpu/mediacodec_google.mk @@ -7,10 +7,12 @@ PRODUCT_PACKAGES += \ libgc2_vdi_vpu \ libgc2_log \ libgc2_utils \ + libgc2_dec \ libgc2_av1_dec \ libgc2_vp9_dec \ libgc2_hevc_dec \ libgc2_avc_dec \ + libgc2_enc \ libgc2_av1_enc \ libgc2_hevc_enc \ libgc2_avc_enc \ diff --git a/mediacodec/vpu/sepolicy/mediacodec_google.te b/mediacodec/vpu/sepolicy/mediacodec_google.te index 8022675..cf9dfc5 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,9 +9,11 @@ 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 }; +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/modem/modem_svc_sit/compatibility_matrix.xml b/modem/modem_svc_sit/compatibility_matrix.xml new file mode 100644 index 0000000..14d987a --- /dev/null +++ b/modem/modem_svc_sit/compatibility_matrix.xml @@ -0,0 +1,11 @@ + + + + com.google.pixel.shared_modem_platform + 3 + + ISharedModemPlatform + default + + + diff --git a/modem/modem_svc_sit/sepolicy/attributes b/modem/modem_svc_sit/sepolicy/attributes new file mode 100644 index 0000000..2cc802d --- /dev/null +++ b/modem/modem_svc_sit/sepolicy/attributes @@ -0,0 +1 @@ +hal_attribute(shared_modem_platform) diff --git a/modem/modem_svc_sit/sepolicy/file_contexts b/modem/modem_svc_sit/sepolicy/file_contexts new file mode 100644 index 0000000..d6f4a74 --- /dev/null +++ b/modem/modem_svc_sit/sepolicy/file_contexts @@ -0,0 +1,2 @@ +# modem_svc_sit +/vendor/bin/shared_modem_platform u:object_r:modem_svc_sit_exec:s0 \ No newline at end of file diff --git a/modem/modem_svc_sit/sepolicy/hal_shared_modem_platform.te b/modem/modem_svc_sit/sepolicy/hal_shared_modem_platform.te new file mode 100644 index 0000000..8771563 --- /dev/null +++ b/modem/modem_svc_sit/sepolicy/hal_shared_modem_platform.te @@ -0,0 +1,8 @@ +# Allow binder connection from client to server +binder_call(hal_shared_modem_platform_client, hal_shared_modem_platform_server) + +# Allow client to find the service, server to register the service +hal_attribute_service(hal_shared_modem_platform, hal_shared_modem_platform_service) + +# Allow binder communication from server to service_manager +binder_use(hal_shared_modem_platform_server) diff --git a/modem/modem_svc_sit/sepolicy/modem_svc_sit.te b/modem/modem_svc_sit/sepolicy/modem_svc_sit.te new file mode 100644 index 0000000..b1ed074 --- /dev/null +++ b/modem/modem_svc_sit/sepolicy/modem_svc_sit.te @@ -0,0 +1,2 @@ +# Modem SVC will register the default instance of the AIDL ISharedModemPlatform hal. +hal_server_domain(modem_svc_sit, hal_shared_modem_platform) diff --git a/modem/modem_svc_sit/sepolicy/service.te b/modem/modem_svc_sit/sepolicy/service.te new file mode 100644 index 0000000..0fd48ee --- /dev/null +++ b/modem/modem_svc_sit/sepolicy/service.te @@ -0,0 +1,2 @@ +# define hal_shared_modem_platform_service +type hal_shared_modem_platform_service, hal_service_type, service_manager_type; diff --git a/modem/modem_svc_sit/sepolicy/service_contexts b/modem/modem_svc_sit/sepolicy/service_contexts new file mode 100644 index 0000000..58232f7 --- /dev/null +++ b/modem/modem_svc_sit/sepolicy/service_contexts @@ -0,0 +1,2 @@ +# Bind Shared Modem Platform AIDL service name to the SELinux type. +com.google.pixel.shared_modem_platform.ISharedModemPlatform/default u:object_r:hal_shared_modem_platform_service:s0 diff --git a/modem/modem_svc_sit/shared_modem_platform.mk b/modem/modem_svc_sit/shared_modem_platform.mk new file mode 100644 index 0000000..6e9b05d --- /dev/null +++ b/modem/modem_svc_sit/shared_modem_platform.mk @@ -0,0 +1,14 @@ +# This file is not included in `modem.mk` since this is included at the +# beginning of each `device.mk` file, and so will be called before +# `SHARED_MODEM_PLATFORM_VENDOR` is defined later in the file. +# This file supoorts Whitechapel(gs101), Whitechapel Pro(gs201), Zuma, Zuma Pro. +# This file doesn't support devices which AP is after Zuma Pro. +# For device after Zuma Pro please use gs-common/modem/shared_modem_platform/shared_modem_platform.mk +SOONG_CONFIG_NAMESPACES += shared_modem_platform +SOONG_CONFIG_shared_modem_platform += \ + vendor +SOONG_CONFIG_shared_modem_platform_vendor := $(SHARED_MODEM_PLATFORM_VENDOR) + +PRODUCT_PACKAGES += shared_modem_platform +DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/modem/modem_svc_sit/compatibility_matrix.xml +BOARD_SEPOLICY_DIRS += device/google/gs-common/modem/modem_svc_sit/sepolicy diff --git a/modem/shared_modem_platform/sepolicy/file_contexts b/modem/shared_modem_platform/sepolicy/file_contexts new file mode 100644 index 0000000..8760799 --- /dev/null +++ b/modem/shared_modem_platform/sepolicy/file_contexts @@ -0,0 +1,2 @@ +# shared_modem_platform +/vendor/bin/shared_modem_platform u:object_r:shared_modem_platform_exec:s0 \ No newline at end of file diff --git a/modem/shared_modem_platform/sepolicy/shared_modem_platform.te b/modem/shared_modem_platform/sepolicy/shared_modem_platform.te new file mode 100644 index 0000000..7fc7a30 --- /dev/null +++ b/modem/shared_modem_platform/sepolicy/shared_modem_platform.te @@ -0,0 +1,2 @@ +# Shared modem platform will register the default instance of the AIDL ISharedModemPlatform hal. +hal_server_domain(shared_modem_platform, hal_shared_modem_platform) diff --git a/modem/shared_modem_platform/shared_modem_platform.mk b/modem/shared_modem_platform/shared_modem_platform.mk index 3f50c37..3c2a109 100644 --- a/modem/shared_modem_platform/shared_modem_platform.mk +++ b/modem/shared_modem_platform/shared_modem_platform.mk @@ -1,6 +1,8 @@ # This file is not included in `modem.mk` since this is included at the # beginning of each `device.mk` file, and so will be called before # `SHARED_MODEM_PLATFORM_VENDOR` is defined later in the file. +# This file supports support devices which AP is after zumapro(not include). +# For device before zumapro(include) please use gs-common/modem/modem_svc_sit/shared_modem_platform.mk SOONG_CONFIG_NAMESPACES += shared_modem_platform SOONG_CONFIG_shared_modem_platform += \ vendor @@ -8,4 +10,4 @@ SOONG_CONFIG_shared_modem_platform_vendor := $(SHARED_MODEM_PLATFORM_VENDOR) PRODUCT_PACKAGES += shared_modem_platform DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/modem/shared_modem_platform/compatibility_matrix.xml -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/modem/shared_modem_platform/sepolicy +BOARD_SEPOLICY_DIRS += device/google/gs-common/modem/shared_modem_platform/sepolicy 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/performance/Android.bp b/performance/Android.bp index 5c0e0b2..6dae537 100644 --- a/performance/Android.bp +++ b/performance/Android.bp @@ -5,7 +5,10 @@ package { 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/experiments/Android.bp b/performance/experiments/Android.bp new file mode 100644 index 0000000..a2f7ebe --- /dev/null +++ b/performance/experiments/Android.bp @@ -0,0 +1,10 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +sh_binary { + name: "pixel-experiments-recovery.sh", + src: "pixel-experiments-recovery.sh", + vendor: true, + init_rc: ["pixel-experiments-recovery.rc"], +} diff --git a/performance/experiments/apf/Android.bp b/performance/experiments/apf/Android.bp new file mode 100644 index 0000000..e5e9f7c --- /dev/null +++ b/performance/experiments/apf/Android.bp @@ -0,0 +1,10 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +prebuilt_etc { + name: "pixel-apf-experiment.rc", + src: "pixel-apf-experiment.rc", + vendor: true, + sub_dir: "init", +} diff --git a/performance/experiments/apf/apf.mk b/performance/experiments/apf/apf.mk new file mode 100644 index 0000000..d8bc338 --- /dev/null +++ b/performance/experiments/apf/apf.mk @@ -0,0 +1 @@ +PRODUCT_PACKAGES += pixel-apf-experiment.rc diff --git a/performance/experiments/apf/pixel-apf-experiment.rc b/performance/experiments/apf/pixel-apf-experiment.rc new file mode 100644 index 0000000..f160dba --- /dev/null +++ b/performance/experiments/apf/pixel-apf-experiment.rc @@ -0,0 +1,11 @@ +# APF experiment (go/pixel-perf-apf-experiment). +on property:vendor.perf.allow_experiments=1 && \ + property:vendor.pixel.system.phenotype.Perf__apf_experiment=true + setprop vendor.powerhal.apf_disabled true + setprop vendor.powerhal.apf_enabled false + +# Rampdown of the experiment. +on property:vendor.perf.allow_experiments=1 && \ + property:vendor.pixel.system.phenotype.Perf__apf_experiment="" + setprop vendor.powerhal.apf_disabled false + setprop vendor.powerhal.apf_enabled true diff --git a/performance/experiments/experiments.mk b/performance/experiments/experiments.mk new file mode 100644 index 0000000..b14b823 --- /dev/null +++ b/performance/experiments/experiments.mk @@ -0,0 +1,6 @@ +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/performance/experiments/sepolicy + +PRODUCT_PACKAGES += pixel-experiments-recovery.sh + +include device/google/gs-common/performance/experiments/kswapd/kswapd.mk +include device/google/gs-common/performance/experiments/apf/apf.mk diff --git a/performance/experiments/kswapd/Android.bp b/performance/experiments/kswapd/Android.bp new file mode 100644 index 0000000..23af711 --- /dev/null +++ b/performance/experiments/kswapd/Android.bp @@ -0,0 +1,10 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +prebuilt_etc { + name: "pixel-kswapd-experiment.rc", + src: "pixel-kswapd-experiment.rc", + vendor: true, + sub_dir: "init", +} diff --git a/performance/experiments/kswapd/kswapd.mk b/performance/experiments/kswapd/kswapd.mk new file mode 100644 index 0000000..15d762f --- /dev/null +++ b/performance/experiments/kswapd/kswapd.mk @@ -0,0 +1 @@ +PRODUCT_PACKAGES += pixel-kswapd-experiment.rc diff --git a/performance/experiments/kswapd/pixel-kswapd-experiment.rc b/performance/experiments/kswapd/pixel-kswapd-experiment.rc new file mode 100644 index 0000000..36dcac3 --- /dev/null +++ b/performance/experiments/kswapd/pixel-kswapd-experiment.rc @@ -0,0 +1,28 @@ +# Kswapd experiment - allow kswapd to run on all cores. We only target zuma and +# zumapro because these are the only platforms where kswapd avoids big cores by +# default. + +on property:vendor.perf.allow_experiments=1 \ + && property:ro.board.platform=zuma \ + && property:vendor.pixel.system.phenotype.Perf__kswapd_experiment=true + write /sys/kernel/vendor_mm/kswapd_cpu_affinity 1ff + +on property:vendor.perf.allow_experiments=1 \ + && property:ro.board.platform=zumapro \ + && property:vendor.pixel.system.phenotype.Perf__kswapd_experiment=true + write /sys/kernel/vendor_mm/kswapd_cpu_affinity ff + + +# Kswapd experiment rampdown - restore CPU affinity to the default. + +on property:vendor.perf.allow_experiments=1 \ + && property:ro.board.platform=zuma \ + && property:vendor.pixel.system.phenotype.Perf__kswapd_experiment="" + # Value is from device/google/zuma/conf/init.zuma.rc + write /sys/kernel/vendor_mm/kswapd_cpu_affinity ff + +on property:vendor.perf.allow_experiments=1 \ + && property:ro.board.platform=zumapro \ + && property:vendor.pixel.system.phenotype.Perf__kswapd_experiment="" + # Value is from device/google/zumapro/conf/init.zumapro.soc.rc + write /sys/kernel/vendor_mm/kswapd_cpu_affinity 7f diff --git a/performance/experiments/pixel-experiments-recovery.rc b/performance/experiments/pixel-experiments-recovery.rc new file mode 100644 index 0000000..a8247c3 --- /dev/null +++ b/performance/experiments/pixel-experiments-recovery.rc @@ -0,0 +1,17 @@ +# pixel-experiments-recovery.sh waits Perf__experiments_delay_seconds and sets +# vendor.perf.allow_experiments=1, triggering experiments. +service pixel-experiments-recovery /vendor/bin/pixel-experiments-recovery.sh \ + ${vendor.pixel.system.phenotype.Perf__experiments_delay_seconds} + class main + user root + group root system + oneshot + disabled + +# vendor.pixel.system.phenotype.Perf__xxx properties are set sometime after the +# device is unlocked for the first time. The check for sys.boot_completed is not +# strictly needed, but will prevent surprises if for some reason the property +# is set early. +on property:sys.boot_completed=1 && \ + property:vendor.pixel.system.phenotype.Perf__experiments_delay_seconds=* + restart pixel-experiments-recovery diff --git a/performance/experiments/pixel-experiments-recovery.sh b/performance/experiments/pixel-experiments-recovery.sh new file mode 100755 index 0000000..188222e --- /dev/null +++ b/performance/experiments/pixel-experiments-recovery.sh @@ -0,0 +1,15 @@ +#!/vendor/bin/sh + +# This script delays experiments by the specified amount of seconds. The delay is not needed for +# the normal operation, but becomes essential for the rare case (which "should not happen") where +# an experiment causes really bad issues (e.g. crashes the kernel). In such case the delay gives +# GMSCore an opportunity to fetch fresh experiments snapshot (with the bad experiment disabled). +# +# See go/pixel-perf-experiment-whatif for more info. + +delay_seconds="$1" + +if [ -n "$delay_seconds" ]; then + sleep "$delay_seconds" + /vendor/bin/setprop vendor.perf.allow_experiments 1 +fi diff --git a/performance/experiments/sepolicy/file_contexts b/performance/experiments/sepolicy/file_contexts new file mode 100644 index 0000000..7364807 --- /dev/null +++ b/performance/experiments/sepolicy/file_contexts @@ -0,0 +1 @@ +/vendor/bin/pixel-experiments-recovery\.sh u:object_r:pixel-experiments-recovery-sh_exec:s0 diff --git a/performance/experiments/sepolicy/pixel-experiments-recovery.sh.te b/performance/experiments/sepolicy/pixel-experiments-recovery.sh.te new file mode 100644 index 0000000..2da555b --- /dev/null +++ b/performance/experiments/sepolicy/pixel-experiments-recovery.sh.te @@ -0,0 +1,10 @@ +# Rules for pixel-experiments-recovery.sh + +type pixel-experiments-recovery-sh, domain; +type pixel-experiments-recovery-sh_exec, exec_type, vendor_file_type, file_type; + +init_daemon_domain(pixel-experiments-recovery-sh) + +# Allow "setprop vendor.perf.allow_experiments". +allow pixel-experiments-recovery-sh vendor_toolbox_exec:file { execute_no_trans }; +set_prop(pixel-experiments-recovery-sh, vendor_perf_allow_experiments_prop) diff --git a/performance/experiments/sepolicy/property.te b/performance/experiments/sepolicy/property.te new file mode 100644 index 0000000..e43312c --- /dev/null +++ b/performance/experiments/sepolicy/property.te @@ -0,0 +1,3 @@ +# Properties shared between experiments. + +vendor_internal_prop(vendor_perf_allow_experiments_prop) diff --git a/performance/experiments/sepolicy/property_contexts b/performance/experiments/sepolicy/property_contexts new file mode 100644 index 0000000..50de9c1 --- /dev/null +++ b/performance/experiments/sepolicy/property_contexts @@ -0,0 +1 @@ +vendor.perf.allow_experiments u:object_r:vendor_perf_allow_experiments_prop:s0 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/performance/sepolicy/proc_vendor_sched.te b/performance/sepolicy/proc_vendor_sched.te new file mode 100644 index 0000000..dc78c75 --- /dev/null +++ b/performance/sepolicy/proc_vendor_sched.te @@ -0,0 +1,2 @@ +#Vendor Sched +allow proc_vendor_sched proc:filesystem associate; 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/Android.bp b/storage/Android.bp index 3a06113..eb806bc 100644 --- a/storage/Android.bp +++ b/storage/Android.bp @@ -14,8 +14,15 @@ cc_binary { shared_libs: [ "libbase", "libdump", - "liblog", + "liblog", ], vendor: true, relative_install_path: "dump", } + +sh_binary { + name: "storage_intelligence.sh", + src: "storage_intelligence.sh", + init_rc: ["storage.intelligence.rc"], + vendor: true, +} diff --git a/storage/dump_storage.cpp b/storage/dump_storage.cpp index 3ed23b7..784078d 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 b35d412..89c1a9c 100644 --- a/storage/init.storage.rc +++ b/storage/init.storage.rc @@ -42,10 +42,13 @@ on init # 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 diff --git a/storage/sepolicy/file.te b/storage/sepolicy/file.te index 0fa9564..59b739d 100644 --- a/storage/sepolicy/file.te +++ b/storage/sepolicy/file.te @@ -4,3 +4,5 @@ type dump_storage_data_file, file_type, data_file_type; type sg_device, dev_type; type sg_util_exec, exec_type, vendor_file_type, file_type; +# Intelligence Service +type intelligence_data_file, file_type, data_file_type; diff --git a/storage/sepolicy/file_contexts b/storage/sepolicy/file_contexts index 1ef5a67..18527fb 100644 --- a/storage/sepolicy/file_contexts +++ b/storage/sepolicy/file_contexts @@ -1,9 +1,13 @@ # storage -/vendor/bin/dump/dump_storage u:object_r:dump_storage_exec:s0 -/sys/devices/platform/[0-9a-z]+\.ufs/pixel/enable_pixel_ufs_logging u:object_r:sysfs_scsi_devices_0000:s0 -/dev/sg[0-9] u:object_r:sg_device:s0 -/data/vendor/storage(/.*)? u:object_r:dump_storage_data_file:s0 -/vendor/bin/sg_read_buffer u:object_r:sg_util_exec:s0 -/dev/block/by-name/userdata_exp.* u:object_r:userdata_exp_block_device:s0 -/vendor/bin/ufs_firmware_update\.sh u:object_r:ufs_firmware_update_exec:s0 +/data/vendor/intelligence(/.*)? u:object_r:intelligence_data_file:s0 +/data/vendor/storage(/.*)? u:object_r:dump_storage_data_file:s0 +/dev/block/by-name/userdata_exp.* u:object_r:userdata_exp_block_device:s0 +/dev/sg[0-9] u:object_r:sg_device:s0 + +/sys/devices/platform/[0-9a-z]+\.ufs/pixel/enable_pixel_ufs_logging u:object_r:sysfs_scsi_devices_0000:s0 + +/vendor/bin/dump/dump_storage u:object_r:dump_storage_exec:s0 +/vendor/bin/sg_read_buffer u:object_r:sg_util_exec:s0 +/vendor/bin/storage_intelligence\.sh u:object_r:storage_intelligence_exec:s0 +/vendor/bin/ufs_firmware_update\.sh u:object_r:ufs_firmware_update_exec:s0 diff --git a/storage/sepolicy/init.te b/storage/sepolicy/init.te index dc24247..464ca4b 100644 --- a/storage/sepolicy/init.te +++ b/storage/sepolicy/init.te @@ -1,3 +1,4 @@ # init allow init sysfs_scsi_devices_0000:file w_file_perms; +dontaudit init intelligence_data_file:dir mounton; diff --git a/storage/sepolicy/kernel.te b/storage/sepolicy/kernel.te new file mode 100644 index 0000000..55882ed --- /dev/null +++ b/storage/sepolicy/kernel.te @@ -0,0 +1,3 @@ +# for intelligence service + +allow kernel userdata_exp_block_device:blk_file read; diff --git a/storage/sepolicy/property.te b/storage/sepolicy/property.te new file mode 100644 index 0000000..598c71a --- /dev/null +++ b/storage/sepolicy/property.te @@ -0,0 +1,3 @@ +# for intelligence service + +vendor_internal_prop(vendor_intelligence_prop) diff --git a/storage/sepolicy/property_contexts b/storage/sepolicy/property_contexts new file mode 100644 index 0000000..b436986 --- /dev/null +++ b/storage/sepolicy/property_contexts @@ -0,0 +1 @@ +persist.vendor.intelligence u:object_r:vendor_intelligence_prop:s0 diff --git a/storage/sepolicy/storage_intelligence.te b/storage/sepolicy/storage_intelligence.te new file mode 100644 index 0000000..66d14df --- /dev/null +++ b/storage/sepolicy/storage_intelligence.te @@ -0,0 +1,12 @@ +# support intelligence service +init_daemon_domain(storage_intelligence) +type storage_intelligence, domain; +type storage_intelligence_exec, vendor_file_type, exec_type, file_type; + +set_prop(storage_intelligence, vendor_intelligence_prop); + +allow storage_intelligence vendor_toolbox_exec:file execute_no_trans; + +# for storage management +allow storage_intelligence block_device:dir { search }; +allow storage_intelligence userdata_exp_block_device:blk_file rw_file_perms; diff --git a/storage/sepolicy/tracking_denials/bug_map b/storage/sepolicy/tracking_denials/bug_map new file mode 100644 index 0000000..a1e8298 --- /dev/null +++ b/storage/sepolicy/tracking_denials/bug_map @@ -0,0 +1 @@ +shell vendor_intelligence_prop file b/378120929 diff --git a/storage/sepolicy/vendor_init.te b/storage/sepolicy/vendor_init.te index 73eb527..cbb2990 100644 --- a/storage/sepolicy/vendor_init.te +++ b/storage/sepolicy/vendor_init.te @@ -4,3 +4,5 @@ allow vendor_init sg_device:chr_file r_file_perms; # dirty swappiness allow vendor_init proc_dirty:file w_file_perms; +# intelligence +set_prop(vendor_init, vendor_intelligence_prop); diff --git a/storage/storage.intelligence.rc b/storage/storage.intelligence.rc new file mode 100644 index 0000000..85586ab --- /dev/null +++ b/storage/storage.intelligence.rc @@ -0,0 +1,23 @@ +# For intelligence service +# on -> mount(ok) -> on +# off -> write_zeroes -> remove -> rm(ok) -> disable +# on -> mount(fail) -> remove -> rm(ok) -> disable + +service storage_intelligence /vendor/bin/storage_intelligence.sh + user root + disabled + oneshot + +on boot && property:persist.vendor.intelligence=on + mkdir /data/vendor/intelligence 0770 vendor_intelligence vendor_intelligence + restorecon_recursive /data/vendor/intelligence + mount f2fs loop@/dev/block/by-name/userdata_exp.ai /data/vendor/intelligence ro + start storage_intelligence + +on boot && property:persist.vendor.intelligence=off + start storage_intelligence + +on property:persist.vendor.intelligence=remove + rm /data/userdata_exp.ai + rmdir /data/vendor/intelligence + setprop persist.vendor.intelligence disable diff --git a/storage/storage.mk b/storage/storage.mk index eafed3d..511e515 100644 --- a/storage/storage.mk +++ b/storage/storage.mk @@ -1,4 +1,6 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/storage/sepolicy +BOARD_VENDOR_SEPOLICY_DIRS += \ + device/google/gs-common/storage/sepolicy \ + device/google/gs-common/storage/sepolicy/tracking_denials PRODUCT_PACKAGES += dump_storage diff --git a/storage/storage_intelligence.sh b/storage/storage_intelligence.sh new file mode 100755 index 0000000..03d2ca7 --- /dev/null +++ b/storage/storage_intelligence.sh @@ -0,0 +1,24 @@ +#!/vendor/bin/sh +# +# The script belongs to the feature of UFS FFU via OTA: go/p23-ffu-ota +# Its purpose is to copy the corresponding firmware into partition for UFS FFU. + + +property="persist.vendor.intelligence" +partition="/dev/block/by-name/userdata_exp.ai" +mount_point="/data/vendor/intelligence" +backend_file="/data/userdata_exp.ai" + +request=`getprop $property` + +if [ "$request" == "on" ]; then + mounted=`grep $mount_point /proc/mounts` + if [ "$mounted" ]; then + setprop $property on + else + setprop $property remove + fi +elif [ "$request" == "off" ]; then + dd if=/dev/zero of=$partition bs=4k count=2 + setprop $property remove +fi diff --git a/storage/tracking_denials/bug_map b/storage/tracking_denials/bug_map new file mode 100644 index 0000000..a1e8298 --- /dev/null +++ b/storage/tracking_denials/bug_map @@ -0,0 +1 @@ +shell vendor_intelligence_prop file b/378120929 diff --git a/touch/focaltech/Android.bp b/touch/focaltech/Android.bp index ebaa308..0b53132 100644 --- a/touch/focaltech/Android.bp +++ b/touch/focaltech/Android.bp @@ -9,3 +9,11 @@ sh_binary { vendor: true, sub_dir: "dump", } + +sh_binary { + name: "predump_focaltech.sh", + src: "dump_focaltech.sh", + init_rc: ["init.touch.rc"], + vendor: true, + sub_dir: "dump_touch", +} diff --git a/touch/focaltech/predump_focaltech.mk b/touch/focaltech/predump_focaltech.mk new file mode 100644 index 0000000..aff76bc --- /dev/null +++ b/touch/focaltech/predump_focaltech.mk @@ -0,0 +1,3 @@ +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/focaltech/predump_sepolicy + +PRODUCT_PACKAGES += predump_focaltech.sh diff --git a/touch/focaltech/predump_sepolicy/file.te b/touch/focaltech/predump_sepolicy/file.te new file mode 100644 index 0000000..696f244 --- /dev/null +++ b/touch/focaltech/predump_sepolicy/file.te @@ -0,0 +1,2 @@ +# touch predump script +type proc_touch, proc_type, fs_type; diff --git a/touch/focaltech/predump_sepolicy/file_contexts b/touch/focaltech/predump_sepolicy/file_contexts new file mode 100644 index 0000000..517895b --- /dev/null +++ b/touch/focaltech/predump_sepolicy/file_contexts @@ -0,0 +1,2 @@ +/vendor/bin/dump/predump_focaltech\.sh u:object_r:predump_touch_exec:s0 + diff --git a/touch/focaltech/predump_sepolicy/genfs_contexts b/touch/focaltech/predump_sepolicy/genfs_contexts new file mode 100644 index 0000000..2ac9314 --- /dev/null +++ b/touch/focaltech/predump_sepolicy/genfs_contexts @@ -0,0 +1,3 @@ +genfscon proc /focaltech_touch u:object_r:proc_touch:s0 + + diff --git a/touch/focaltech/predump_sepolicy/predump_touch.te b/touch/focaltech/predump_sepolicy/predump_touch.te new file mode 100644 index 0000000..c34ba49 --- /dev/null +++ b/touch/focaltech/predump_sepolicy/predump_touch.te @@ -0,0 +1,3 @@ +# touch predump script +allow predump_touch proc_touch:dir search; +allow predump_touch proc_touch:file rw_file_perms; 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/touch/stm/Android.bp b/touch/stm/Android.bp index 1727f07..0d64fd6 100644 --- a/touch/stm/Android.bp +++ b/touch/stm/Android.bp @@ -8,3 +8,10 @@ sh_binary { vendor: true, sub_dir: "dump", } + +sh_binary { + name: "predump_stm.sh", + src: "dump_stm.sh", + vendor: true, + sub_dir: "dump_touch", +} diff --git a/touch/stm/predump_sepolicy/file.te b/touch/stm/predump_sepolicy/file.te new file mode 100644 index 0000000..7f298c3 --- /dev/null +++ b/touch/stm/predump_sepolicy/file.te @@ -0,0 +1,3 @@ +# touch predump script +type proc_touch, proc_type, fs_type; +type sysfs_touch, sysfs_type, fs_type; diff --git a/touch/stm/predump_sepolicy/file_contexts b/touch/stm/predump_sepolicy/file_contexts new file mode 100644 index 0000000..2667543 --- /dev/null +++ b/touch/stm/predump_sepolicy/file_contexts @@ -0,0 +1,2 @@ +/vendor/bin/dump_touch/predump_stm\.sh u:object_r:predump_touch_exec:s0 + diff --git a/touch/stm/predump_sepolicy/genfs_contexts b/touch/stm/predump_sepolicy/genfs_contexts new file mode 100644 index 0000000..2ed8978 --- /dev/null +++ b/touch/stm/predump_sepolicy/genfs_contexts @@ -0,0 +1,7 @@ +genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0 u:object_r:sysfs_touch:s0 +genfscon sysfs /devices/platform/10d40000.spi/spi_master/spi11/spi11.0 u:object_r:sysfs_touch:s0 +genfscon sysfs /devices/platform/10950000.spi/spi_master/spi6/spi6.0 u:object_r:sysfs_touch:s0 + +genfscon proc /fts/driver_test u:object_r:proc_touch:s0 +genfscon proc /fts_ext/driver_test u:object_r:proc_touch:s0 + diff --git a/touch/stm/predump_sepolicy/predump_touch.te b/touch/stm/predump_sepolicy/predump_touch.te new file mode 100644 index 0000000..f0f458c --- /dev/null +++ b/touch/stm/predump_sepolicy/predump_touch.te @@ -0,0 +1,6 @@ +# touch predump script +allow predump_touch proc_touch:file rw_file_perms; +allow predump_touch sysfs_touch:dir search; +allow predump_touch sysfs_touch:file rw_file_perms; + +get_prop(predump_touch vendor_touch_dump_path_prop) diff --git a/touch/stm/predump_sepolicy/property.te b/touch/stm/predump_sepolicy/property.te new file mode 100644 index 0000000..612c855 --- /dev/null +++ b/touch/stm/predump_sepolicy/property.te @@ -0,0 +1,2 @@ +# touch predump script +vendor_internal_prop(vendor_touch_dump_path_prop) diff --git a/touch/stm/predump_sepolicy/property_contexts b/touch/stm/predump_sepolicy/property_contexts new file mode 100644 index 0000000..db9fd5a --- /dev/null +++ b/touch/stm/predump_sepolicy/property_contexts @@ -0,0 +1,2 @@ +ro.vendor.touch.dump. u:object_r:vendor_touch_dump_path_prop:s0 + diff --git a/touch/stm/predump_sepolicy/vendor_init.te b/touch/stm/predump_sepolicy/vendor_init.te new file mode 100644 index 0000000..9017c5b --- /dev/null +++ b/touch/stm/predump_sepolicy/vendor_init.te @@ -0,0 +1,2 @@ +# touch predump script +set_prop(vendor_init, vendor_touch_dump_path_prop) diff --git a/touch/stm/predump_stm20.mk b/touch/stm/predump_stm20.mk new file mode 100644 index 0000000..cdf3e35 --- /dev/null +++ b/touch/stm/predump_stm20.mk @@ -0,0 +1,6 @@ +PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi20/spi20.0 +PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts/driver_test + +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/predump_sepolicy + +PRODUCT_PACKAGES += predump_stm.sh diff --git a/touch/stm/predump_stm6.mk b/touch/stm/predump_stm6.mk new file mode 100644 index 0000000..2cbde2c --- /dev/null +++ b/touch/stm/predump_stm6.mk @@ -0,0 +1,6 @@ +PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi6/spi6.0 +PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts_ext/driver_test + +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/predump_sepolicy + +PRODUCT_PACKAGES += predump_stm.sh 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..3e0a6fd --- /dev/null +++ b/vibrator/flags/VibratorFlags.aconfig @@ -0,0 +1,18 @@ +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" +} + +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 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:file create_file_perms; 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; +