diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index 5a0f14d2..1b246e13 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -32,7 +32,9 @@ TARGET_CPU_ABI := arm64-v8a TARGET_CPU_VARIANT := cortex-a55 TARGET_CPU_VARIANT_RUNTIME := cortex-a55 -ifeq (,$(filter %_64,$(TARGET_PRODUCT))) +DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false) + +ifneq ($(DEVICE_IS_64BIT_ONLY),true) TARGET_2ND_ARCH := arm TARGET_2ND_ARCH_VARIANT := armv8-a TARGET_2ND_CPU_ABI := armeabi-v7a @@ -44,7 +46,6 @@ endif BOARD_KERNEL_CMDLINE += dyndbg=\"func alloc_contig_dump_pages +p\" BOARD_KERNEL_CMDLINE += earlycon=exynos4210,0x10A00000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on BOARD_KERNEL_CMDLINE += cma_sysfs.experimental=Y -BOARD_KERNEL_CMDLINE += stack_depot_disable=off page_pinner=on BOARD_KERNEL_CMDLINE += swiotlb=noforce BOARD_BOOTCONFIG += androidboot.boot_devices=14700000.ufs @@ -183,6 +184,9 @@ BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \ # Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB BOARD_SUPER_PARTITION_ERROR_LIMIT := 8006926336 +# Testing related defines +BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/r4o6-setup.sh + # # AUDIO & VOICE # @@ -311,22 +315,6 @@ BOARD_VNDK_VERSION := current # H/W align restriction of MM IPs BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64 -# WiFi -BOARD_WLAN_DEVICE := bcmdhd -BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd -BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd -WPA_SUPPLICANT_VERSION := VER_0_8_X -BOARD_WPA_SUPPLICANT_DRIVER := NL80211 -BOARD_HOSTAPD_DRIVER := NL80211 -# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {1 STA + 1 P2P} -# or {1 STA + 1 NAN} or {2 STA} -WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}} -WIFI_FEATURE_WIFI_EXT_HAL := true -WIFI_FEATURE_IMU_DETECTION := true -# Avoid Wifi reset on MAC Address change -WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true -WIFI_FEATURE_HOSTAPD_11AX := true - # NeuralNetworks GPU_SOURCE_PRESENT := $(wildcard vendor/arm/mali/valhall) GPU_PREBUILD_PRESENT := $(wildcard vendor/google_devices/gs101/prebuilts/gpu/libs) @@ -361,11 +349,11 @@ BOARD_BUILD_SYSTEM_ROOT_IMAGE := false # Vendor ramdisk image for kernel development BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true -BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := device/google/gs101/vendor_dlkm.blocklist - KERNEL_MODULE_DIR := $(TARGET_KERNEL_DIR) KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko) +BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist + BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load)) ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD $(error vendor_boot.modules.load not found or empty) @@ -389,4 +377,7 @@ BOARD_KERNEL_CMDLINE += at24.write_timeout=100 # Enable larger logbuf BOARD_KERNEL_CMDLINE += log_buf_len=1024K +# Protected VM firmware +BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000 + -include vendor/google_devices/gs101/proprietary/BoardConfigVendor.mk diff --git a/CleanSpec.mk b/CleanSpec.mk index 12538be2..e4165fbb 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -65,13 +65,13 @@ $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/init/android.hardware.pow # Health storage HAL $(call add-clean-step, find $(PRODUCT_OUT) -type f -name "*android.hardware.health.storage@1.0*" -print0 | xargs -0 rm -f) -# Update to USB HAL 1.3 -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.usb@1.2-service.slider) -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.usb@1.2-service.slider.rc) -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.usb@1.2-service.slider.xml) -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.usb@1.3-service.slider) -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.usb@1.3-service.slider.rc) -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.usb@1.3-service.slider.xml) +# USB HAL to AIDL +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.usb-service.gs101) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.usb.gadget-service.gs101) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.usb-service.rc) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.usb.gadget-service-gs101.rc) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.usb-service.xml) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.usb.gadget@1.2-service.gs101.xml) # Power Stats HAL 1.0 to AIDL $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.power.stats@1.0-service.gs101) @@ -83,3 +83,9 @@ $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.keyma $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/init/android.hardware.keymaster@4.0-service.trusty.rc) $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.keymaster@4.0-service.trusty.xml) $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/bin/hw/wait_for_strongbox) + +# Health HAL to AIDL +$(call add-clean-step, find $(PRODUCT_OUT)/system -type f -name "*charger*" -print0 | xargs -0 rm -f) +$(call add-clean-step, find $(PRODUCT_OUT)/vendor -type f -name "*health@*" -print0 | xargs -0 rm -f) +$(call add-clean-step, find $(PRODUCT_OUT)/recovery/root -type f -name "*charger*" -print0 | xargs -0 rm -f) +$(call add-clean-step, find $(PRODUCT_OUT)/recovery/root -type f -name "*health@*" -print0 | xargs -0 rm -f) diff --git a/OWNERS b/OWNERS new file mode 100644 index 00000000..4d9cf6e4 --- /dev/null +++ b/OWNERS @@ -0,0 +1,2 @@ +per-file powerhint.json = wvw@google.com,joaodias@google.com,jenhaochen@google.com,rkganesh@google.com,jychen@google.com +per-file powerhint.json = wvw@google.com,joaodias@google.com,jenhaochen@google.com,rkganesh@google.com,jychen@google.com diff --git a/aosp_common.mk b/aosp_common.mk index 1ad6eb71..5ba98821 100644 --- a/aosp_common.mk +++ b/aosp_common.mk @@ -17,11 +17,14 @@ # # All components inherited here go to system image # -ifeq (,$(filter %_64,$(TARGET_PRODUCT))) -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -else +DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false) + +ifeq ($(DEVICE_IS_64BIT_ONLY),true) $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) +else +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) endif + $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable CSI checking diff --git a/bluetooth/bluetooth.mk b/bluetooth/bluetooth.mk new file mode 100644 index 00000000..f2036106 --- /dev/null +++ b/bluetooth/bluetooth.mk @@ -0,0 +1,4 @@ +PRODUCT_PACKAGES += \ + android.hardware.bluetooth@1.1-service.bcmbtlinux + +BOARD_SEPOLICY_DIRS += device/google/gs101-sepolicy/bluetooth diff --git a/conf/Android.bp b/conf/Android.bp index 5e586785..45e6b6fa 100644 --- a/conf/Android.bp +++ b/conf/Android.bp @@ -24,6 +24,12 @@ // identical with the exception of the encryption settings, so to keep them in // sync the rules below generate them from a template file. +soong_namespace { + imports: [ + "device/google/gs101", + ], +} + package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import @@ -33,6 +39,11 @@ package { default_applicable_licenses: ["device_google_gs101_license"], } +filegroup { + name: "gs101_srcs", + srcs: ["fstab.gs101.in"], +} + genrule { name: "gen_fstab.gs101", srcs: ["fstab.gs101.in"], diff --git a/conf/fstab.gs101.in b/conf/fstab.gs101.in index 8b7a7e3b..ef84e9b6 100644 --- a/conf/fstab.gs101.in +++ b/conf/fstab.gs101.in @@ -17,6 +17,6 @@ vendor_dlkm /vendor_dlkm /dev/block/platform/14700000.ufs/by-name/misc /misc emmc defaults wait /dev/block/platform/14700000.ufs/by-name/metadata /metadata ext4 noatime,nosuid,nodev,data=journal,commit=1 wait,check,formattable,first_stage_mount,metadata_csum /dev/block/platform/14700000.ufs/by-name/pvmfw /pvmfw emmc defaults wait,slotselect,avb=pvmfw,first_stage_mount -/dev/block/platform/14700000.ufs/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt,compress_extension=apk,compress_extension=apex,compress_extension=so,atgc,checkpoint_merge latemount,wait,check,quota,formattable,sysfs_path=/dev/sys/block/bootdevice,checkpoint=fs,reservedsize=128M,fileencryption=@fileencryption@,metadata_encryption=@metadata_encryption@,keydirectory=/metadata/vold/metadata_encryption,fscompress,readahead_size_kb=128 +/dev/block/platform/14700000.ufs/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt,atgc,checkpoint_merge latemount,wait,check,quota,formattable,sysfs_path=/dev/sys/block/bootdevice,checkpoint=fs,reservedsize=128M,fileencryption=@fileencryption@,metadata_encryption=@metadata_encryption@,keydirectory=/metadata/vold/metadata_encryption,fscompress,readahead_size_kb=128 /dev/block/platform/14700000.ufs/by-name/vbmeta /vbmeta emmc defaults slotselect,first_stage_mount /devices/platform/11110000.usb* auto vfat defaults voldmanaged=usb:auto diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc index 09ab2e6c..bf63c26f 100644 --- a/conf/init.gs101.rc +++ b/conf/init.gs101.rc @@ -3,17 +3,6 @@ import android.hardware.drm@1.2-service.widevine.rc import init.exynos.sensorhub.rc import /vendor/etc/init/hw/init.aoc.rc -service vendor.charger /system/bin/charger - class charger - seclabel u:r:charger:s0 - user system - group system wakelock input - capabilities SYS_BOOT - file /dev/kmsg w - file /sys/fs/pstore/console-ramoops-0 r - file /sys/fs/pstore/console-ramoops r - file /proc/last_kmsg r - on early-init mount_all /vendor/etc/fstab.persist --early @@ -29,29 +18,75 @@ on init write /dev/sys/fs/by-name/userdata/data_io_flag 56 write /dev/sys/fs/by-name/userdata/node_io_flag 56 - chown system system /sys/kernel/vendor_sched/set_task_group_bg - chown system system /sys/kernel/vendor_sched/set_task_group_cam - chown system system /sys/kernel/vendor_sched/set_task_group_fg - chown system system /sys/kernel/vendor_sched/set_task_group_nnapi - chown system system /sys/kernel/vendor_sched/set_task_group_sys - chown system system /sys/kernel/vendor_sched/set_task_group_sysbg - chown system system /sys/kernel/vendor_sched/set_task_group_ta - chown system system /sys/kernel/vendor_sched/set_task_group_rt - chown system system /sys/kernel/vendor_sched/set_task_group_sf - chown system system /sys/kernel/vendor_sched/set_task_group_dex2oat - chown system system /sys/kernel/vendor_sched/clear_group + chown system system /proc/vendor_sched/set_task_group_bg + chown system system /proc/vendor_sched/set_task_group_cam + chown system system /proc/vendor_sched/set_task_group_fg + chown system system /proc/vendor_sched/set_task_group_nnapi + chown system system /proc/vendor_sched/set_task_group_sys + chown system system /proc/vendor_sched/set_task_group_sysbg + chown system system /proc/vendor_sched/set_task_group_ta + chown system system /proc/vendor_sched/set_task_group_rt + chown system system /proc/vendor_sched/set_task_group_sf + chown system system /proc/vendor_sched/set_task_group_dex2oat + chown system system /proc/vendor_sched/set_task_group_cam_power + chown system system /proc/vendor_sched/set_task_group_ota + chown system system /proc/vendor_sched/set_proc_group_bg + chown system system /proc/vendor_sched/set_proc_group_cam + chown system system /proc/vendor_sched/set_proc_group_fg + chown system system /proc/vendor_sched/set_proc_group_nnapi + chown system system /proc/vendor_sched/set_proc_group_sys + chown system system /proc/vendor_sched/set_proc_group_sysbg + chown system system /proc/vendor_sched/set_proc_group_ta + chown system system /proc/vendor_sched/set_proc_group_rt + chown system system /proc/vendor_sched/set_proc_group_sf + chown system system /proc/vendor_sched/set_proc_group_dex2oat + chown system system /proc/vendor_sched/set_proc_group_cam_power + chown system system /proc/vendor_sched/set_proc_group_ota + chown system system /proc/vendor_sched/prefer_idle_set + chown system system /proc/vendor_sched/prefer_idle_clear + chown system system /proc/vendor_sched/pmu_poll_enable + chown system system /proc/vendor_sched/pmu_poll_time + chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/lcpi_threshold + chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/spc_threshold + chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/limit_frequency + chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/pmu_limit_enable + chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/lcpi_threshold + chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/spc_threshold + chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/limit_frequency + chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/pmu_limit_enable + chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/lcpi_threshold + chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/spc_threshold + chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/limit_frequency + chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/pmu_limit_enable - chmod 0220 /sys/kernel/vendor_sched/set_task_group_bg - chmod 0220 /sys/kernel/vendor_sched/set_task_group_cam - chmod 0220 /sys/kernel/vendor_sched/set_task_group_fg - chmod 0220 /sys/kernel/vendor_sched/set_task_group_nnapi - chmod 0220 /sys/kernel/vendor_sched/set_task_group_sys - chmod 0220 /sys/kernel/vendor_sched/set_task_group_sysbg - chmod 0220 /sys/kernel/vendor_sched/set_task_group_ta - chmod 0220 /sys/kernel/vendor_sched/set_task_group_rt - chmod 0220 /sys/kernel/vendor_sched/set_task_group_sf - chmod 0220 /sys/kernel/vendor_sched/set_task_group_dex2oat - chmod 0220 /sys/kernel/vendor_sched/clear_group + chmod 0220 /proc/vendor_sched/set_task_group_bg + chmod 0220 /proc/vendor_sched/set_task_group_cam + chmod 0220 /proc/vendor_sched/set_task_group_fg + chmod 0220 /proc/vendor_sched/set_task_group_nnapi + chmod 0220 /proc/vendor_sched/set_task_group_sys + chmod 0220 /proc/vendor_sched/set_task_group_sysbg + chmod 0220 /proc/vendor_sched/set_task_group_ta + chmod 0220 /proc/vendor_sched/set_task_group_rt + chmod 0220 /proc/vendor_sched/set_task_group_sf + chmod 0220 /proc/vendor_sched/set_task_group_dex2oat + chmod 0220 /proc/vendor_sched/set_task_group_cam_power + chmod 0220 /proc/vendor_sched/set_task_group_ota + chmod 0220 /proc/vendor_sched/set_proc_group_bg + chmod 0220 /proc/vendor_sched/set_proc_group_cam + chmod 0220 /proc/vendor_sched/set_proc_group_fg + chmod 0220 /proc/vendor_sched/set_proc_group_nnapi + chmod 0220 /proc/vendor_sched/set_proc_group_sys + chmod 0220 /proc/vendor_sched/set_proc_group_sysbg + chmod 0220 /proc/vendor_sched/set_proc_group_ta + chmod 0220 /proc/vendor_sched/set_proc_group_rt + chmod 0220 /proc/vendor_sched/set_proc_group_sf + chmod 0220 /proc/vendor_sched/set_proc_group_dex2oat + chmod 0220 /proc/vendor_sched/set_proc_group_cam_power + chmod 0220 /proc/vendor_sched/set_proc_group_ota + chmod 0220 /proc/vendor_sched/prefer_idle_set + chmod 0220 /proc/vendor_sched/prefer_idle_clear + chmod 0220 /proc/vendor_sched/pmu_poll_enable + chmod 0220 /proc/vendor_sched/pmu_poll_time wait /dev/block/platform/${ro.boot.boot_devices} symlink /dev/block/platform/${ro.boot.boot_devices} /dev/block/bootdevice @@ -68,10 +103,6 @@ on init write /sys/block/zram0/comp_algorithm lz77eh write /proc/sys/vm/page-cluster 0 - # Page Pinner dumping at bugreport - chown system system /sys/kernel/debug/page_pinner/longterm_pinner - chown system system /sys/kernel/debug/page_pinner/alloc_contig_failed - # Some user code relies on ro.boot.hardware.revision setprop ro.boot.hardware.revision ${ro.revision} @@ -117,12 +148,12 @@ on init mkdir /dev/socket/pdx/system/vr/sensors 0775 system system # Boot time 183626384 - write /sys/kernel/vendor_sched/ta_uclamp_min 1024 - write /sys/kernel/vendor_sched/ta_prefer_idle 1 - write /sys/kernel/vendor_sched/fg_uclamp_min 1024 - write /sys/kernel/vendor_sched/fg_prefer_idle 1 - write /sys/kernel/vendor_sched/sys_uclamp_min 1024 - write /sys/kernel/vendor_sched/sys_prefer_idle 1 + write /proc/vendor_sched/ta_uclamp_min 1024 + write /proc/vendor_sched/ta_prefer_idle 1 + write /proc/vendor_sched/fg_uclamp_min 1024 + write /proc/vendor_sched/fg_prefer_idle 1 + write /proc/vendor_sched/sys_uclamp_min 1024 + write /proc/vendor_sched/sys_prefer_idle 1 # governor setting write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor sched_pixel @@ -163,8 +194,8 @@ on init chown system system /dev/cpuset/camera-daemon-mid-high-group/tasks chmod 0664 /dev/cpuset/camera-daemon-mid-high-group/tasks - write /sys/kernel/vendor_sched/cam_prefer_idle 1 - write /sys/kernel/vendor_sched/cam_uclamp_min 1 + write /proc/vendor_sched/cam_prefer_idle 1 + write /proc/vendor_sched/cam_uclamp_min 1 chown system system /dev/cpuset/cgroup.procs @@ -198,6 +229,9 @@ on init chown system system /sys/class/power_supply/maxfg_base/m5_model_state # Dump eeprom + chown system system /sys/devices/platform/10970000.hsi2c/i2c-8/8-0050/eeprom + chown system system /sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom + chown system system /sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom chown system system /sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom chown system system /sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom chown system system /dev/battery_history @@ -217,6 +251,9 @@ on init # Wireless Charge stats (write 0) chown system system /sys/class/power_supply/wireless/device/charge_stats + # Thermal Charge stats (write 0) + chown system system /sys/devices/platform/google,charger/thermal_stats + # Permission for wireless charging chown system system /sys/class/power_supply/wireless/capacity chown system system /sys/class/power_supply/wireless/device/rtx @@ -268,8 +305,8 @@ on init start watchdogd # Add a boost for NNAPI HAL - write /sys/kernel/vendor_sched/nnapi_prefer_idle 0 - write /sys/kernel/vendor_sched/nnapi_uclamp_min 512 + write /proc/vendor_sched/nnapi_prefer_idle 0 + write /proc/vendor_sched/nnapi_uclamp_min 512 # Add memlat governor settings write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/polling_interval 10 @@ -394,7 +431,7 @@ on post-fs-data on zygote-start # For PixelLogger configuration file. chmod 0771 /data/vendor/wifi - write /sys/kernel/vendor_sched/sys_uclamp_min 0 + write /proc/vendor_sched/sys_uclamp_min 0 on post-fs-data # Create the directories used by the Wireless subsystem @@ -546,32 +583,33 @@ on fs chown system system /sys/devices/platform/exynos-drm/primary-panel/gamma chown system system /sys/devices/platform/exynos-drm/primary-panel/min_vrefresh chown system system /sys/devices/platform/exynos-drm/primary-panel/idle_delay_ms + chown system system /sys/devices/platform/exynos-drm/primary-panel/panel_need_handle_idle_exit chown system system /sys/module/drm/parameters/vblankoffdelay - chown system system /sys/class/dqe/atc/ambient_light - chown system system /sys/class/dqe/atc/st - chown system system /sys/class/dqe/atc/en - chown system system /sys/class/dqe/atc/lt - chown system system /sys/class/dqe/atc/ns - chown system system /sys/class/dqe/atc/dither - chown system system /sys/class/dqe/atc/pl_w1 - chown system system /sys/class/dqe/atc/pl_w2 - chown system system /sys/class/dqe/atc/ctmode - chown system system /sys/class/dqe/atc/pp_en - chown system system /sys/class/dqe/atc/upgrade_on - chown system system /sys/class/dqe/atc/tdr_max - chown system system /sys/class/dqe/atc/tdr_min - chown system system /sys/class/dqe/atc/back_light - chown system system /sys/class/dqe/atc/dstep - chown system system /sys/class/dqe/atc/scale_mode - chown system system /sys/class/dqe/atc/threshold_1 - chown system system /sys/class/dqe/atc/threshold_2 - chown system system /sys/class/dqe/atc/threshold_3 - chown system system /sys/class/dqe/atc/gain_limit - chown system system /sys/class/dqe/atc/lt_calc_ab_shift + chown system system /sys/class/dqe0/atc/ambient_light + chown system system /sys/class/dqe0/atc/st + chown system system /sys/class/dqe0/atc/en + chown system system /sys/class/dqe0/atc/lt + chown system system /sys/class/dqe0/atc/ns + chown system system /sys/class/dqe0/atc/dither + chown system system /sys/class/dqe0/atc/pl_w1 + chown system system /sys/class/dqe0/atc/pl_w2 + chown system system /sys/class/dqe0/atc/ctmode + chown system system /sys/class/dqe0/atc/pp_en + chown system system /sys/class/dqe0/atc/upgrade_on + chown system system /sys/class/dqe0/atc/tdr_max + chown system system /sys/class/dqe0/atc/tdr_min + chown system system /sys/class/dqe0/atc/back_light + chown system system /sys/class/dqe0/atc/dstep + chown system system /sys/class/dqe0/atc/scale_mode + chown system system /sys/class/dqe0/atc/threshold_1 + chown system system /sys/class/dqe0/atc/threshold_2 + chown system system /sys/class/dqe0/atc/threshold_3 + chown system system /sys/class/dqe0/atc/gain_limit + chown system system /sys/class/dqe0/atc/lt_calc_ab_shift chown system system /sys/devices/platform/1c300000.drmdecon/early_wakeup - chmod 0220 /sys/devices/platform/1c300000.drmdecon/early_wakeup + chmod 0660 /sys/devices/platform/1c300000.drmdecon/early_wakeup chown system system /sys/devices/platform/1c302000.drmdecon/early_wakeup - chmod 0220 /sys/devices/platform/1c302000.drmdecon/early_wakeup + chmod 0660 /sys/devices/platform/1c302000.drmdecon/early_wakeup # Copy DRM Key # copy /system/app/wv.keys /factory/wv.keys @@ -597,11 +635,7 @@ service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1p2p_device=1 \ -m/vendor/etc/wifi/p2p_supplicant.conf \ -g@android:wpa_wlan0 -dd - interface android.hardware.wifi.supplicant@1.0::ISupplicant default - interface android.hardware.wifi.supplicant@1.1::ISupplicant default - interface android.hardware.wifi.supplicant@1.2::ISupplicant default - interface android.hardware.wifi.supplicant@1.3::ISupplicant default - interface android.hardware.wifi.supplicant@1.4::ISupplicant default + interface aidl android.hardware.wifi.supplicant.ISupplicant/default socket wpa_wlan0 dgram 660 wifi wifi class main disabled @@ -653,6 +687,8 @@ on property:vendor.device.modules.ready=1 chown system system /sys/devices/virtual/sec/tsp/cmd chown system system /sys/devices/virtual/sec/tsp/cmd_result chown system system /sys/devices/virtual/sec/tsp/status + chown system system /sys/class/spi_master/spi11/spi11.0/input/nvt_touch/force_touch_active + chown system system /sys/class/spi_master/spi11/spi11.0/input/nvt_touch/nvt_dttw_mode # Allow access to touch chown system input /dev/touch_offload chmod 660 /dev/touch_offload @@ -693,10 +729,6 @@ on property:sys.boot_completed=1 chown system system /dev/sys/fs/by-name/userdata/gc_segment_mode chown system system /dev/sys/fs/by-name/userdata/gc_reclaimed_segments - # Block layer tuning: discard chunk size up to 128MB - # Otherwise, contiguous discards can be merged - write /sys/block/sda/queue/discard_max_bytes 134217728 - # Enable ZRAM on boot_complete swapon_all /vendor/etc/fstab.${ro.board.platform} write /proc/sys/vm/swappiness 100 @@ -708,36 +740,57 @@ on property:sys.boot_completed=1 # Enable UFS powersaving write /dev/sys/block/bootdevice/clkgate_enable 1 + # Reset DDR frequency + write /sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/exynos_data/cancel_boot_freq 1 + write /sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/exynos_data/cancel_boot_freq 1 + # Setup final cpuset - write /dev/cpuset/top-app/cpus 0-7 - write /dev/cpuset/foreground/cpus 0-3,4-5 - write /dev/cpuset/background/cpus 0-1 - write /dev/cpuset/system-background/cpus 0-3 - write /dev/cpuset/restricted/cpus 0-3 - write /dev/cpuset/camera-daemon/cpus 0-7 + write /dev/cpuset/top-app/cpus ${persist.device_config.vendor_system_native.top-app_cpuset:-0-7} + write /dev/cpuset/foreground/cpus ${persist.device_config.vendor_system_native.foreground_cpuset:-0-3,4-5} + write /dev/cpuset/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-1} + write /dev/cpuset/system-background/cpus ${persist.device_config.vendor_system_native.system-background_cpuset:-0-3} + write /dev/cpuset/restricted/cpus ${persist.device_config.vendor_system_native.restricted_cpuset:-0-3} + write /dev/cpuset/camera-daemon/cpus ${persist.device_config.vendor_system_native.camera-daemon_cpuset:-0-7} setprop vendor.powerhal.init 1 # Setup final cpu.uclamp - write /sys/kernel/vendor_sched/ta_uclamp_min 1 - write /sys/kernel/vendor_sched/fg_uclamp_min 0 - write /sys/kernel/vendor_sched/sys_prefer_idle 0 + write /proc/vendor_sched/uclamp_threshold 8 + write /proc/vendor_sched/ta_uclamp_min 1 + write /proc/vendor_sched/fg_uclamp_min 0 + write /proc/vendor_sched/sys_prefer_idle 0 # cfs_rq clamp is using tg->uclamp setting # align it with the vendor_group setting - write /sys/kernel/vendor_sched/bg_uclamp_max 512 + write /proc/vendor_sched/bg_uclamp_max 512 write /dev/cpuctl/background/cpu.uclamp.max 50 - write /sys/kernel/vendor_sched/bg_group_throttle 512 - write /sys/kernel/vendor_sched/sysbg_uclamp_max 512 + write /proc/vendor_sched/sysbg_uclamp_max 512 write /dev/cpuctl/system-background/cpu.uclamp.max 50 - write /sys/kernel/vendor_sched/sysbg_group_throttle 512 - write /sys/kernel/vendor_sched/dex2oat_uclamp_max 615 + write /proc/vendor_sched/dex2oat_uclamp_max 615 write /dev/cpuctl/dex2oat/cpu.uclamp.max 60 - write /sys/kernel/vendor_sched/dex2oat_group_throttle 615 + write /proc/vendor_sched/ota_uclamp_max 410 + + # Set PMU freq limit parameters + write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/lcpi_threshold 2 + write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/spc_threshold 59 + write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/limit_frequency 1401000 + write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/lcpi_threshold 6 + write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/spc_threshold 64 + write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/limit_frequency 1826000 + write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/lcpi_threshold 5 + write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/spc_threshold 69 + write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/limit_frequency 2507000 + write /proc/vendor_sched/pmu_poll_time 10 + + # Disable PMU freq limit + write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/pmu_limit_enable 1 + write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/pmu_limit_enable 1 + write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/pmu_limit_enable 1 + write /proc/vendor_sched/pmu_poll_enable 0 # Setup groups for SF (RT used for SF RE, SF used for SF main) - write /sys/kernel/vendor_sched/rt_uclamp_min 125 - write /sys/kernel/vendor_sched/rt_prefer_idle 1 - write /sys/kernel/vendor_sched/sf_uclamp_min 30 - write /sys/kernel/vendor_sched/sf_prefer_idle 1 + write /proc/vendor_sched/rt_uclamp_min 161 + write /proc/vendor_sched/rt_prefer_idle 1 + write /proc/vendor_sched/sf_uclamp_min 39 + write /proc/vendor_sched/sf_prefer_idle 1 # Setup cpu.shares to throttle background groups (bg ~ 5% sysbg ~ 5% dex2oat ~2.5%) write /dev/cpuctl/background/cpu.shares 1024 @@ -758,11 +811,8 @@ on property:sys.boot_completed=1 chown root system /sys/devices/platform/19000000.aoc/reset chmod 0220 /sys/devices/platform/19000000.aoc/reset -# charger driver exposes now finer grain control, map demo mode to those properties -# NOTE: demo mode can only be exit wiping data (which reset the persist properties) -on property:sys.retaildemo.enabled=1 - setprop persist.vendor.charge.stop.level 35 - setprop persist.vendor.charge.start.level 30 + # write serialno to battery path for pairing + write /sys/class/power_supply/battery/dev_sn ${ro.boot.serialno} # Test Harness Mode default battery profile. on property:persist.sys.test_harness=1 && property:persist.vendor.testing_battery_profile=0 @@ -844,11 +894,20 @@ on post-fs-data # ODPM on fs + chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-0/i2c-s2mpg10mfd/s2mpg10-meter/s2mpg10-odpm/iio:device1/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-0/0-001f/s2mpg10-meter/s2mpg10-odpm/iio:device1/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-1/i2c-s2mpg11mfd/s2mpg11-meter/s2mpg11-odpm/iio:device0/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-1/1-002f/s2mpg11-meter/s2mpg11-odpm/iio:device0/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-6/i2c-s2mpg10mfd/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-6/6-001f/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-7/i2c-s2mpg11mfd/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-7/7-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-7/i2c-s2mpg10mfd/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-7/7-001f/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-8/i2c-s2mpg11mfd/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-8/8-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails on post-fs-data mkdir /data/vendor/powerstats 0771 system system @@ -932,8 +991,8 @@ on charger mkdir /dev/thermal/tz-by-name 0750 system system mkdir /dev/thermal/cdev-by-name 0750 system system start vendor.thermal.symlinks - write /sys/kernel/vendor_sched/sys_uclamp_min 0 - write /sys/kernel/vendor_sched/sys_prefer_idle 0 + write /proc/vendor_sched/sys_uclamp_min 0 + write /proc/vendor_sched/sys_prefer_idle 0 # Launch thermal hal in off charging mode on charger && property:vendor.thermal.link_ready=1 @@ -949,3 +1008,17 @@ on property:vendor.disable.bcl.control=0 on property:ro.boot.mode=charger && property:init.svc.vendor.charger=running # Enable UFS powersaving in Off Mode Charger write /dev/sys/block/bootdevice/clkgate_enable 1 + +# Cpuset experiment +on property:persist.device_config.vendor_system_native.top-app_cpuset=* + write /dev/cpuset/top-app/cpus ${persist.device_config.vendor_system_native.top-app_cpuset:-0-7} +on property:persist.device_config.vendor_system_native.foreground_cpuset=* + write /dev/cpuset/foreground/cpus ${persist.device_config.vendor_system_native.foreground_cpuset:-0-3,4-5} +on property:persist.device_config.vendor_system_native.background_cpuset=* + write /dev/cpuset/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-1} +on property:persist.device_config.vendor_system_native.system-background_cpuset=* + write /dev/cpuset/system-background/cpus ${persist.device_config.vendor_system_native.system-background_cpuset:-0-3} +on property:persist.device_config.vendor_system_native.restricted_cpuset=* + write /dev/cpuset/restricted/cpus ${persist.device_config.vendor_system_native.restricted_cpuset:-0-3} +on property:persist.device_config.vendor_system_native.camera-daemon_cpuset=* + write /dev/cpuset/camera-daemon/cpus ${persist.device_config.vendor_system_native.camera-daemon_cpuset:-0-7} diff --git a/conf/nomodem/Android.bp b/conf/nomodem/Android.bp new file mode 100644 index 00000000..1b1ae24e --- /dev/null +++ b/conf/nomodem/Android.bp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2021 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. + */ + +// By default this device uses hardware-wrapped keys for storage encryption, +// which is intended to offer increased security over the traditional method +// (software keys). However, hardware-wrapped keys aren't compatible with +// FIPS-140 certification of the encryption hardware, and hence we have to +// disable the use of them in FIPS mode. This requires having two fstab files: +// one for the default mode, and one for FIPS mode selectable via +// androidboot.fstab_suffix on the kernel command line. These fstabs should be +// identical with the exception of the encryption settings, so to keep them in +// sync the rules below generate them from a template file. + +soong_namespace { + imports: [ + "device/google/gs101", + "device/google/gs101/conf", + ], +} + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["device_google_gs101_license"], +} + +genrule { + name: "gen_fstab.gs101", + srcs: [ + "fstab.gs101.in*", + ":gs101_srcs", + ], + out: ["fstab.gs101"], + cmd: "sed -e s/@fileencryption@/::inlinecrypt_optimized+wrappedkey_v0/" + + " -e s/@metadata_encryption@/:wrappedkey_v0/" + + " -e /modem/d " + + " -e /efs/d $(in) > $(out)", +} + +genrule { + name: "gen_fstab.gs101-fips", + srcs: [ + "fstab.gs101.in*", + ":gs101_srcs", + ], + out: ["fstab.gs101-fips"], + cmd: "sed -e s/@fileencryption@/aes-256-xts/" + + " -e s/@metadata_encryption@/aes-256-xts/" + + " -e /modem/d " + + " -e /efs/d $(in) > $(out)", +} + +prebuilt_etc { + name: "fstab.gs101", + src: ":gen_fstab.gs101", + vendor: true, + vendor_ramdisk_available: true, +} + +prebuilt_etc { + name: "fstab.gs101-fips", + src: ":gen_fstab.gs101-fips", + vendor: true, + vendor_ramdisk_available: true, +} \ No newline at end of file diff --git a/default-permissions.xml b/default-permissions.xml index 12b40378..4765cb23 100644 --- a/default-permissions.xml +++ b/default-permissions.xml @@ -47,6 +47,8 @@ + + @@ -64,6 +66,8 @@ + + + + + +     - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device-common.mk b/device-common.mk index 250de1cf..4087c310 100644 --- a/device-common.mk +++ b/device-common.mk @@ -14,7 +14,9 @@ # limitations under the License. # +-include vendor/google_devices/gs101/proprietary/telephony/device-vendor.mk include device/google/gs101/device.mk +include device/google/gs101/tts/voice_packs.mk # Telephony PRODUCT_COPY_FILES += \ diff --git a/device.mk b/device.mk index 768e840e..e7af97ef 100644 --- a/device.mk +++ b/device.mk @@ -14,9 +14,12 @@ # limitations under the License. # -TARGET_BOARD_PLATFORM := gs101 +include device/google/gs-common/device.mk -ifneq (,$(filter %_64,$(TARGET_PRODUCT))) +TARGET_BOARD_PLATFORM := gs101 +DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false) + +ifeq ($(DEVICE_IS_64BIT_ONLY),true) LOCAL_64ONLY := _64 endif @@ -32,6 +35,14 @@ VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) # Set boot SPL BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) +# TODO(b/207450311): Remove this flag once implemented +USE_PIXEL_GRALLOC := false +ifeq ($(USE_PIXEL_GRALLOC),true) + PRODUCT_SOONG_NAMESPACES += hardware/google/gchips/GrallocHAL +else + PRODUCT_SOONG_NAMESPACES += hardware/google/gchips/gralloc4 +endif + PRODUCT_SOONG_NAMESPACES += \ hardware/google/av \ hardware/google/gchips \ @@ -40,6 +51,7 @@ PRODUCT_SOONG_NAMESPACES += \ hardware/google/interfaces \ hardware/google/pixel \ device/google/gs101 \ + device/google/gs101/powerstats \ vendor/google/whitechapel/tools \ vendor/broadcom/bluetooth \ vendor/google/camera \ @@ -54,6 +66,10 @@ LOCAL_KERNEL := $(TARGET_KERNEL_DIR)/Image.lz4 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ ro.oem_unlock_supported=1 +# Include vendor telephony soong namespace +PRODUCT_SOONG_NAMESPACES += \ + vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY) + ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) #Set IKE logs to verbose for WFC PRODUCT_PROPERTY_OVERRIDES += log.tag.IKE=VERBOSE @@ -87,7 +103,6 @@ endif # From system.property PRODUCT_PROPERTY_OVERRIDES += \ - dev.usbsetting.embedded=on \ ro.telephony.default_network=27 \ persist.vendor.ril.use.iccid_to_plmn=1 \ persist.vendor.ril.emergencynumber.mode=5 @@ -111,7 +126,7 @@ PRODUCT_PRODUCT_PROPERTIES += \ # Carrier configuration default location PRODUCT_PROPERTY_OVERRIDES += \ - persist.vendor.radio.config.carrier_config_dir=/mnt/vendor/modem_img/images/default/confpack + persist.vendor.radio.config.carrier_config_dir=/vendor/firmware/carrierconfig # Set the Bluetooth Class of Device # Service Field: 0x5A -> 90 @@ -152,6 +167,7 @@ USES_LASSEN_MODEM := true ifeq ($(USES_GOOGLE_DIALER_CARRIER_SETTINGS),true) USE_GOOGLE_DIALER := true USE_GOOGLE_CARRIER_SETTINGS := true +USES_GAUDIO := true endif ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) @@ -169,18 +185,21 @@ USE_SWIFTSHADER := false TARGET_USES_VULKAN = true PRODUCT_SOONG_NAMESPACES += \ - vendor/arm/mali/valhall \ - vendor/arm/mali/valhall/cl \ - vendor/arm/mali/valhall/libmali \ - vendor/arm/mali/valhall/cinstr/production/gpu-hwc-reader + vendor/arm/mali/valhall + +$(call soong_config_set,pixel_mali,soc,$(TARGET_BOARD_PLATFORM)) include device/google/gs101/neuralnetwork/neuralnetwork.mk PRODUCT_PACKAGES += \ libGLES_mali \ - vulkan.gs101 \ + vulkan.mali \ libOpenCL \ libgpudataproducer + +PRODUCT_VENDOR_PROPERTIES += \ + ro.hardware.vulkan=mali + PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ debug.mali.disable_backend_affinity=true @@ -196,8 +215,8 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \ frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \ frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \ - frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \ - frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml + frameworks/native/data/etc/android.software.vulkan.deqp.level-2022-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \ + frameworks/native/data/etc/android.software.opengles.deqp.level-2022-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml ifeq ($(USE_SWIFTSHADER),true) PRODUCT_VENDOR_PROPERTIES += \ @@ -270,6 +289,12 @@ endif PRODUCT_COPY_FILES += \ device/google/gs101/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.gs101.rc +ifneq ($(BOARD_WITHOUT_RADIO),true) +PRODUCT_SOONG_NAMESPACES += device/google/gs101/conf +else +PRODUCT_SOONG_NAMESPACES += device/google/gs101/conf/nomodem +endif + # Fstab files PRODUCT_PACKAGES += \ fstab.gs101 \ @@ -297,7 +322,7 @@ PRODUCT_PACKAGES += \ # Contexthub HAL PRODUCT_PACKAGES += \ - android.hardware.contexthub@1.2-service.generic + android.hardware.contexthub-service.generic # CHRE tools ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) @@ -368,26 +393,32 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml # Sensors +ifneq (,$(findstring tangor, $(TARGET_PRODUCT))) +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.dynamic.head_tracker.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.dynamic.head_tracker.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml\ + frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml +else PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \ frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.dynamic.head_tracker.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.dynamic.head_tracker.xml \ frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ frameworks/native/data/etc/android.hardware.sensor.hifi_sensors.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.hifi_sensors.xml \ frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml\ frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \ frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \ frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml +endif # Add sensor HAL 2.1 product packages PRODUCT_PACKAGES += android.hardware.sensors@2.1-service.multihal -# Debug property for sensor. -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) -PRODUCT_PROPERTY_OVERRIDES += \ - vendor.debug.sensor.hal.event_logger=true -endif - # USB HAL PRODUCT_PACKAGES += \ android.hardware.usb-service.gs101 @@ -478,8 +509,7 @@ PRODUCT_PACKAGES += \ # for now include gralloc here. should come from hardware/google_devices/exynos5 PRODUCT_PACKAGES += \ android.hardware.graphics.mapper@4.0-impl \ - android.hardware.graphics.allocator@4.0-service \ - android.hardware.graphics.allocator@4.0-impl + android.hardware.graphics.allocator-V1-service PRODUCT_PACKAGES += \ android.hardware.memtrack-service.pixel \ @@ -495,8 +525,8 @@ PRODUCT_PACKAGES += \ # WideVine modules PRODUCT_PACKAGES += \ - android.hardware.drm@1.4-service.clearkey \ - android.hardware.drm@1.4-service.widevine \ + android.hardware.drm-service.clearkey \ + android.hardware.drm-service.widevine \ liboemcrypto \ @@ -553,7 +583,7 @@ PRODUCT_PACKAGES += \ # Enable project quotas and casefolding for emulated storage without sdcardfs $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/compression.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/compression_with_xor.mk) # Enforce generic ramdisk allow list $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk) @@ -578,8 +608,16 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml +# (See b/211840489) +ifneq ($(DISABLE_CAMERA_FS_AF),true) +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml +else +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml +endif + PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \ frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml\ @@ -627,6 +665,7 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.sf.duration=16600000 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.app.duration=16600000 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.frame_rate_multiple_threshold=120 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.layer_caching_active_layer_timeout_ms=1000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.treat_170m_as_sRGB=1 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.enable_layer_caching=true PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms?=80 @@ -729,10 +768,11 @@ PRODUCT_PACKAGES += \ libExynosC2Vp9Enc PRODUCT_PROPERTY_OVERRIDES += \ - debug.c2.use_dmabufheaps=1 \ - media.c2.dmabuf.padding=512 \ - debug.stagefright.ccodec_delayed_params=1 \ - ro.vendor.gpu.dataspace=1 + debug.stagefright.c2-poolmask=458752 \ + debug.c2.use_dmabufheaps=1 \ + media.c2.dmabuf.padding=512 \ + debug.stagefright.ccodec_delayed_params=1 \ + ro.vendor.gpu.dataspace=1 # Create input surface on the framework side PRODUCT_PROPERTY_OVERRIDES += \ @@ -767,7 +807,9 @@ PRODUCT_PACKAGES += \ endif # GPS HAL +ifeq (,$(filter tangor citron,$(subst _, ,$(TARGET_PRODUCT)))) include device/google/gs101/gnss/device-gnss.mk +endif # Trusty (KM, GK, Storage) $(call inherit-product, system/core/trusty/trusty-storage.mk) @@ -788,10 +830,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PROPERTY_OVERRIDES += \ ro.frp.pst=/dev/block/by-name/frp -# Bluetooth HAL -PRODUCT_PACKAGES += \ - android.hardware.bluetooth@1.1-service.bcmbtlinux \ - bt_vendor.conf +# Bluetooth PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \ frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml @@ -821,6 +860,10 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true PRODUCT_PRODUCT_PROPERTIES += \ persist.sys.fuse.passthrough.enable=true +# Use FUSE BPF +PRODUCT_PRODUCT_PROPERTIES += \ + ro.fuse.bpf.enabled=false + # Use /product/etc/fstab.postinstall to mount system_other PRODUCT_PRODUCT_PROPERTIES += \ ro.postinstall.fstab.prefix=/product @@ -856,12 +899,11 @@ PRODUCT_PACKAGES += \ vts.bin # This will be called only if IMSService is building with source code for dev branches. -$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-ims/device-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/shannon-ims/device-vendor.mk) PRODUCT_PACKAGES += ShannonIms -$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-iwlan/device-vendor.mk) -include device/google/gs101/telephony/pktrouter.mk +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/shannon-iwlan/device-vendor.mk) #RCS Test Messaging App PRODUCT_PACKAGES_DEBUG += \ @@ -887,13 +929,13 @@ USE_RADIO_HAL_1_6 := true #$(call inherit-product, vendor/google_devices/gs101/proprietary/device-vendor.mk) ifneq ($(BOARD_WITHOUT_RADIO),true) -$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/common/device-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device-vendor.mk) endif -ifeq (,$(filter %_64,$(TARGET_PRODUCT))) -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -else +ifeq ($(DEVICE_IS_64BIT_ONLY),true) $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) +else +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) endif #$(call inherit-product, hardware/google_devices/exynos5/exynos5.mk) #$(call inherit-product-if-exists, hardware/google_devices/gs101/gs101.mk) @@ -905,8 +947,7 @@ $(call inherit-product-if-exists, vendor/google/camera/devices/whi/device-vendor PRODUCT_COPY_FILES += \ device/google/gs101/default-permissions.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/default-permissions/default-permissions.xml \ - device/google/gs101/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml \ - frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \ + device/google/gs101/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml # modem_svc_sit daemon PRODUCT_PACKAGES += modem_svc_sit @@ -914,6 +955,27 @@ PRODUCT_PACKAGES += modem_svc_sit # modem logging binary/configs PRODUCT_PACKAGES += modem_logging_control +# modem logging configs +PRODUCT_COPY_FILES += \ + device/google/gs101/radio/config/logging.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/logging.conf \ + device/google/gs101/radio/config/default.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default.cfg \ + device/google/gs101/radio/config/default.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default.nprf \ + device/google/gs101/radio/config/default_metrics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_metrics.xml \ + device/google/gs101/radio/config/teamfood_default.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/teamfood_default.cfg \ + device/google/gs101/radio/config/teamfood_default.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/teamfood_default.nprf \ + device/google/gs101/radio/config/teamfood_default_metrics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/modem/teamfood_default_metrics.xml \ + device/google/gs101/radio/config/default_stability.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_stability.cfg \ + device/google/gs101/radio/config/default_stability.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_stability.nprf \ + device/google/gs101/radio/config/default_NAS_RRC.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_NAS_RRC.cfg \ + device/google/gs101/radio/config/default_NAS_RRC.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_NAS_RRC.nprf \ + device/google/gs101/radio/config/default_network.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_network.cfg \ + device/google/gs101/radio/config/default_network.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_network.nprf \ + device/google/gs101/radio/config/Pixel_Default.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/Pixel_Default.cfg \ + device/google/gs101/radio/config/Pixel_Default.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/Pixel_Default.nprf \ + device/google/gs101/radio/config/Pixel_Default_metrics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/modem/Pixel_Default_metrics.xml \ + device/google/gs101/radio/config/Pixel_stability.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/Pixel_stability.cfg \ + device/google/gs101/radio/config/Pixel_stability.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/Pixel_stability.nprf + PRODUCT_COPY_FILES += \ device/google/gs101/radio/gnss_blanking.csv:$(TARGET_COPY_OUT_VENDOR)/etc/modem/gnss_blanking.csv @@ -928,18 +990,18 @@ PRODUCT_PACKAGES_DEBUG += \ $(NULL) PRODUCT_PACKAGES += \ - android.hardware.health@2.1-impl-gs101 \ - android.hardware.health@2.1-service + android.hardware.health-service.gs101 \ + android.hardware.health-service.gs101_recovery \ # Audio # Audio HAL Server & Default Implementations PRODUCT_PACKAGES += \ android.hardware.audio.service \ - android.hardware.audio@7.0-impl \ + android.hardware.audio@7.1-impl \ android.hardware.audio.effect@7.0-impl \ - android.hardware.bluetooth.audio@2.1-impl \ + android.hardware.bluetooth.audio-impl \ android.hardware.soundtrigger@2.3-impl \ - vendor.google.whitechapel.audio.audioext@2.0-impl + vendor.google.whitechapel.audio.audioext@3.0-impl #Audio HAL libraries PRODUCT_PACKAGES += \ @@ -959,7 +1021,6 @@ PRODUCT_PACKAGES += \ audio_spk_35l41 \ audio.usb.default \ audio.usbv2.default \ - audio.a2dp.default \ audio.bluetooth.default \ audio.r_submix.default \ libamcsextfile \ @@ -990,6 +1051,14 @@ PRODUCT_SOONG_NAMESPACES += \ $(call soong_config_set,aoc_audio_board,platform,$(TARGET_BOARD_PLATFORM)) +## AoC soong +PRODUCT_SOONG_NAMESPACES += \ + vendor/google/whitechapel/aoc + +$(call soong_config_set,aoc,target_soc,$(TARGET_BOARD_PLATFORM)) + +$(call soong_config_set,android_hardware_audio,run_64bit,true) + # Audio properties PRODUCT_PROPERTY_OVERRIDES += \ ro.config.vc_call_vol_steps=7 \ @@ -1055,13 +1124,14 @@ PRODUCT_PACKAGES += \ update_engine_sideload \ update_verifier -# tetheroffload HAL -PRODUCT_PACKAGES += \ - vendor.samsung_slsi.hardware.tetheroffload@1.1-service - # pKVM +$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk) +PRODUCT_BUILD_PVMFW_IMAGE := true ifeq ($(TARGET_PKVM_ENABLED),true) - $(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk) + PRODUCT_PACKAGES += pkvm_enabler +else + PRODUCT_COPY_FILES += \ + device/google/gs101/pkvm/pkvm_experiment.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/pkvm_experiment.rc endif # Enable watchdog timeout loop breaker. @@ -1093,6 +1163,9 @@ include hardware/google/pixel/PixelLogger/PixelLogger.mk # Telephony include device/google/gs101/telephony/user.mk +# Wifi ext +include hardware/google/pixel/wifi_ext/device.mk + # Battery Stats Viewer PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer @@ -1102,8 +1175,12 @@ PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE := device/google/gs101/device_framework_matrix_product.xml # Preopt SystemUI -PRODUCT_DEXPREOPT_SPEED_APPS += \ - SystemUIGoogle +PRODUCT_DEXPREOPT_SPEED_APPS += SystemUIGoogle # For internal +PRODUCT_DEXPREOPT_SPEED_APPS += SystemUI # For AOSP + +# Compile SystemUI on device with `speed`. +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.systemuicompilerfilter=speed # Keymaster configuration PRODUCT_COPY_FILES += \ diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml index ba34409a..5e4785ba 100644 --- a/device_framework_matrix_product.xml +++ b/device_framework_matrix_product.xml @@ -58,6 +58,7 @@ com.google.edgetpu + 2 IEdgeTpuVendorService default @@ -65,7 +66,7 @@ com.google.hardware.pixel.display - 4 + 6 IDisplay default @@ -94,10 +95,18 @@ default + + hardware.google.bluetooth.ext + 1.0 + + IBluetoothExt + default + + hardware.google.bluetooth.ccc hwbinder - 1.0 + 1.1 IBluetoothCcc default @@ -106,7 +115,7 @@ hardware.qorvo.uwb - IUwb + IUwbVendor default @@ -120,7 +129,7 @@ vendor.google.google_battery - 1.1 + 1.2 IGoogleBattery default @@ -136,7 +145,7 @@ vendor.google.whitechapel.audio.audioext - 2.0 + 3.0 IAudioExt default @@ -144,7 +153,7 @@ vendor.google.wifi_ext - 1.2 + 1.3 IWifiExt default diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 545872cb..b75ba64f 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -214,6 +214,8 @@ void dumpCameraLogs(int fd, const std::string &destDir) { // sessions or starts a new session after the one with performance issues). dumpLogs(fd, kCameraLogDir, cameraDestDir, 10, "session-ended-"); dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "high-drop-rate-"); + dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "watchdog-"); + dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "camera-ended-"); } timepoint_t startSection(int fd, const std::string §ionName) { @@ -249,6 +251,7 @@ void endSection(int fd, const std::string §ionName, timepoint_t startTime) { DumpstateDevice::DumpstateDevice() : mTextSections{ + { "pre-touch", [this](int fd) { dumpPreTouchSection(fd); } }, { "wlan", [this](int fd) { dumpWlanSection(fd); } }, { "soc", [this](int fd) { dumpSocSection(fd); } }, { "storage", [this](int fd) { dumpStorageSection(fd); } }, @@ -347,6 +350,9 @@ void DumpstateDevice::dumpPowerSection(int fd) { DumpFileToFd(fd, "maxfg_base", "/dev/logbuffer_maxfg_base_monitor"); DumpFileToFd(fd, "maxfg_flip", "/dev/logbuffer_maxfg_flip_monitor"); } + if (!stat("/sys/class/power_supply/dock", &buffer)) { + DumpFileToFd(fd, "Power supply property dock", "/sys/class/power_supply/dock/uevent"); + } if (!stat("/dev/logbuffer_tcpm", &buffer)) { DumpFileToFd(fd, "Logbuffer TCPM", "/dev/logbuffer_tcpm"); @@ -378,6 +384,7 @@ void DumpstateDevice::dumpPowerSection(int fd) { DumpFileToFd(fd, "TTF details", "/sys/class/power_supply/battery/ttf_details"); DumpFileToFd(fd, "TTF stats", "/sys/class/power_supply/battery/ttf_stats"); DumpFileToFd(fd, "maxq", "/dev/logbuffer_maxq"); + DumpFileToFd(fd, "aacr_state", "/sys/class/power_supply/battery/aacr_state"); RunCommandToFd(fd, "TRICKLE-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/google,battery/power_supply/battery/;" @@ -393,6 +400,9 @@ void DumpstateDevice::dumpPowerSection(int fd) { if (!PropertiesHelper::IsUserBuild()) { DumpFileToFd(fd, "DC_registers dump", "/sys/class/power_supply/pca9468-mains/device/registers_dump"); + DumpFileToFd(fd, "max77759_chg registers dump", "/d/max77759_chg/registers"); + DumpFileToFd(fd, "max77729_pmic registers dump", "/d/max77729_pmic/registers"); + DumpFileToFd(fd, "Charging table dump", "/d/google_battery/chg_raw_profile"); RunCommandToFd(fd, "fg_model", {"/vendor/bin/sh", "-c", @@ -421,8 +431,14 @@ void DumpstateDevice::dumpPowerSection(int fd) { /* EEPROM State */ if (!stat("/sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom", &buffer)) { RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom"}); - } else { + } else if(!stat("/sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom", &buffer)) { RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom"}); + } else if(!stat("/sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom", &buffer)) { + RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom"}); + } else if(!stat("/sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom", &buffer)) { + RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom"}); + } else { + RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/10970000.hsi2c/i2c-8/8-0050/eeprom"}); } DumpFileToFd(fd, "Charger Stats", "/sys/class/power_supply/battery/charge_details"); @@ -488,14 +504,20 @@ void DumpstateDevice::dumpThermalSection(int fd) { "for f in /sys/class/thermal/cooling* ; do " "type=`cat $f/type` ; temp=`cat $f/cur_state` ; echo \"$type: $temp\" ; " "done"}); + RunCommandToFd(fd, "Cooling Device User Vote State", {"/vendor/bin/sh", "-c", + "for f in /sys/class/thermal/cooling* ; do " + "if [ ! -f $f/user_vote ]; then continue; fi; " + "type=`cat $f/type` ; temp=`cat $f/user_vote` ; echo \"$type: $temp\" ; " + "done"}); RunCommandToFd(fd, "Cooling Device Time in State", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; " "do type=`cat $f/type` ; temp=`cat $f/stats/time_in_state_ms` ; echo \"$type:\n$temp\" ; done"}); RunCommandToFd(fd, "Cooling Device Trans Table", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; " "do type=`cat $f/type` ; temp=`cat $f/stats/trans_table` ; echo \"$type:\n$temp\" ; done"}); RunCommandToFd(fd, "Cooling Device State2Power Table", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; do " - "type=`cat $f/type` ; state2power_table=`cat $f/state2power_table` ; echo \"$type: $state2power_table\" ; " - "done"}); + "if [ ! -f $f/state2power_table ]; then continue; fi; " + "type=`cat $f/type` ; state2power_table=`cat $f/state2power_table` ; echo \"$type: $state2power_table\" ; " + "done"}); DumpFileToFd(fd, "TMU state:", "/sys/module/gs101_thermal/parameters/tmu_reg_dump_state"); DumpFileToFd(fd, "TMU current temperature:", "/sys/module/gs101_thermal/parameters/tmu_reg_dump_current_temp"); DumpFileToFd(fd, "TMU_TOP rise thresholds:", "/sys/module/gs101_thermal/parameters/tmu_top_reg_dump_rise_thres"); @@ -505,6 +527,42 @@ void DumpstateDevice::dumpThermalSection(int fd) { } // Dump items related to touch +void DumpstateDevice::dumpPreTouchSection(int fd) { + const char nvt_spi_path[] = "/sys/class/spi_master/spi11/spi11.0/input/nvt_touch"; + char cmd[256]; + + /* NVT touch */ + if (!access(nvt_spi_path, R_OK)) { + snprintf(cmd, sizeof(cmd), + "echo %s > %s/%s", + "0x21", + nvt_spi_path, + "force_touch_active"); + RunCommandToFd(fd, "Force Touch Active(Enable)", {"/vendor/bin/sh", "-c", cmd}); + + snprintf(cmd, sizeof(cmd), "/proc/nvt_fw_version"); + if (!access(cmd, R_OK)) + DumpFileToFd(fd, "FW version", cmd); + +#if 0 /* b/193467774: remove this temporarily */ + snprintf(cmd, sizeof(cmd), "/proc/nvt_diff"); + if (!access(cmd, R_OK)) + DumpFileToFd(fd, "Diff", cmd); + + snprintf(cmd, sizeof(cmd), "%s/nvt_fw_history", nvt_spi_path); + if (!access(nvt_spi_path, R_OK)) + DumpFileToFd(fd, "FW History", cmd); +#endif + + snprintf(cmd, sizeof(cmd), + "echo %s > %s/%s", + "0x20", + nvt_spi_path, + "force_touch_active"); + RunCommandToFd(fd, "Force Touch Active(Disable)", {"/vendor/bin/sh", "-c", cmd}); + } +} + void DumpstateDevice::dumpTouchSection(int fd) { const char stm_cmd_path[4][50] = {"/sys/class/spi_master/spi11/spi11.0", "/proc/fts/driver_test", @@ -811,8 +869,7 @@ void DumpstateDevice::dumpMemorySection(int fd) { "fi; " "done"}); DumpFileToFd(fd, "dmabuf info", "/d/dma_buf/bufinfo"); - DumpFileToFd(fd, "Page Pinner - longterm pin", "/sys/kernel/debug/page_pinner/longterm_pinner"); - DumpFileToFd(fd, "Page Pinner - alloc_contig_failed", "/sys/kernel/debug/page_pinner/alloc_contig_failed"); + DumpFileToFd(fd, "Page Pinner - longterm pin", "/sys/kernel/debug/page_pinner/buffer"); RunCommandToFd(fd, "Pixel CMA stat", {"/vendor/bin/sh", "-c", "for d in $(ls -d /sys/kernel/pixel_stat/mm/cma/*); do " "if [ -f $d ]; then " @@ -919,6 +976,21 @@ void DumpstateDevice::dumpAoCSection(int fd) { DumpFileToFd(fd, "AoC hotword wake", "/sys/devices/platform/19000000.aoc/control/hotword_wakeup"); DumpFileToFd(fd, "AoC memory exception wake", "/sys/devices/platform/19000000.aoc/control/memory_exception"); DumpFileToFd(fd, "AoC memory votes", "/sys/devices/platform/19000000.aoc/control/memory_votes"); + RunCommandToFd(fd, "AoC Heap Stats (A32)", + {"/vendor/bin/sh", "-c", "echo 'dbg heap -c 1' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"}, + CommandOptions::WithTimeout(1).Build()); + RunCommandToFd(fd, "AoC Heap Stats (F1)", + {"/vendor/bin/sh", "-c", "echo 'dbg heap -c 2' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"}, + CommandOptions::WithTimeout(1).Build()); + RunCommandToFd(fd, "AoC Heap Stats (HF0)", + {"/vendor/bin/sh", "-c", "echo 'dbg heap -c 3' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"}, + CommandOptions::WithTimeout(1).Build()); + RunCommandToFd(fd, "AoC Heap Stats (HF1)", + {"/vendor/bin/sh", "-c", "echo 'dbg heap -c 4' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"}, + CommandOptions::WithTimeout(1).Build()); + RunCommandToFd(fd, "AoC MIF Stats", + {"/vendor/bin/sh", "-c", "echo 'mif details' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"}, + CommandOptions::WithTimeout(1).Build()); } // Dump items related to sensors usf. @@ -983,6 +1055,7 @@ void DumpstateDevice::dumpMiscSection(int fd) { void DumpstateDevice::dumpGscSection(int fd) { RunCommandToFd(fd, "Citadel VERSION", {"vendor/bin/hw/citadel_updater", "-lv"}); RunCommandToFd(fd, "Citadel STATS", {"vendor/bin/hw/citadel_updater", "--stats"}); + RunCommandToFd(fd, "GSC DEBUG DUMP", {"vendor/bin/hw/citadel_updater", "-D"}); } // Dump essential camera debugging logs diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h index 74d0ce1e..5cc32491 100644 --- a/dumpstate/DumpstateDevice.h +++ b/dumpstate/DumpstateDevice.h @@ -64,6 +64,7 @@ struct DumpstateDevice : public IDumpstateDevice { void dumpWlanSection(int fd); void dumpPowerSection(int fd); void dumpThermalSection(int fd); + void dumpPreTouchSection(int fd); void dumpTouchSection(int fd); void dumpSocSection(int fd); void dumpCpuSection(int fd); diff --git a/edgetpu/OWNERS b/edgetpu/OWNERS new file mode 100644 index 00000000..9eb92a96 --- /dev/null +++ b/edgetpu/OWNERS @@ -0,0 +1,6 @@ +# Devs who work on EdgeTPU on Android. +hsuy@google.com +yuchicheng@google.com +iayara@google.com +qinyiyan@google.com +macwang@google.com \ No newline at end of file diff --git a/fingerprint/fpc1540/sw35/fingerprint_aidl_config.mk b/fingerprint/fpc1540/sw35/fingerprint_aidl_config.mk index 2a1193e8..1880f604 100644 --- a/fingerprint/fpc1540/sw35/fingerprint_aidl_config.mk +++ b/fingerprint/fpc1540/sw35/fingerprint_aidl_config.mk @@ -21,3 +21,6 @@ GOOGLE_CONFIG_PERFORMANCE=1 # Enable Suez $(call soong_config_set,fp_hal_feature,biometric_suez_support,true) + +# Must add below method to each project's device.mk to show sensorLocation +#$(call soong_config_set,fp_hal_feature,pixel_product, project_XX) diff --git a/fingerprint/udfps_common.mk b/fingerprint/udfps_common.mk index a41b3adf..9d413196 100644 --- a/fingerprint/udfps_common.mk +++ b/fingerprint/udfps_common.mk @@ -24,6 +24,7 @@ DEVICE_MANIFEST_FILE += \ endif # Include the Goodix AIDL HAL namespaces. +PRODUCT_SOONG_NAMESPACES += vendor/goodix/udfps/fp_utils ifeq ($(GOODIX_CONFIG_BUILD_VERSION), g6_trusty) PRODUCT_SOONG_NAMESPACES += vendor/goodix/udfps/g6_trusty PRODUCT_SOONG_NAMESPACES += vendor/goodix/udfps/g6_aidl_trusty diff --git a/gnss/47765/Android.bp b/gnss/47765/Android.bp index 4843b23d..47ac1685 100644 --- a/gnss/47765/Android.bp +++ b/gnss/47765/Android.bp @@ -42,7 +42,7 @@ cc_prebuilt_library_shared { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss-V1-ndk", + "android.hardware.gnss-V2-ndk", "libhardware", "libc++", "libc", @@ -77,6 +77,7 @@ cc_prebuilt_binary { "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", + "android.hardware.gnss-V2-ndk", "libc++", "libc", "libm", diff --git a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml b/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml index 1eb3509e..97538b88 100644 --- a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml +++ b/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml @@ -1,16 +1,7 @@ - - android.hardware.gnss - hwbinder - 2.1 - 1.1 - - IGnss - default - - android.hardware.gnss + 2 IGnss/default diff --git a/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so b/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so index ef302307..cf16410d 100755 Binary files a/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so and b/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so differ diff --git a/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm b/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm index be480318..b9fee32e 100755 Binary files a/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm and b/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm differ diff --git a/gnss/47765/bin/flp.default.so b/gnss/47765/bin/flp.default.so index e3f26281..ae700bdc 100755 Binary files a/gnss/47765/bin/flp.default.so and b/gnss/47765/bin/flp.default.so differ diff --git a/gnss/47765/bin/gps.default.so b/gnss/47765/bin/gps.default.so index 4ffa0bdb..771e4be6 100755 Binary files a/gnss/47765/bin/gps.default.so and b/gnss/47765/bin/gps.default.so differ diff --git a/gnss/47765/bin/gpsd b/gnss/47765/bin/gpsd index 7c196e02..34c80128 100755 Binary files a/gnss/47765/bin/gpsd and b/gnss/47765/bin/gpsd differ diff --git a/gnss/47765/bin/lhd b/gnss/47765/bin/lhd index 06ea7473..5854d358 100755 Binary files a/gnss/47765/bin/lhd and b/gnss/47765/bin/lhd differ diff --git a/gnss/47765/bin/scd b/gnss/47765/bin/scd index 0f6d9f7d..631d7c80 100755 Binary files a/gnss/47765/bin/scd and b/gnss/47765/bin/scd differ diff --git a/gnss/47765/config/gps.xml b/gnss/47765/config/gps.xml index 0cb80edf..9c49907e 100644 --- a/gnss/47765/config/gps.xml +++ b/gnss/47765/config/gps.xml @@ -21,6 +21,7 @@ SuplSslMethod="SSLv23_NO_TLSv1_2" SuplEnable="true" SuplUseApn="true" + SuplUseFwCellInfo="false" SuplTlsCertDirPath="/etc/security/cacerts" SuplTlsCertPath="/vendor/etc/gnss/gps.cer" SuplUT1Seconds="20" @@ -54,6 +55,8 @@ AssertEnabled="true" CpLppeCancelDbhOnAgnssProvideLoc="true" CpLppeUseAgnssLocForEmptyDbh="true" + ReAidingOnHotStart="false" + ReAidingIntervalSec="1200" /> - - + + - + - +0002000000C6FF00000000000000000000000000000000 +0000000000000000000000000000000000000000000000 +0000000200000007000000> diff --git a/health/Android.bp b/health/Android.bp index 41a0e126..2bac61bc 100644 --- a/health/Android.bp +++ b/health/Android.bp @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import @@ -24,36 +23,39 @@ package { "//device/google/gs101:device_google_gs101_license", ], } - -cc_library_shared { - name: "android.hardware.health@2.1-impl-gs101", - stem: "android.hardware.health@2.0-impl-2.1-gs101", - - proprietary: true, +cc_defaults { + name: "android.hardware.health-service.gs101-defaults", + defaults: [ + "libhealth_aidl_impl_user", + "libhealth_aidl_charger_defaults", + ], relative_install_path: "hw", + vintf_fragments: ["android.hardware.health-service.gs101.xml"], srcs: [ "Health.cpp", ], - cflags: [ "-Wall", "-Werror", ], - static_libs: [ - "android.hardware.health@1.0-convert", - "libbatterymonitor", - "libhealth2impl", - "libhealthloop", - ], - - shared_libs: [ - "libbase", - "libcutils", - "libhidlbase", - "libpixelhealth", - "libutils", - "android.hardware.health@2.0", - "android.hardware.health@2.1", + "libhealth_aidl_impl", ], } +cc_binary { + name: "android.hardware.health-service.gs101", + defaults: ["android.hardware.health-service.gs101-defaults"], + proprietary: true, + init_rc: ["android.hardware.health-service.gs101.rc"], + overrides: ["charger"], + shared_libs: [ + "libpixelhealth", + ], +} +cc_binary { + name: "android.hardware.health-service.gs101_recovery", + defaults: ["android.hardware.health-service.gs101-defaults"], + recovery: true, + init_rc: ["android.hardware.health-service.gs101_recovery.rc"], + overrides: ["charger.recovery"], +} diff --git a/health/Health.cpp b/health/Health.cpp index fe8ad843..a50cc8bb 100644 --- a/health/Health.cpp +++ b/health/Health.cpp @@ -19,17 +19,20 @@ #include #include #include -#include -#include +#include +#include #include -#include +// Recovery doesn't have libpixelhealth and charger mode +#ifndef __ANDROID_RECOVERY__ +#include #include #include #include #include #include #include +#endif // !__ANDROID_RECOVERY__ #include #include @@ -41,15 +44,15 @@ namespace { using namespace std::literals; -using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo; -using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo; -using android::hardware::health::V2_0::DiskStats; -using android::hardware::health::V2_0::StorageAttribute; -using android::hardware::health::V2_0::StorageInfo; -using android::hardware::health::V2_0::Result; -using ::android::hardware::health::V2_1::IHealth; +using aidl::android::hardware::health::DiskStats; +using aidl::android::hardware::health::HalHealthLoop; +using aidl::android::hardware::health::HealthInfo; +using aidl::android::hardware::health::StorageInfo; using android::hardware::health::InitHealthdConfig; +#ifndef __ANDROID_RECOVERY__ +using aidl::android::hardware::health::charger::ChargerCallback; +using aidl::android::hardware::health::charger::ChargerModeMain; using hardware::google::pixel::health::BatteryDefender; using hardware::google::pixel::health::BatteryMetricsLogger; using hardware::google::pixel::health::BatteryThermalControl; @@ -72,6 +75,7 @@ static BatteryThermalControl battThermalControl( static BatteryMetricsLogger battMetricsLogger(kBatteryResistance, kBatteryOCV); static LowBatteryShutdownMetrics shutdownMetrics(kVoltageAvg); static DeviceHealth deviceHealth; +#endif // !__ANDROID_RECOVERY__ #define UFS_DIR "/dev/sys/block/bootdevice" constexpr char kUfsHealthEol[]{UFS_DIR "/health_descriptor/eol_info"}; @@ -79,7 +83,6 @@ constexpr char kUfsHealthLifetimeA[]{UFS_DIR "/health_descriptor/life_time_estim constexpr char kUfsHealthLifetimeB[]{UFS_DIR "/health_descriptor/life_time_estimation_b"}; constexpr char kUfsVersion[]{UFS_DIR "/device_descriptor/specification_version"}; constexpr char kDiskStatsFile[]{"/sys/block/sda/stat"}; -constexpr char kUFSName[]{"UFS0"}; static std::string ufs_version; static uint16_t eol; @@ -88,8 +91,10 @@ static uint16_t lifetimeB; static std::chrono::system_clock::time_point ufs_last_query_time; constexpr auto kUfsQueryIntervalHours = std::chrono::hours{24}; +#ifndef __ANDROID_RECOVERY__ static bool needs_wlc_updates = false; constexpr char kWlcCapacity[]{WLC_DIR "/capacity"}; +#endif // !__ANDROID_RECOVERY__ std::ifstream assert_open(const std::string &path) { std::ifstream stream(path); @@ -118,12 +123,10 @@ void read_ufs_version(StorageInfo *info) { info->version = ufs_version; } -void fill_ufs_storage_attribute(StorageAttribute *attr) { - attr->isInternal = true; - attr->isBootDevice = true; - attr->name = kUFSName; -} - +#ifdef __ANDROID_RECOVERY__ +void private_healthd_board_init(struct healthd_config *) {} +int private_healthd_board_battery_update(HealthInfo *) { return 0; } +#else // !__ANDROID__RECOVERY__ static bool FileExists(const std::string &filename) { struct stat buffer; @@ -140,26 +143,26 @@ void private_healthd_board_init(struct healthd_config *hc) { } } -int private_healthd_board_battery_update(struct android::BatteryProperties *props) { - deviceHealth.update(props); - battThermalControl.updateThermalState(props); - battMetricsLogger.logBatteryProperties(props); - shutdownMetrics.logShutdownVoltage(props); +int private_healthd_board_battery_update(HealthInfo *health_info) { + deviceHealth.update(health_info); + battThermalControl.updateThermalState(*health_info); + battMetricsLogger.logBatteryProperties(*health_info); + shutdownMetrics.logShutdownVoltage(*health_info); // Allow BatteryDefender to override online properties - ChargerDetect::onlineUpdate(props); - battDefender.update(props); + ChargerDetect::onlineUpdate(health_info); + battDefender.update(health_info); if (needs_wlc_updates && - !android::base::WriteStringToFile(std::to_string(props->batteryLevel), kWlcCapacity)) + !android::base::WriteStringToFile(std::to_string(health_info->batteryLevel), kWlcCapacity)) LOG(INFO) << "Unable to write battery level to wireless capacity"; return 0; } +#endif // __ANDROID_RECOVERY__ -void private_get_storage_info(std::vector &vec_storage_info) { - vec_storage_info.resize(1); - StorageInfo *storage_info = &vec_storage_info[0]; - fill_ufs_storage_attribute(&storage_info->attr); +void private_get_storage_info(std::vector *vec_storage_info) { + vec_storage_info->resize(1); + StorageInfo *storage_info = &vec_storage_info->at(0); read_ufs_version(storage_info); @@ -180,10 +183,9 @@ void private_get_storage_info(std::vector &vec_storage_info) { return; } -void private_get_disk_stats(std::vector &vec_stats) { - vec_stats.resize(1); - DiskStats *stats = &vec_stats[0]; - fill_ufs_storage_attribute(&stats->attr); +void private_get_disk_stats(std::vector *vec_stats) { + vec_stats->resize(1); + DiskStats *stats = &vec_stats->at(0); auto stream = assert_open(kDiskStatsFile); // Regular diskstats entries @@ -195,18 +197,14 @@ void private_get_disk_stats(std::vector &vec_stats) { } } // anonymous namespace -namespace android { -namespace hardware { -namespace health { -namespace V2_1 { -namespace implementation { +namespace aidl::android::hardware::health::implementation { class HealthImpl : public Health { public: - HealthImpl(std::unique_ptr&& config) - : Health(std::move(config)) {} + HealthImpl(std::string_view instance_name, std::unique_ptr&& config) + : Health(std::move(instance_name), std::move(config)) {} - Return getStorageInfo(getStorageInfo_cb _hidl_cb) override; - Return getDiskStats(getDiskStats_cb _hidl_cb) override; + ndk::ScopedAStatus getDiskStats(std::vector* out) override; + ndk::ScopedAStatus getStorageInfo(std::vector* out) override; protected: void UpdateHealthInfo(HealthInfo* health_info) override; @@ -214,53 +212,57 @@ class HealthImpl : public Health { }; void HealthImpl::UpdateHealthInfo(HealthInfo* health_info) { - struct BatteryProperties props; - convertFromHealthInfo(health_info->legacy.legacy, &props); - private_healthd_board_battery_update(&props); - convertToHealthInfo(&props, health_info->legacy.legacy); + private_healthd_board_battery_update(health_info); } -Return HealthImpl::getStorageInfo(getStorageInfo_cb _hidl_cb) +ndk::ScopedAStatus HealthImpl::getStorageInfo(std::vector* out) { - std::vector info; - private_get_storage_info(info); - hidl_vec info_vec(info); - if (!info.size()) { - _hidl_cb(Result::NOT_SUPPORTED, info_vec); - } else { - _hidl_cb(Result::SUCCESS, info_vec); + private_get_storage_info(out); + if (out->empty()) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } - return Void(); + return ndk::ScopedAStatus::ok(); } -Return HealthImpl::getDiskStats(getDiskStats_cb _hidl_cb) +ndk::ScopedAStatus HealthImpl::getDiskStats(std::vector* out) { - std::vector stats; - private_get_disk_stats(stats); - hidl_vec stats_vec(stats); - if (!stats.size()) { - _hidl_cb(Result::NOT_SUPPORTED, stats_vec); - } else { - _hidl_cb(Result::SUCCESS, stats_vec); + private_get_disk_stats(out); + if (out->empty()) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } - return Void(); + return ndk::ScopedAStatus::ok(); } -} // namespace implementation -} // namespace V2_1 -} // namespace health -} // namespace hardware -} // namespace android +} // namespace aidl::android::hardware::health::implementation + +int main(int argc, char **argv) { + using ::aidl::android::hardware::health::implementation::HealthImpl; + + // Use kernel logging in recovery +#ifdef __ANDROID_RECOVERY__ + android::base::InitLogging(argv, android::base::KernelLogger); +#endif -extern "C" IHealth* HIDL_FETCH_IHealth(const char* instance) { - using ::android::hardware::health::V2_1::implementation::HealthImpl; - if (instance != "default"sv) { - return nullptr; - } auto config = std::make_unique(); InitHealthdConfig(config.get()); private_healthd_board_init(config.get()); - return new HealthImpl(std::move(config)); + auto binder = + ndk::SharedRefBase::make("default"sv, std::move(config)); + + if (argc >= 2 && argv[1] == "--charger"sv) { + // In regular mode, start charger UI. +#ifndef __ANDROID_RECOVERY__ + LOG(INFO) << "Starting charger mode with UI."; + return ChargerModeMain(binder, std::make_shared(binder)); +#endif + // In recovery, ignore --charger arg. + LOG(INFO) << "Starting charger mode without UI."; + } else { + LOG(INFO) << "Starting health HAL."; + } + + auto hal_health_loop = std::make_shared(binder, binder); + return hal_health_loop->StartLoop(); } diff --git a/health/android.hardware.health-service.gs101.rc b/health/android.hardware.health-service.gs101.rc new file mode 100644 index 00000000..0c313626 --- /dev/null +++ b/health/android.hardware.health-service.gs101.rc @@ -0,0 +1,16 @@ +service vendor.health-gs101 /vendor/bin/hw/android.hardware.health-service.gs101 + class hal + user system + group system + capabilities WAKE_ALARM BLOCK_SUSPEND + file /dev/kmsg w +service vendor.charger /vendor/bin/hw/android.hardware.health-service.gs101 --charger + class charger + seclabel u:r:charger_vendor:s0 + user system + group system wakelock input + capabilities SYS_BOOT + file /dev/kmsg w + file /sys/fs/pstore/console-ramoops-0 r + file /sys/fs/pstore/console-ramoops r + file /proc/last_kmsg r diff --git a/health/android.hardware.health-service.gs101.xml b/health/android.hardware.health-service.gs101.xml new file mode 100644 index 00000000..98026cbd --- /dev/null +++ b/health/android.hardware.health-service.gs101.xml @@ -0,0 +1,7 @@ + + + android.hardware.health + 1 + IHealth/default + + diff --git a/health/android.hardware.health-service.gs101_recovery.rc b/health/android.hardware.health-service.gs101_recovery.rc new file mode 100644 index 00000000..d1e35042 --- /dev/null +++ b/health/android.hardware.health-service.gs101_recovery.rc @@ -0,0 +1,7 @@ +service vendor.health-gs101 /system/bin/hw/android.hardware.health-service.gs101_recovery + class hal + seclabel u:r:hal_health_default:s0 + user system + group system + capabilities WAKE_ALARM BLOCK_SUSPEND + file /dev/kmsg w diff --git a/interfaces/boot/1.2/BootControl.cpp b/interfaces/boot/1.2/BootControl.cpp index a28be05a..6c480bb6 100644 --- a/interfaces/boot/1.2/BootControl.cpp +++ b/interfaces/boot/1.2/BootControl.cpp @@ -49,6 +49,8 @@ namespace { #define BOOT_B_PATH "/dev/block/by-name/boot_b" #define DEVINFO_PATH "/dev/block/by-name/devinfo" +#define BLOW_AR_PATH "/sys/kernel/boot_control/blow_ar" + // slot flags #define AB_ATTR_PRIORITY_SHIFT 52 #define AB_ATTR_PRIORITY_MASK (3UL << AB_ATTR_PRIORITY_SHIFT) @@ -174,6 +176,11 @@ static void DevInfoInitSlot(devinfo_ab_slot_data_t &slot_data) { slot_data.fastboot_ok = 0; } +static bool blowAR() { + android::base::unique_fd fd(open(BLOW_AR_PATH, O_WRONLY | O_DSYNC)); + return android::base::WriteStringToFd("1", fd); +} + } // namespace // Methods from ::android::hardware::boot::V1_0::IBootControl follow. @@ -211,7 +218,17 @@ Return BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) { ret = setSlotFlag(getCurrentSlot(), AB_ATTR_SUCCESSFUL); } - !ret ? _hidl_cb({false, "Failed to set successful flag"}) : _hidl_cb({true, ""}); + if (!ret) { + _hidl_cb({false, "Failed to set successful flag"}); + return Void(); + } + + if (!blowAR()) { + ALOGE("Failed to blow anti-rollback counter"); + // Ignore the error, since ABL will re-trigger it on reboot + } + + _hidl_cb({true, ""}); return Void(); } diff --git a/manifest-gralloc3.xml b/manifest-gralloc3.xml deleted file mode 100644 index ca284dfa..00000000 --- a/manifest-gralloc3.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.0 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - android.hardware.media.omx - hwbinder - 1.0 - - IOmx - default - - - IOmxStore - default - - - - android.hardware.graphics.allocator - hwbinder - 2.0 - - IAllocator - default - - - - android.hardware.graphics.mapper - passthrough - 2.0 - - IMapper - default - - - - android.hardware.graphics.composer - hwbinder - 2.4 - - IComposer - default - - - - android.hardware.memtrack - hwbinder - 1.0 - - IMemtrack - default - - - - android.hardware.renderscript - passthrough - 1.0 - - IDevice - default - - - - android.hardware.drm - hwbinder - 1.0 - - ICryptoFactory - default - - - IDrmFactory - default - - @1.3::ICryptoFactory/clearkey - @1.3::IDrmFactory/clearkey - @1.3::ICryptoFactory/widevine - @1.3::IDrmFactory/widevine - - - android.hardware.dumpstate - hwbinder - 1.0 - - IDumpstateDevice - default - - - - android.hardware.bluetooth - hwbinder - 1.1 - - IBluetoothHci - default - - - - android.hardware.bluetooth.audio - hwbinder - 2.1 - - IBluetoothAudioProvidersFactory - default - - - - android.hardware.boot - hwbinder - @1.2::IBootControl/default - - - android.hardware.sensors - hwbinder - 1.0 - - ISensors - default - - - - android.hardware.neuralnetworks - hwbinder - 1.2 - - IDevice - armnn - - @1.2::IDevice/armnn - - - android.hardware.neuralnetworks - hwbinder - @1.3::IDevice/google-edgetpu - - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - - - com.google.input - - ITouchContextService - default - - - - hardware.google.bluetooth.bt_channel_avoidance - hwbinder - 1.0 - - IBTChannelAvoidance - default - - - - hardware.google.bluetooth.sar - hwbinder - 1.1 - - IBluetoothSar - default - - - - hardware.google.bluetooth.ccc - hwbinder - 1.0 - - IBluetoothCcc - default - - - - vendor.google.google_battery - hwbinder - 1.1 - - IGoogleBattery - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 2.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - - diff --git a/manifest.xml b/manifest.xml index 7b78da9a..1cb5345a 100644 --- a/manifest.xml +++ b/manifest.xml @@ -2,7 +2,7 @@ android.hardware.audio hwbinder - 7.0 + 7.1 IDevicesFactory default @@ -39,15 +39,6 @@ default - - android.hardware.graphics.allocator - hwbinder - 4.0 - - IAllocator - default - - android.hardware.graphics.mapper passthrough @@ -84,15 +75,6 @@ default - - android.hardware.bluetooth.audio - hwbinder - 2.1 - - IBluetoothAudioProvidersFactory - default - - android.hardware.boot hwbinder @@ -108,15 +90,6 @@ @1.3::IDevice/google-armnn - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - com.google.input @@ -133,6 +106,15 @@ default + + hardware.google.bluetooth.ext + hwbinder + 1.0 + + IBluetoothExt + default + + hardware.google.bluetooth.sar hwbinder @@ -145,7 +127,7 @@ hardware.google.bluetooth.ccc hwbinder - 1.0 + 1.1 IBluetoothCcc default @@ -154,7 +136,7 @@ vendor.google.google_battery hwbinder - 1.1 + 1.2 IGoogleBattery default @@ -163,7 +145,7 @@ vendor.google.whitechapel.audio.audioext hwbinder - 2.0 + 3.0 IAudioExt default diff --git a/manifest_64-gralloc3.xml b/manifest_64-gralloc3.xml deleted file mode 100644 index 9dc7924a..00000000 --- a/manifest_64-gralloc3.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.0 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - android.hardware.graphics.allocator - hwbinder - 2.0 - - IAllocator - default - - - - android.hardware.graphics.mapper - passthrough - 2.1 - - IMapper - default - - - - android.hardware.graphics.composer - hwbinder - 2.4 - - IComposer - default - - - - android.hardware.memtrack - hwbinder - 1.0 - - IMemtrack - default - - - - android.hardware.renderscript - passthrough - 1.0 - - IDevice - default - - - - android.hardware.drm - hwbinder - 1.0 - - ICryptoFactory - default - - - IDrmFactory - default - - @1.3::ICryptoFactory/clearkey - @1.3::IDrmFactory/clearkey - @1.3::ICryptoFactory/widevine - @1.3::IDrmFactory/widevine - - - android.hardware.dumpstate - hwbinder - 1.0 - - IDumpstateDevice - default - - - - android.hardware.bluetooth - hwbinder - 1.1 - - IBluetoothHci - default - - - - android.hardware.bluetooth.audio - hwbinder - 2.1 - - IBluetoothAudioProvidersFactory - default - - - - android.hardware.boot - hwbinder - @1.2::IBootControl/default - - - android.hardware.sensors - hwbinder - 1.0 - - ISensors - default - - - - - android.hardware.neuralnetworks - hwbinder - @1.3::IDevice/google-edgetpu - - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - - - com.google.input - - ITouchContextService - default - - - - hardware.google.bluetooth.bt_channel_avoidance - hwbinder - 1.0 - - IBTChannelAvoidance - default - - - - hardware.google.bluetooth.sar - hwbinder - 1.1 - - IBluetoothSar - default - - - - hardware.google.bluetooth.ccc - hwbinder - 1.0 - - IBluetoothCcc - default - - - - vendor.google.google_battery - hwbinder - 1.1 - - IGoogleBattery - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 2.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - - diff --git a/manifest_64.xml b/manifest_64.xml index 17b08d04..09466c99 100644 --- a/manifest_64.xml +++ b/manifest_64.xml @@ -2,7 +2,7 @@ android.hardware.audio hwbinder - 7.0 + 7.1 IDevicesFactory default @@ -26,15 +26,6 @@ default - - android.hardware.graphics.allocator - hwbinder - 4.0 - - IAllocator - default - - android.hardware.graphics.mapper passthrough @@ -109,15 +100,6 @@ hwbinder @1.3::IDevice/google-edgetpu - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - com.google.input @@ -146,7 +128,7 @@ hardware.google.bluetooth.ccc hwbinder - 1.0 + 1.1 IBluetoothCcc default @@ -155,7 +137,7 @@ vendor.google.google_battery hwbinder - 1.1 + 1.2 IGoogleBattery default @@ -164,7 +146,7 @@ vendor.google.whitechapel.audio.audioext hwbinder - 2.0 + 3.0 IAudioExt default diff --git a/media_codecs_aosp_c2.xml b/media_codecs_aosp_c2.xml index 5d34a907..62b47070 100644 --- a/media_codecs_aosp_c2.xml +++ b/media_codecs_aosp_c2.xml @@ -153,6 +153,7 @@ + @@ -166,6 +167,7 @@ + @@ -179,6 +181,7 @@ + @@ -191,6 +194,7 @@ + @@ -204,6 +208,7 @@ + @@ -217,6 +222,7 @@ + diff --git a/media_codecs_performance_c2.xml b/media_codecs_performance_c2.xml index a60791cc..7000661b 100644 --- a/media_codecs_performance_c2.xml +++ b/media_codecs_performance_c2.xml @@ -71,10 +71,8 @@ - - - - + + @@ -133,7 +131,9 @@ - + + + @@ -179,8 +179,7 @@ - - + @@ -189,8 +188,7 @@ - - + @@ -209,29 +207,20 @@ - - - - - - - - + + + + - - - - - - - - + + + + - - + @@ -248,8 +237,7 @@ - - + @@ -257,5 +245,10 @@ + + + + + diff --git a/modem/user.mk b/modem/user.mk index 81f37736..fb01f2cc 100644 --- a/modem/user.mk +++ b/modem/user.mk @@ -1,2 +1,4 @@ -PRODUCT_PACKAGES += dmd +ifneq ($(BOARD_WITHOUT_RADIO),true) + PRODUCT_PACKAGES += dmd +endif BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/modem/user diff --git a/modem/userdebug.mk b/modem/userdebug.mk index 87697a75..4fcab646 100644 --- a/modem/userdebug.mk +++ b/modem/userdebug.mk @@ -1,2 +1,4 @@ -PRODUCT_PACKAGES += vcd +ifneq ($(BOARD_WITHOUT_RADIO),true) + PRODUCT_PACKAGES += vcd +endif BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/modem/userdebug/ diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 3c1e38ae..6b1cfcc6 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -188,7 +188,7 @@ 0 256 - 2 + 3 3 @@ -240,10 +240,18 @@ true + + 3 3 + + 3 @@ -260,4 +268,13 @@ true + + + + "com.shannon.imsservice" + "com.android.phone" + diff --git a/overlay/frameworks/base/core/res/res/values/dimens.xml b/overlay/frameworks/base/core/res/res/values/dimens.xml new file mode 100644 index 00000000..fc36aa34 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/dimens.xml @@ -0,0 +1,21 @@ + + + + + 70px + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml index cea6e902..6d08eb4c 100644 --- a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml +++ b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml @@ -16,9 +16,6 @@ */ --> - - 70px - 1dp diff --git a/pixelstats/pixelstats-vendor.gs101.rc b/pixelstats/pixelstats-vendor.gs101.rc index 98af5fc5..d324b6a8 100644 --- a/pixelstats/pixelstats-vendor.gs101.rc +++ b/pixelstats/pixelstats-vendor.gs101.rc @@ -1,5 +1,5 @@ on property:sys.boot_completed=1 - start vendor.pixelstats_vendor + start vendor.pixelstats_vendor service vendor.pixelstats_vendor /vendor/bin/pixelstats-vendor class hal diff --git a/pkvm/Android.bp b/pkvm/Android.bp new file mode 100644 index 00000000..dba96019 --- /dev/null +++ b/pkvm/Android.bp @@ -0,0 +1,31 @@ +// Copyright (C) 2021 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 { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +cc_binary { + name: "pkvm_enabler", + vendor: true, + init_rc: ["pkvm_enabler.gs101.rc"], + srcs: ["pkvm_enabler.c"], + shared_libs: ["liblog"], +} diff --git a/pkvm/pkvm_enabler.c b/pkvm/pkvm_enabler.c new file mode 100644 index 00000000..cb14ba6f --- /dev/null +++ b/pkvm/pkvm_enabler.c @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2021 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. + */ + +#define LOG_TAG "pkvm_enabler" + +#include +#include +#include +#include +#include + +#include + +#define KVM_DEVICE "/dev/kvm" +#define MISC_WRITER "/vendor/bin/misc_writer" + +int main() { + char *newargv[] = { MISC_WRITER, "--set-enable-pkvm", NULL }; + char *newenvp[] = { NULL }; + pid_t pid; + int ret, wstatus; + + /* Check whether KVM device exists. */ + ret = access(KVM_DEVICE, F_OK); + + /* If KVM device exists, return SUCCESS to continue booting. */ + if (ret == 0) { + exit(EXIT_SUCCESS); + } + + if (ret != -ENOENT) { + ALOGW("Unexpected error from access(): %d", ret); + } + + /* + * If KVM device does not exist, run misc_writer and return FAILURE + * to force a reboot. + */ + pid = fork(); + if (pid == -1) { + ALOGE("Could not fork: %d", errno); + exit(EXIT_FAILURE); + } + + if (pid == 0) { + execve(MISC_WRITER, newargv, newenvp); + ALOGE("Could not execute " MISC_WRITER ": %d", errno); + _exit(EXIT_FAILURE); + } + + waitpid(pid, &wstatus, 0); + if (WIFEXITED(wstatus)) { + ret = WEXITSTATUS(wstatus); + if (ret) { + ALOGE(MISC_WRITER " exit status: %d", ret); + } + } else { + ALOGE(MISC_WRITER " terminated unexpectedly: %d", wstatus); + } + + exit(EXIT_FAILURE); +} diff --git a/pkvm/pkvm_enabler.gs101.rc b/pkvm/pkvm_enabler.gs101.rc new file mode 100644 index 00000000..6f329d30 --- /dev/null +++ b/pkvm/pkvm_enabler.gs101.rc @@ -0,0 +1,5 @@ +service pkvm_enabler /vendor/bin/pkvm_enabler + reboot_on_failure reboot,pkvm-not-enabled + +on early-init + exec_start pkvm_enabler \ No newline at end of file diff --git a/pkvm/pkvm_experiment.rc b/pkvm/pkvm_experiment.rc new file mode 100644 index 00000000..148f0841 --- /dev/null +++ b/pkvm/pkvm_experiment.rc @@ -0,0 +1,13 @@ +service vendor.pkvm_enable /vendor/bin/misc_writer --set-enable-pkvm + disabled + oneshot + +service vendor.pkvm_disable /vendor/bin/misc_writer --set-disable-pkvm + disabled + oneshot + +on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=true + start vendor.pkvm_enable + +on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=false + start vendor.pkvm_disable diff --git a/powerhint_a0.json b/powerhint_a0.json index 2136a2bb..76472db1 100644 --- a/powerhint_a0.json +++ b/powerhint_a0.json @@ -55,7 +55,7 @@ }, { "Name": "TAUClampBoost", - "Path": "/sys/kernel/vendor_sched/ta_uclamp_min", + "Path": "/proc/vendor_sched/ta_uclamp_min", "Values": [ "0", "410", @@ -75,15 +75,6 @@ ], "ResetOnInit": true }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, { "Name": "PowerHALRenderingState", "Path": "vendor.powerhal.rendering", @@ -184,12 +175,6 @@ "Duration": 200, "Value": "0" }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "LAUNCH", "Type": "EndHint", @@ -231,12 +216,6 @@ "Duration": 5000, "Value": "0" }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "CAMERA_LAUNCH", "Node": "CPUBigClusterMaxFreq", diff --git a/powerhint_a1.json b/powerhint_a1.json index c3d1581d..7a980ba5 100644 --- a/powerhint_a1.json +++ b/powerhint_a1.json @@ -75,7 +75,7 @@ }, { "Name": "TAUClampBoost", - "Path": "/sys/kernel/vendor_sched/ta_uclamp_min", + "Path": "/proc/vendor_sched/ta_uclamp_min", "Values": [ "0", "410", @@ -95,15 +95,6 @@ ], "ResetOnInit": true }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, { "Name": "LimitFlashCurrent", "Path": "vendor.camera.max_flash_current", @@ -214,12 +205,6 @@ "Duration": 200, "Value": "0" }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "LAUNCH", "Type": "EndHint", @@ -261,12 +246,6 @@ "Duration": 5000, "Value": "0" }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "CAMERA_LAUNCH", "Node": "CPUBigClusterMaxFreq", diff --git a/powerstats/Android.bp b/powerstats/Android.bp index 10ecbede..74b72429 100644 --- a/powerstats/Android.bp +++ b/powerstats/Android.bp @@ -11,6 +11,14 @@ // 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. + +soong_namespace { + imports: [ + "hardware/google/pixel", + "device/google/gs-common/powerstats", + ], +} + package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import @@ -33,6 +41,7 @@ cc_library { ], shared_libs: [ + "android.hardware.power.stats-impl.gs-common", "android.hardware.power.stats-impl.pixel", ], } diff --git a/powerstats/AocStateResidencyDataProvider.cpp b/powerstats/AocStateResidencyDataProvider.cpp deleted file mode 100644 index c64496dd..00000000 --- a/powerstats/AocStateResidencyDataProvider.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2020 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 "AocStateResidencyDataProvider.h" - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector> ids, std::vector> states) { - // AoC stats are reported in ticks of 244.140625ns. The transform - // function converts ticks to milliseconds. - // 1000000 / 244.140625 = 4096. - static const uint64_t AOC_CLK = 4096; - std::function aocTickToMs = [](uint64_t a) { return a / AOC_CLK; }; - GenericStateResidencyDataProvider::StateResidencyConfig config = { - .entryCountSupported = true, - .entryCountPrefix = "Counter:", - .totalTimeSupported = true, - .totalTimePrefix = "Cumulative time:", - .totalTimeTransform = aocTickToMs, - .lastEntrySupported = true, - .lastEntryPrefix = "Time last entered:", - .lastEntryTransform = aocTickToMs, - }; - for (const auto &id : ids) { - for (const auto &state : states) { - std::vector> aocStateHeaders = { - std::make_pair(state.first, ""), - }; - std::vector cfgs; - cfgs.emplace_back(generateGenericStateResidencyConfigs(config, aocStateHeaders), - id.first, ""); - std::unique_ptr sdp( - new GenericStateResidencyDataProvider(id.second + state.second, cfgs)); - mProviders[id.first].push_back(std::move(sdp)); - } - } -} - -bool AocStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - // States from the same power entity are merged. - bool ret = true; - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateResidencies; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> residency; - ret &= provider->getStateResidencies(&residency); - - // Each provider should only return data for curEntity but checking anyway - if (residency.find(curEntity) != residency.end()) { - for (auto &r : residency.at(curEntity)) { - /* - * Modifying stateId here because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - r.id = stateId++; - stateResidencies.push_back(r); - } - } - } - - residencies->emplace(curEntity, stateResidencies); - } - return ret; -} - -std::unordered_map> AocStateResidencyDataProvider::getInfo() { - // States from the same power entity are merged - std::unordered_map> infos; - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateInfos; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> info = provider->getInfo(); - - // Each provider should only return data for curEntity but checking anyway - if (info.find(curEntity) != info.end()) { - for (auto &i : info.at(curEntity)) { - /* - * Modifying stateId because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - i.id = stateId++; - stateInfos.push_back(i); - } - } - } - - infos.emplace(curEntity, stateInfos); - } - - return infos; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/AocStateResidencyDataProvider.h b/powerstats/AocStateResidencyDataProvider.h deleted file mode 100644 index 50089121..00000000 --- a/powerstats/AocStateResidencyDataProvider.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2020 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. - */ -#pragma once - -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class AocStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - AocStateResidencyDataProvider(std::vector> ids, - std::vector> states); - ~AocStateResidencyDataProvider() = default; - bool getStateResidencies( - std::unordered_map> *residencies) override; - std::unordered_map> getInfo() override; - - private: - std::unordered_map> /* providers */> mProviders; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl \ No newline at end of file diff --git a/powerstats/DevfreqStateResidencyDataProvider.cpp b/powerstats/DevfreqStateResidencyDataProvider.cpp deleted file mode 100644 index d59e1e5e..00000000 --- a/powerstats/DevfreqStateResidencyDataProvider.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2021 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 "DevfreqStateResidencyDataProvider.h" - -#include - -static const std::string nameSuffix = "-DVFS"; -static const std::string pathSuffix = "/time_in_state"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -DevfreqStateResidencyDataProvider::DevfreqStateResidencyDataProvider(const std::string& name, - const std::string& path) : mName(name + nameSuffix), mPath(path + pathSuffix) {} - -bool DevfreqStateResidencyDataProvider::extractNum(const char *str, char **str_end, int base, - int64_t* num) { - // errno can be set to any non-zero value by a library function call - // regardless of whether there was an error, so it needs to be cleared - // in order to check the error set by strtoll - errno = 0; - *num = std::strtoll(str, str_end, base); - return (errno != ERANGE); -} - -std::vector> DevfreqStateResidencyDataProvider::parseTimeInState() { - // Using FILE* instead of std::ifstream for performance reasons - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << "Failed to open file " << mPath; - return {}; - } - - std::vector> timeInState; - - char *line = nullptr; - size_t len = 0; - while (getline(&line, &len, fp.get()) != -1) { - char* pEnd; - int64_t frequencyHz, totalTimeMs; - if (!extractNum(line, &pEnd, 10, &frequencyHz) || - !extractNum(pEnd, &pEnd, 10, &totalTimeMs)) { - PLOG(ERROR) << "Failed to parse " << mPath; - free(line); - return {}; - } - - timeInState.push_back({frequencyHz, totalTimeMs}); - } - - free(line); - return timeInState; -} - -bool DevfreqStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::vector> timeInState = parseTimeInState(); - - if (timeInState.empty()) { - return false; - } - - int32_t id = 0; - std::vector stateResidencies; - for (const auto[frequencyHz, totalTimeMs] : timeInState) { - StateResidency s = {.id = id++, .totalTimeInStateMs = totalTimeMs}; - stateResidencies.push_back(s); - } - - residencies->emplace(mName, stateResidencies); - return true; -} - -std::unordered_map> DevfreqStateResidencyDataProvider::getInfo() { - std::vector> timeInState = parseTimeInState(); - - if (timeInState.empty()) { - return {}; - } - - int32_t id = 0; - std::vector states; - for (const auto[frequencyHz, totalTimeMs] : timeInState) { - State s = {.id = id++, .name = std::to_string(frequencyHz / 1000) + "MHz"}; - states.push_back(s); - } - - return {{mName, states}}; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DevfreqStateResidencyDataProvider.h b/powerstats/DevfreqStateResidencyDataProvider.h deleted file mode 100644 index 8341b433..00000000 --- a/powerstats/DevfreqStateResidencyDataProvider.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ -#pragma once - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class DevfreqStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - DevfreqStateResidencyDataProvider(const std::string& name, const std::string& path); - ~DevfreqStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - bool extractNum(const char *str, char **str_end, int base, int64_t* num); - std::vector> parseTimeInState(); - const std::string mName; - const std::string mPath; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DvfsStateResidencyDataProvider.cpp b/powerstats/DvfsStateResidencyDataProvider.cpp deleted file mode 100644 index 511159ef..00000000 --- a/powerstats/DvfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2020 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 "DvfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseUint; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -static const std::string nameSuffix = "-DVFS"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -DvfsStateResidencyDataProvider::DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, - std::vector cfgs) - : mPath(std::move(path)), mClockRate(clockRate), mPowerEntities(std::move(cfgs)) {} - -int32_t DvfsStateResidencyDataProvider::matchEntity(char const *line) { - for (int32_t i = 0; i < mPowerEntities.size(); i++) { - if (mPowerEntities[i].powerEntityName == Trim(std::string(line))) { - return i; - } - } - return -1; -} - -int32_t DvfsStateResidencyDataProvider::matchState(char const *line, const Config& powerEntity) { - for (int32_t i = 0; i < powerEntity.states.size(); i++) { - if (StartsWith(Trim(std::string(line)), powerEntity.states[i].second)) { - return i; - } - } - return -1; -} - -bool DvfsStateResidencyDataProvider::parseState(char const *line, uint64_t *duration, - uint64_t *count) { - std::vector parts = Split(line, " "); - if (parts.size() != 7) { - return false; - } - if (!ParseUint(Trim(parts[3]), count)) { - return false; - } - if (!ParseUint(Trim(parts[6]), duration)) { - return false; - } - return true; -} - -bool DvfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << mPath; - return false; - } - - for (const Config &powerEntity : mPowerEntities) { - std::vector stateResidency(powerEntity.states.size()); - for (int32_t i = 0; i < stateResidency.size(); i++) { - stateResidency[i].id = i; - } - residencies->emplace(powerEntity.powerEntityName + nameSuffix, stateResidency); - } - - size_t len = 0; - char *line = nullptr; - - int32_t temp, powerEntityIndex, stateId = -1; - uint64_t duration, count; - auto it = residencies->end(); - - while (getline(&line, &len, fp.get()) != -1) { - temp = matchEntity(line); - // Assign new index only when a new valid entity is encountered. - if (temp >= 0) { - powerEntityIndex = temp; - it = residencies->find(mPowerEntities[powerEntityIndex].powerEntityName + nameSuffix); - } - - if (it != residencies->end()) { - stateId = matchState(line, mPowerEntities[powerEntityIndex]); - - if (stateId >= 0) { - if (parseState(line, &duration, &count)) { - it->second[stateId].totalTimeInStateMs = - duration / mClockRate; - it->second[stateId].totalStateEntryCount = count; - } else { - LOG(ERROR) << "Failed to parse duration and count from [" << std::string(line) - << "]"; - return false; - } - } - } - } - - free(line); - - return true; -} - -std::unordered_map> DvfsStateResidencyDataProvider::getInfo() { - std::unordered_map> info; - for (auto const &entity : mPowerEntities) { - std::vector stateInfo(entity.states.size()); - int32_t stateId = 0; - for (auto const &state : entity.states) { - stateInfo[stateId] = State{ - .id = stateId, - .name = state.first - }; - stateId++; - } - info.emplace(entity.powerEntityName + nameSuffix, stateInfo); - } - return info; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DvfsStateResidencyDataProvider.h b/powerstats/DvfsStateResidencyDataProvider.h deleted file mode 100644 index ca8ab22b..00000000 --- a/powerstats/DvfsStateResidencyDataProvider.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2020 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. - */ -#pragma once - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class DvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - class Config { - public: - // Power entity name to parse. - std::string powerEntityName; - - // List of state pairs (name to display, name to parse). - std::vector> states; - }; - /* - * path - path to dvfs sysfs node. - * clockRate - clock rate in KHz. - */ - DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, std::vector cfgs); - ~DvfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - int32_t matchEntity(char const *line); - int32_t matchState(char const *line, const Config& powerEntity); - bool parseState(char const *line, uint64_t *duration, uint64_t *count); - - const std::string mPath; - const uint64_t mClockRate; - std::vector mPowerEntities; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/Gs101CommonDataProviders.cpp b/powerstats/Gs101CommonDataProviders.cpp index f1e3aa5b..13e6b71f 100644 --- a/powerstats/Gs101CommonDataProviders.cpp +++ b/powerstats/Gs101CommonDataProviders.cpp @@ -605,17 +605,33 @@ void addPowerDomains(std::shared_ptr p) { } void addDevfreq(std::shared_ptr p) { - p->addStateResidencyDataProvider(std::make_unique("INT", + p->addStateResidencyDataProvider(std::make_unique( + "INT", "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int")); - p->addStateResidencyDataProvider(std::make_unique("INTCAM", + p->addStateResidencyDataProvider(std::make_unique( + "INTCAM", "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam")); - p->addStateResidencyDataProvider(std::make_unique("CAM", + p->addStateResidencyDataProvider(std::make_unique( + "DISP", + "/sys/devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp")); + + p->addStateResidencyDataProvider(std::make_unique( + "CAM", "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam")); - p->addStateResidencyDataProvider(std::make_unique("TNR", + p->addStateResidencyDataProvider(std::make_unique( + "TNR", "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr")); + + p->addStateResidencyDataProvider(std::make_unique( + "MFC", + "/sys/devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc")); + + p->addStateResidencyDataProvider(std::make_unique( + "BO", + "/sys/devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo")); } void addTPU(std::shared_ptr p) { @@ -630,7 +646,7 @@ void addTPU(std::shared_ptr p) { p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndAttrConsumer(p, EnergyConsumerType::OTHER, "TPU", {"S10M_VDD_TPU"}, - {{UID_TIME_IN_STATE, "/sys/class/edgetpu/abrolhos/device/tpu_usage"}}, + {{UID_TIME_IN_STATE, "/sys/class/edgetpu/edgetpu-soc/device/tpu_usage"}}, stateCoeffs)); } diff --git a/powerstats/UfsStateResidencyDataProvider.cpp b/powerstats/UfsStateResidencyDataProvider.cpp deleted file mode 100644 index aec77241..00000000 --- a/powerstats/UfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 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 "UfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseInt; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -const int32_t HIBERNATE_STATE_ID = 0; -const std::string UFS_NAME = "UFS"; - -UfsStateResidencyDataProvider::UfsStateResidencyDataProvider(std::string prefix) : kPrefix(prefix) {} - -bool UfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - StateResidency residency; - residency.id = HIBERNATE_STATE_ID; - - // The transform function converts microseconds to milliseconds. - std::function usecToMs = [](uint64_t a) { return a / 1000; }; - - residency.totalTimeInStateMs = usecToMs(readStat(kPrefix + "hibern8_total_us")); - residency.totalStateEntryCount = readStat(kPrefix + "hibern8_exit_cnt"); - residency.lastEntryTimestampMs = usecToMs(readStat(kPrefix + "last_hibern8_enter_time")); - - residencies->emplace(UFS_NAME, std::vector{residency}); - return true; -} - -std::unordered_map> UfsStateResidencyDataProvider::getInfo() { - return {{UFS_NAME, std::vector{{HIBERNATE_STATE_ID, "HIBERN8"}} }}; -} - -int64_t UfsStateResidencyDataProvider::readStat(std::string path) { - std::unique_ptr fp(fopen(path.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << path - << " Error = " << strerror(errno); - return 0; - } - const size_t size = 20; - char buf[size]; - (void)fread(&buf, sizeof(char), size, fp.get()); - int64_t ret; - if (!ParseInt(Trim(std::string(buf)), &ret)) { - LOG(ERROR) << "Failed to parse int64 from [" << std::string(buf) << "]"; - } - return ret; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/UfsStateResidencyDataProvider.h b/powerstats/UfsStateResidencyDataProvider.h deleted file mode 100644 index f4ef268d..00000000 --- a/powerstats/UfsStateResidencyDataProvider.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ -#pragma once - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class UfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - UfsStateResidencyDataProvider(std::string prefix); - ~UfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - int64_t readStat(std::string path); - - const std::string kPrefix; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/radio/config/Pixel_Default.cfg b/radio/config/Pixel_Default.cfg new file mode 100644 index 00000000..b1a83fde --- /dev/null +++ b/radio/config/Pixel_Default.cfg @@ -0,0 +1 @@ +Pixel_Default.nprf,Pixel_Default_metrics.xml \ No newline at end of file diff --git a/radio/config/Pixel_Default.nprf b/radio/config/Pixel_Default.nprf new file mode 100644 index 00000000..76406e44 Binary files /dev/null and b/radio/config/Pixel_Default.nprf differ diff --git a/radio/config/Pixel_Default_metrics.xml b/radio/config/Pixel_Default_metrics.xml new file mode 100644 index 00000000..25499465 --- /dev/null +++ b/radio/config/Pixel_Default_metrics.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/radio/config/Pixel_stability.cfg b/radio/config/Pixel_stability.cfg new file mode 100644 index 00000000..db01dd11 --- /dev/null +++ b/radio/config/Pixel_stability.cfg @@ -0,0 +1 @@ +Pixel_stability.nprf,Pixel_Default_metrics.xml diff --git a/radio/config/Pixel_stability.nprf b/radio/config/Pixel_stability.nprf new file mode 100644 index 00000000..58148921 Binary files /dev/null and b/radio/config/Pixel_stability.nprf differ diff --git a/radio/config/default.cfg b/radio/config/default.cfg new file mode 100644 index 00000000..58f9cd39 --- /dev/null +++ b/radio/config/default.cfg @@ -0,0 +1 @@ +default.nprf,default_metrics.xml \ No newline at end of file diff --git a/radio/config/default.nprf b/radio/config/default.nprf new file mode 100644 index 00000000..e9b3199a Binary files /dev/null and b/radio/config/default.nprf differ diff --git a/radio/config/default_NAS_RRC.cfg b/radio/config/default_NAS_RRC.cfg new file mode 100644 index 00000000..2cd3df23 --- /dev/null +++ b/radio/config/default_NAS_RRC.cfg @@ -0,0 +1 @@ +default_NAS_RRC.nprf,default_metrics.xml diff --git a/radio/config/default_NAS_RRC.nprf b/radio/config/default_NAS_RRC.nprf new file mode 100644 index 00000000..351827f8 Binary files /dev/null and b/radio/config/default_NAS_RRC.nprf differ diff --git a/radio/config/default_metrics.xml b/radio/config/default_metrics.xml new file mode 100644 index 00000000..5a54933a --- /dev/null +++ b/radio/config/default_metrics.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/radio/config/default_network.cfg b/radio/config/default_network.cfg new file mode 100644 index 00000000..fbe56139 --- /dev/null +++ b/radio/config/default_network.cfg @@ -0,0 +1 @@ +default_network.nprf,default_metrics.xml diff --git a/radio/config/default_network.nprf b/radio/config/default_network.nprf new file mode 100644 index 00000000..f5152cf1 Binary files /dev/null and b/radio/config/default_network.nprf differ diff --git a/radio/config/default_stability.cfg b/radio/config/default_stability.cfg new file mode 100644 index 00000000..6974dd67 --- /dev/null +++ b/radio/config/default_stability.cfg @@ -0,0 +1 @@ +default_stability.nprf,default_metrics.xml diff --git a/radio/config/default_stability.nprf b/radio/config/default_stability.nprf new file mode 100644 index 00000000..b9536a1b Binary files /dev/null and b/radio/config/default_stability.nprf differ diff --git a/radio/config/logging.conf b/radio/config/logging.conf new file mode 100644 index 00000000..d57c82aa --- /dev/null +++ b/radio/config/logging.conf @@ -0,0 +1 @@ +modem_logging_control START -o /data/vendor/radio/logs/always-on -n 10 -s 20 -m /vendor/etc/modem/default.cfg --enable_exmetric --enable_exmetric_internal \ No newline at end of file diff --git a/radio/config/teamfood_default.cfg b/radio/config/teamfood_default.cfg new file mode 100644 index 00000000..608ba540 --- /dev/null +++ b/radio/config/teamfood_default.cfg @@ -0,0 +1 @@ +teamfood_default.nprf,teamfood_default_metrics.xml \ No newline at end of file diff --git a/radio/config/teamfood_default.nprf b/radio/config/teamfood_default.nprf new file mode 100644 index 00000000..9f3f1c56 Binary files /dev/null and b/radio/config/teamfood_default.nprf differ diff --git a/radio/config/teamfood_default_metrics.xml b/radio/config/teamfood_default_metrics.xml new file mode 100644 index 00000000..5a54933a --- /dev/null +++ b/radio/config/teamfood_default_metrics.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rro_overlays/WifiOverlay/res/values/config.xml b/rro_overlays/WifiOverlay/res/values/config.xml index 4e5d4bfc..c63ff265 100644 --- a/rro_overlays/WifiOverlay/res/values/config.xml +++ b/rro_overlays/WifiOverlay/res/values/config.xml @@ -100,9 +100,6 @@ be checked via NL80211 interface --> true - - true - true @@ -132,4 +129,16 @@ true true + + + false + + + + 1 + + + true diff --git a/task_profiles.json b/task_profiles.json index 773f986f..4bcfe412 100644 --- a/task_profiles.json +++ b/task_profiles.json @@ -7,7 +7,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_ta", + "FilePath": "/proc/vendor_sched/set_task_group_ta", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_ta", "Value": "", "LogFailures": "false" } @@ -21,7 +22,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_cam", + "FilePath": "/proc/vendor_sched/set_task_group_cam", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_cam", "Value": "", "LogFailures": "false" } @@ -35,7 +37,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_cam_power", + "FilePath": "/proc/vendor_sched/set_task_group_cam_power", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_cam_power", "Value": "", "LogFailures": "false" } @@ -49,7 +52,23 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_dex2oat", + "FilePath": "/proc/vendor_sched/set_task_group_dex2oat", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_dex2oat", + "Value": "", + "LogFailures": "false" + } + } + ] + }, + { + "Name": "OtaPerformance", + "Actions": [ + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/proc/vendor_sched/set_task_group_ota", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_ota", "Value": "", "LogFailures": "false" } @@ -102,7 +121,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_bg", + "FilePath": "/proc/vendor_sched/set_task_group_bg", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_bg", "Value": "", "LogFailures": "false" } @@ -116,7 +136,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_sys", + "FilePath": "/proc/vendor_sched/set_task_group_sys", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_sys", "Value": "", "LogFailures": "false" } @@ -130,7 +151,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_fg", + "FilePath": "/proc/vendor_sched/set_task_group_fg", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_fg", "Value": "", "LogFailures": "false" } @@ -144,7 +166,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_ta", + "FilePath": "/proc/vendor_sched/set_task_group_ta", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_ta", "Value": "", "LogFailures": "false" } @@ -158,7 +181,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_nnapi", + "FilePath": "/proc/vendor_sched/set_task_group_nnapi", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_nnapi", "Value": "", "LogFailures": "false" } @@ -172,7 +196,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_sysbg", + "FilePath": "/proc/vendor_sched/set_task_group_sysbg", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_sysbg", "Value": "", "LogFailures": "false" } @@ -194,7 +219,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_sf", + "FilePath": "/proc/vendor_sched/set_task_group_sf", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_sf", "Value": "", "LogFailures": "false" } @@ -216,7 +242,8 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/set_task_group_rt", + "FilePath": "/proc/vendor_sched/set_task_group_rt", + "ProcFilePath": "/proc/vendor_sched/set_proc_group_rt", "Value": "", "LogFailures": "false" } @@ -230,7 +257,7 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/uclamp_fork_reset_set", + "FilePath": "/proc/vendor_sched/uclamp_fork_reset_set", "Value": "", "LogFailures": "false" } @@ -244,7 +271,7 @@ "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/uclamp_fork_reset_clear", + "FilePath": "/proc/vendor_sched/uclamp_fork_reset_clear", "Value": "", "LogFailures": "false" } @@ -257,6 +284,10 @@ { "Name": "Dex2OatBootComplete", "Profiles": [ "Dex2oatPerformance", "ProcessCapacityNormal", "LowIoPriority", "TimerSlackHigh" ] + }, + { + "Name": "OtaProfiles", + "Profiles": [ "OtaPerformance", "ServiceCapacityLow", "LowIoPriority", "TimerSlackHigh" ] } ] } diff --git a/telephony/user.mk b/telephony/user.mk index 983a19a0..f75596f3 100644 --- a/telephony/user.mk +++ b/telephony/user.mk @@ -1,2 +1,2 @@ -PRODUCT_COPY_FILES += vendor/samsung_slsi/telephony/common/device/samsung/init.radio.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.radio.sh +PRODUCT_COPY_FILES += vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device/samsung/init.radio.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.radio.sh BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/telephony/user/ diff --git a/tts/de-de/de-de-x-multi-darwinn-wavernn-r31.zvoice b/tts/de-de/de-de-x-multi-darwinn-wavernn-r31.zvoice new file mode 100644 index 00000000..b3b2a450 Binary files /dev/null and b/tts/de-de/de-de-x-multi-darwinn-wavernn-r31.zvoice differ diff --git a/tts/de-de/de-de-x-multi-r31.zvoice b/tts/de-de/de-de-x-multi-r31.zvoice new file mode 100644 index 00000000..782094f0 Binary files /dev/null and b/tts/de-de/de-de-x-multi-r31.zvoice differ diff --git a/tts/de-de/de-de-x-multi-seanet-r31.zvoice b/tts/de-de/de-de-x-multi-seanet-r31.zvoice new file mode 100644 index 00000000..2d24bad8 Binary files /dev/null and b/tts/de-de/de-de-x-multi-seanet-r31.zvoice differ diff --git a/tts/de-de/de-de-x-multi-wavernn-r31.zvoice b/tts/de-de/de-de-x-multi-wavernn-r31.zvoice new file mode 100644 index 00000000..9950e0bd Binary files /dev/null and b/tts/de-de/de-de-x-multi-wavernn-r31.zvoice differ diff --git a/tts/es-es/es-es-x-multi-darwinn-wavernn-r31.zvoice b/tts/es-es/es-es-x-multi-darwinn-wavernn-r31.zvoice new file mode 100644 index 00000000..1a934ba3 Binary files /dev/null and b/tts/es-es/es-es-x-multi-darwinn-wavernn-r31.zvoice differ diff --git a/tts/es-es/es-es-x-multi-r31.zvoice b/tts/es-es/es-es-x-multi-r31.zvoice new file mode 100644 index 00000000..41fe8d02 Binary files /dev/null and b/tts/es-es/es-es-x-multi-r31.zvoice differ diff --git a/tts/es-es/es-es-x-multi-seanet-r31.zvoice b/tts/es-es/es-es-x-multi-seanet-r31.zvoice new file mode 100644 index 00000000..25b1a7cc Binary files /dev/null and b/tts/es-es/es-es-x-multi-seanet-r31.zvoice differ diff --git a/tts/es-es/es-es-x-multi-wavernn-r31.zvoice b/tts/es-es/es-es-x-multi-wavernn-r31.zvoice new file mode 100644 index 00000000..d954a648 Binary files /dev/null and b/tts/es-es/es-es-x-multi-wavernn-r31.zvoice differ diff --git a/tts/fr-fr/fr-fr-x-multi-darwinn-wavernn-r31.zvoice b/tts/fr-fr/fr-fr-x-multi-darwinn-wavernn-r31.zvoice new file mode 100644 index 00000000..14a32649 Binary files /dev/null and b/tts/fr-fr/fr-fr-x-multi-darwinn-wavernn-r31.zvoice differ diff --git a/tts/fr-fr/fr-fr-x-multi-r31.zvoice b/tts/fr-fr/fr-fr-x-multi-r31.zvoice new file mode 100644 index 00000000..09a071e3 Binary files /dev/null and b/tts/fr-fr/fr-fr-x-multi-r31.zvoice differ diff --git a/tts/fr-fr/fr-fr-x-multi-seanet-r31.zvoice b/tts/fr-fr/fr-fr-x-multi-seanet-r31.zvoice new file mode 100644 index 00000000..d1238d54 Binary files /dev/null and b/tts/fr-fr/fr-fr-x-multi-seanet-r31.zvoice differ diff --git a/tts/fr-fr/fr-fr-x-multi-wavernn-r31.zvoice b/tts/fr-fr/fr-fr-x-multi-wavernn-r31.zvoice new file mode 100644 index 00000000..5fe1665b Binary files /dev/null and b/tts/fr-fr/fr-fr-x-multi-wavernn-r31.zvoice differ diff --git a/tts/it-it/it-it-x-multi-r27.zvoice b/tts/it-it/it-it-x-multi-r27.zvoice new file mode 100644 index 00000000..4ec64c31 Binary files /dev/null and b/tts/it-it/it-it-x-multi-r27.zvoice differ diff --git a/tts/ja-jp/ja-jp-x-multi-darwinn-wavernn-r29.zvoice b/tts/ja-jp/ja-jp-x-multi-darwinn-wavernn-r29.zvoice new file mode 100644 index 00000000..ecd52828 Binary files /dev/null and b/tts/ja-jp/ja-jp-x-multi-darwinn-wavernn-r29.zvoice differ diff --git a/tts/ja-jp/ja-jp-x-multi-r29.zvoice b/tts/ja-jp/ja-jp-x-multi-r29.zvoice new file mode 100644 index 00000000..c979108a Binary files /dev/null and b/tts/ja-jp/ja-jp-x-multi-r29.zvoice differ diff --git a/tts/ja-jp/ja-jp-x-multi-wavernn-r29.zvoice b/tts/ja-jp/ja-jp-x-multi-wavernn-r29.zvoice new file mode 100644 index 00000000..f4e49568 Binary files /dev/null and b/tts/ja-jp/ja-jp-x-multi-wavernn-r29.zvoice differ diff --git a/tts/voice_packs.mk b/tts/voice_packs.mk new file mode 100644 index 00000000..fbc30500 --- /dev/null +++ b/tts/voice_packs.mk @@ -0,0 +1,33 @@ +# +# Copyright (C) 2022 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. + +# Voice packs for Text-To-Speech +PRODUCT_COPY_FILES += \ + device/google/gs101/tts/ja-jp/ja-jp-x-multi-r29.zvoice:product/tts/google/ja-jp/ja-jp-x-multi-r29.zvoice\ + device/google/gs101/tts/ja-jp/ja-jp-x-multi-darwinn-wavernn-r29.zvoice:product/tts/google/ja-jp/ja-jp-x-multi-darwinn-wavernn-r29.zvoice\ + device/google/gs101/tts/ja-jp/ja-jp-x-multi-wavernn-r29.zvoice:product/tts/google/ja-jp/ja-jp-x-multi-wavernn-r29.zvoice\ + device/google/gs101/tts/fr-fr/fr-fr-x-multi-darwinn-wavernn-r31.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-darwinn-wavernn-r31.zvoice\ + device/google/gs101/tts/fr-fr/fr-fr-x-multi-r31.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-r31.zvoice\ + device/google/gs101/tts/fr-fr/fr-fr-x-multi-seanet-r31.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-seanet-r31.zvoice\ + device/google/gs101/tts/fr-fr/fr-fr-x-multi-wavernn-r31.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-wavernn-r31.zvoice\ + device/google/gs101/tts/de-de/de-de-x-multi-darwinn-wavernn-r31.zvoice:product/tts/google/de-de/de-de-x-multi-darwinn-wavernn-r31.zvoice\ + device/google/gs101/tts/de-de/de-de-x-multi-r31.zvoice:product/tts/google/de-de/de-de-x-multi-r31.zvoice\ + device/google/gs101/tts/de-de/de-de-x-multi-seanet-r31.zvoice:product/tts/google/de-de/de-de-x-multi-seanet-r31.zvoice\ + device/google/gs101/tts/de-de/de-de-x-multi-wavernn-r31.zvoice:product/tts/google/de-de/de-de-x-multi-wavernn-r31.zvoice\ + device/google/gs101/tts/it-it/it-it-x-multi-r27.zvoice:product/tts/google/it-it/it-it-x-multi-r27.zvoice\ + device/google/gs101/tts/es-es/es-es-x-multi-darwinn-wavernn-r31.zvoice:product/tts/google/es-es/es-es-x-multi-darwinn-wavernn-r31.zvoice\ + device/google/gs101/tts/es-es/es-es-x-multi-r31.zvoice:product/tts/google/es-es/es-es-x-multi-r31.zvoice\ + device/google/gs101/tts/es-es/es-es-x-multi-seanet-r31.zvoice:product/tts/google/es-es/es-es-x-multi-seanet-r31.zvoice\ + device/google/gs101/tts/es-es/es-es-x-multi-wavernn-r31.zvoice:product/tts/google/es-es/es-es-x-multi-wavernn-r31.zvoice diff --git a/usb/gadget/UsbGadget.cpp b/usb/gadget/UsbGadget.cpp index 361cefd7..b6d1dd39 100644 --- a/usb/gadget/UsbGadget.cpp +++ b/usb/gadget/UsbGadget.cpp @@ -33,6 +33,12 @@ namespace gadget { namespace V1_2 { namespace implementation { +string enabledPath; +constexpr char kHsi2cPath[] = "/sys/devices/platform/10d50000.hsi2c"; +constexpr char kI2CPath[] = "/sys/devices/platform/10d50000.hsi2c/i2c-"; +constexpr char kAccessoryLimitCurrent[] = "i2c-max77759tcpc/usb_limit_accessory_current"; +constexpr char kAccessoryLimitCurrentEnable[] = "i2c-max77759tcpc/usb_limit_accessory_enable"; + UsbGadget::UsbGadget() : mGadgetIrqPath("") { if (access(OS_DESC_PATH, R_OK) != 0) { ALOGE("configfs setup not done yet"); @@ -380,14 +386,45 @@ V1_0::Status UsbGadget::setupFunctions(uint64_t functions, return Status::SUCCESS; } +Status getI2cBusHelper(string *name) { + DIR *dp; + + dp = opendir(kHsi2cPath); + if (dp != NULL) { + struct dirent *ep; + + while ((ep = readdir(dp))) { + if (ep->d_type == DT_DIR) { + if (string::npos != string(ep->d_name).find("i2c-")) { + std::strtok(ep->d_name, "-"); + *name = std::strtok(NULL, "-"); + } + } + } + closedir(dp); + return Status::SUCCESS; + } + + ALOGE("Failed to open %s", kHsi2cPath); + return Status::ERROR; +} + Return UsbGadget::setCurrentUsbFunctions(uint64_t functions, const sp &callback, uint64_t timeout) { std::unique_lock lk(mLockSetCurrentFunction); + std::string current_usb_power_operation_mode, current_usb_type; + std::string usb_limit_sink_enable; + + string accessoryCurrentLimitEnablePath, accessoryCurrentLimitPath, path; mCurrentUsbFunctions = functions; mCurrentUsbFunctionsApplied = false; + getI2cBusHelper(&path); + accessoryCurrentLimitPath = kI2CPath + path + "/" + kAccessoryLimitCurrent; + accessoryCurrentLimitEnablePath = kI2CPath + path + "/" + kAccessoryLimitCurrentEnable; + // Get the gadget IRQ number before tearDownGadget() if (mGadgetIrqPath.empty()) getUsbGadgetIrqPath(); @@ -435,6 +472,28 @@ Return UsbGadget::setCurrentUsbFunctions(uint64_t functions, } } + if (ReadFileToString(CURRENT_USB_TYPE_PATH, ¤t_usb_type)) + current_usb_type = Trim(current_usb_type); + + if (ReadFileToString(CURRENT_USB_POWER_OPERATION_MODE_PATH, ¤t_usb_power_operation_mode)) + current_usb_power_operation_mode = Trim(current_usb_power_operation_mode); + + if (functions & GadgetFunction::ACCESSORY && + current_usb_type == "Unknown SDP [CDP] DCP" && + (current_usb_power_operation_mode == "default" || + current_usb_power_operation_mode == "1.5A")) { + if (!WriteStringToFile("1300000", accessoryCurrentLimitPath)) { + ALOGI("Write 1.3A to limit current fail"); + } else { + if (!WriteStringToFile("1", accessoryCurrentLimitEnablePath)) { + ALOGI("Enable limit current fail"); + } + } + } else { + if (!WriteStringToFile("0", accessoryCurrentLimitEnablePath)) + ALOGI("unvote accessory limit current failed"); + } + ALOGI("Usb Gadget setcurrent functions called successfully"); return Void(); diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h index f89476d8..8a2f7fdd 100644 --- a/usb/gadget/UsbGadget.h +++ b/usb/gadget/UsbGadget.h @@ -86,6 +86,13 @@ static MonitorFfs monitorFfs(kGadgetName); #define BIG_CORE "6" #define MEDIUM_CORE "4" +#define POWER_SUPPLY_PATH "/sys/class/power_supply/usb/" +#define USB_PORT0_PATH "/sys/class/typec/port0/" + +#define CURRENT_MAX_PATH POWER_SUPPLY_PATH "current_max" +#define CURRENT_USB_TYPE_PATH POWER_SUPPLY_PATH "usb_type" +#define CURRENT_USB_POWER_OPERATION_MODE_PATH USB_PORT0_PATH "power_operation_mode" + struct UsbGadget : public IUsbGadget { UsbGadget(); diff --git a/usb/gadget/android.hardware.usb.gadget-service.gs101.rc b/usb/gadget/android.hardware.usb.gadget-service.gs101.rc index 91b55c63..8fa88680 100644 --- a/usb/gadget/android.hardware.usb.gadget-service.gs101.rc +++ b/usb/gadget/android.hardware.usb.gadget-service.gs101.rc @@ -10,6 +10,8 @@ on post-fs chown root system /sys/class/typec/port0/port_type chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id chown root system /sys/devices/platform/11110000.usb/usb_data_enabled diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp index 7aa4ced0..6cff2f26 100644 --- a/usb/usb/Usb.cpp +++ b/usb/usb/Usb.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,9 @@ constexpr char kHsi2cPath[] = "/sys/devices/platform/10d50000.hsi2c"; constexpr char kI2CPath[] = "/sys/devices/platform/10d50000.hsi2c/i2c-"; constexpr char kContaminantDetectionPath[] = "i2c-max77759tcpc/contaminant_detection"; constexpr char kStatusPath[] = "i2c-max77759tcpc/contaminant_detection_status"; +constexpr char kSinkLimitEnable[] = "i2c-max77759tcpc/usb_limit_sink_enable"; +constexpr char kSourceLimitEnable[] = "i2c-max77759tcpc/usb_limit_source_enable"; +constexpr char kSinkLimitCurrent[] = "i2c-max77759tcpc/usb_limit_sink_current"; constexpr char kTypecPath[] = "/sys/class/typec"; constexpr char kDisableContatminantDetection[] = "vendor.usb.contaminantdisable"; constexpr char kOverheatStatsPath[] = "/sys/devices/platform/google,usbc_port_cooling_dev/"; @@ -68,6 +72,9 @@ constexpr char kThermalZoneForTrip[] = "VIRTUAL-USB-THROTTLING"; constexpr char kThermalZoneForTempReadPrimary[] = "usb_pwr_therm2"; constexpr char kThermalZoneForTempReadSecondary1[] = "usb_pwr_therm"; constexpr char kThermalZoneForTempReadSecondary2[] = "qi_therm"; +constexpr char kPogoUsbActive[] = "/sys/devices/platform/google,pogo/pogo_usb_active"; +constexpr char KPogoMoveDataToUsb[] = "/sys/devices/platform/google,pogo/move_data_to_usb"; +constexpr char kPowerSupplyUsbType[] = "/sys/class/power_supply/usb/usb_type"; constexpr int kSamplingIntervalSec = 5; void queryVersionHelper(android::hardware::usb::Usb *usb, std::vector *currentPortStatus); @@ -76,21 +83,39 @@ ScopedAStatus Usb::enableUsbData(const string& in_portName, bool in_enable, int64_t in_transactionId) { bool result = true; std::vector currentPortStatus; + string pullup; ALOGI("Userspace turn %s USB data signaling. opID:%ld", in_enable ? "on" : "off", in_transactionId); if (in_enable) { - if (!WriteStringToFile("1", USB_DATA_PATH)) { - ALOGE("Not able to turn on usb connection notification"); - result = false; - } + if (!mUsbDataEnabled) { + if (ReadFileToString(PULLUP_PATH, &pullup)) { + pullup = Trim(pullup); + if (pullup != kGadgetName) { + if (!WriteStringToFile(kGadgetName, PULLUP_PATH)) { + ALOGE("Gadget cannot be pulled up"); + result = false; + } + } + } - if (!WriteStringToFile(kGadgetName, PULLUP_PATH)) { - ALOGE("Gadget cannot be pulled up"); - result = false; + if (!WriteStringToFile("1", USB_DATA_PATH)) { + ALOGE("Not able to turn on usb connection notification"); + result = false; + } } } else { + if (ReadFileToString(PULLUP_PATH, &pullup)) { + pullup = Trim(pullup); + if (pullup == kGadgetName) { + if (!WriteStringToFile("none", PULLUP_PATH)) { + ALOGE("Gadget cannot be pulled down"); + result = false; + } + } + } + if (!WriteStringToFile("1", ID_PATH)) { ALOGE("Not able to turn off host mode"); result = false; @@ -105,11 +130,6 @@ ScopedAStatus Usb::enableUsbData(const string& in_portName, bool in_enable, ALOGE("Not able to turn on usb connection notification"); result = false; } - - if (!WriteStringToFile("none", PULLUP_PATH)) { - ALOGE("Gadget cannot be pulled down"); - result = false; - } } if (result) { @@ -130,7 +150,66 @@ ScopedAStatus Usb::enableUsbData(const string& in_portName, bool in_enable, return ScopedAStatus::ok(); } -Status getContaminantDetectionNamesHelper(string *name) { +ScopedAStatus Usb::enableUsbDataWhileDocked(const string& in_portName, + int64_t in_transactionId) { + bool success = true; + bool notSupported = true; + std::vector currentPortStatus; + + ALOGI("Userspace enableUsbDataWhileDocked opID:%ld", in_transactionId); + + int flags = O_RDONLY; + ::android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(KPogoMoveDataToUsb, flags))); + if (fd != -1) { + notSupported = false; + success = WriteStringToFile("1", KPogoMoveDataToUsb); + if (!success) { + ALOGE("Write to move_data_to_usb failed"); + } + } + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyEnableUsbDataWhileDockedStatus( + in_portName, notSupported ? Status::NOT_SUPPORTED : + success ? Status::SUCCESS : Status::ERROR, in_transactionId); + if (!ret.isOk()) + ALOGE("notifyEnableUsbDataStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + queryVersionHelper(this, ¤tPortStatus); + + return ScopedAStatus::ok(); +} + +ScopedAStatus Usb::resetUsbPort(const std::string& in_portName, int64_t in_transactionId) { + bool result = true; + std::vector currentPortStatus; + + ALOGI("Userspace reset USB Port. opID:%ld", in_transactionId); + + if (!WriteStringToFile("none", PULLUP_PATH)) { + ALOGI("Gadget cannot be pulled down"); + result = false; + } + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ::ndk::ScopedAStatus ret = mCallback->notifyResetUsbPortStatus( + in_portName, result ? Status::SUCCESS : Status::ERROR, in_transactionId); + if (!ret.isOk()) + ALOGE("notifyTransactionStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + + return ::ndk::ScopedAStatus::ok(); +} + +Status getI2cBusHelper(string *name) { DIR *dp; dp = opendir(kHsi2cPath); @@ -163,7 +242,7 @@ Status queryMoistureDetectionStatus(std::vector *currentPortStatus) (*currentPortStatus)[0].supportsEnableContaminantPresenceDetection = true; (*currentPortStatus)[0].supportsEnableContaminantPresenceProtection = false; - getContaminantDetectionNamesHelper(&path); + getI2cBusHelper(&path); enabledPath = kI2CPath + path + "/" + kContaminantDetectionPath; if (!ReadFileToString(enabledPath, &enabled)) { ALOGE("Failed to open moisture_detection_enabled"); @@ -402,6 +481,71 @@ ScopedAStatus Usb::switchRole(const string& in_portName, const PortRole& in_role return ScopedAStatus::ok(); } +ScopedAStatus Usb::limitPowerTransfer(const string& in_portName, bool in_limit, + int64_t in_transactionId) { + bool sessionFail = false, success; + std::vector currentPortStatus; + string path, sinkLimitEnablePath, currentLimitPath, sourceLimitEnablePath; + + getI2cBusHelper(&path); + sinkLimitEnablePath = kI2CPath + path + "/" + kSinkLimitEnable; + sourceLimitEnablePath = kI2CPath + path + "/" + kSourceLimitEnable; + currentLimitPath = kI2CPath + path + "/" + kSinkLimitCurrent; + + pthread_mutex_lock(&mLock); + if (in_limit) { + success = WriteStringToFile("0", currentLimitPath); + if (!success) { + ALOGE("Failed to set sink current limit"); + sessionFail = true; + } + } + success = WriteStringToFile(in_limit ? "1" : "0", sinkLimitEnablePath); + if (!success) { + ALOGE("Failed to %s sink current limit: %s", in_limit ? "enable" : "disable", + sinkLimitEnablePath.c_str()); + sessionFail = true; + } + success = WriteStringToFile(in_limit ? "1" : "0", sourceLimitEnablePath); + if (!success) { + ALOGE("Failed to %s source current limit: %s", in_limit ? "enable" : "disable", + sourceLimitEnablePath.c_str()); + sessionFail = true; + } + ALOGI("limitPowerTransfer limit:%c opId:%ld", in_limit ? 'y' : 'n', in_transactionId); + if (mCallback != NULL && in_transactionId >= 0) { + ScopedAStatus ret = mCallback->notifyLimitPowerTransferStatus( + in_portName, in_limit, sessionFail ? Status::ERROR : Status::SUCCESS, + in_transactionId); + if (!ret.isOk()) + ALOGE("limitPowerTransfer error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + + pthread_mutex_unlock(&mLock); + queryVersionHelper(this, ¤tPortStatus); + + return ScopedAStatus::ok(); +} + +Status queryPowerTransferStatus(std::vector *currentPortStatus) { + string limitedPath, enabled, path; + + getI2cBusHelper(&path); + limitedPath = kI2CPath + path + "/" + kSinkLimitEnable; + if (!ReadFileToString(limitedPath, &enabled)) { + ALOGE("Failed to open limit_sink_enable"); + return Status::ERROR; + } + + enabled = Trim(enabled); + (*currentPortStatus)[0].powerTransferLimited = enabled == "1"; + + ALOGI("powerTransferLimited:%d", (*currentPortStatus)[0].powerTransferLimited ? 1 : 0); + return Status::SUCCESS; +} + Status getAccessoryConnected(const string &portName, string *accessory) { string filename = "/sys/class/typec/" + portName + "-partner/accessory_mode"; @@ -568,16 +712,50 @@ Status getPortStatusHelper(android::hardware::usb::Usb *usb, port.second ? canSwitchRoleHelper(port.first) : false; (*currentPortStatus)[i].supportedModes.push_back(PortMode::DRP); - (*currentPortStatus)[i].usbDataEnabled = usb->mUsbDataEnabled; + + bool dataEnabled = true; + string pogoUsbActive = "0"; + if (ReadFileToString(string(kPogoUsbActive), &pogoUsbActive) && + stoi(Trim(pogoUsbActive)) == 1) { + (*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::DISABLED_DOCK); + dataEnabled = false; + } + if (!usb->mUsbDataEnabled) { + (*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::DISABLED_FORCE); + dataEnabled = false; + } + if (dataEnabled) { + (*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::ENABLED); + } + + // When connected return powerBrickStatus + if (port.second) { + string usbType; + if (ReadFileToString(string(kPowerSupplyUsbType), &usbType)) { + if (strstr(usbType.c_str(), "[D")) { + (*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::CONNECTED; + } else if (strstr(usbType.c_str(), "[U")) { + (*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::UNKNOWN; + } else { + (*currentPortStatus)[i].powerBrickStatus = + PowerBrickStatus::NOT_CONNECTED; + } + } else { + ALOGE("Error while reading usb_type"); + } + } else { + (*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::NOT_CONNECTED; + } ALOGI("%d:%s connected:%d canChangeMode:%d canChagedata:%d canChangePower:%d " - "usbDataEnabled:%d", + "usbDataEnabled:%d", i, port.first.c_str(), port.second, (*currentPortStatus)[i].canChangeMode, (*currentPortStatus)[i].canChangeDataRole, (*currentPortStatus)[i].canChangePowerRole, - (*currentPortStatus)[i].usbDataEnabled ? 1 : 0); + dataEnabled ? 1 : 0); } + return Status::SUCCESS; } done: @@ -590,6 +768,7 @@ void queryVersionHelper(android::hardware::usb::Usb *usb, pthread_mutex_lock(&usb->mLock); status = getPortStatusHelper(usb, currentPortStatus); queryMoistureDetectionStatus(currentPortStatus); + queryPowerTransferStatus(currentPortStatus); if (usb->mCallback != NULL) { ScopedAStatus ret = usb->mCallback->notifyPortStatusChange(*currentPortStatus, status); @@ -643,7 +822,6 @@ ScopedAStatus Usb::enableContaminantPresenceDetection(const string& in_portName, return ScopedAStatus::ok(); } - void report_overheat_event(android::hardware::usb::Usb *usb) { VendorUsbPortOverheat overheat_info; string contents; @@ -706,7 +884,11 @@ static void uevent_event(uint32_t /*epevents*/, struct data *payload) { pthread_mutex_unlock(&payload->usb->mPartnerLock); } else if (!strncmp(cp, "DEVTYPE=typec_", strlen("DEVTYPE=typec_")) || !strncmp(cp, "DRIVER=max77759tcpc", - strlen("DRIVER=max77759tcpc"))) { + strlen("DRIVER=max77759tcpc")) || + !strncmp(cp, "DRIVER=pogo-transport", + strlen("DRIVER=pogo-transport")) || + !strncmp(cp, "POWER_SUPPLY_NAME=usb", + strlen("POWER_SUPPLY_NAME=usb"))) { std::vector currentPortStatus; queryVersionHelper(payload->usb, ¤tPortStatus); diff --git a/usb/usb/Usb.h b/usb/usb/Usb.h index 51f9d439..1a93e191 100644 --- a/usb/usb/Usb.h +++ b/usb/usb/Usb.h @@ -65,6 +65,11 @@ struct Usb : public BnUsb { int64_t in_transactionId) override; ScopedAStatus enableUsbData(const string& in_portName, bool in_enable, int64_t in_transactionId) override; + ScopedAStatus enableUsbDataWhileDocked(const string& in_portName, + int64_t in_transactionId) override; + ScopedAStatus limitPowerTransfer(const string& in_portName, bool in_limit, + int64_t in_transactionId) override; + ScopedAStatus resetUsbPort(const string& in_portName, int64_t in_transactionId) override; std::shared_ptr<::aidl::android::hardware::usb::IUsbCallback> mCallback; // Protects mCallback variable @@ -84,7 +89,6 @@ struct Usb : public BnUsb { float mPluggedTemperatureCelsius; // Usb Data status bool mUsbDataEnabled; - private: pthread_t mPoll; }; diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index c842877b..e052f433 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -10,12 +10,60 @@ on post-fs chown root system /sys/class/typec/port0/port_type chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_source_enable chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id chown root system /sys/devices/platform/11110000.usb/usb_data_enabled + chown root system /sys/devices/platform/google,pogo/move_data_to_usb chmod 664 /sys/class/typec/port0/power_role chmod 664 /sys/class/typec/port0/data_role chmod 664 /sys/class/typec/port0/port_type chmod 664 /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess chmod 664 /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id chmod 664 /sys/devices/platform/11110000.usb/usb_data_enabled + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/google,pogo/move_data_to_usb diff --git a/uwb/calibration/init.uwb.calib.sh b/uwb/calibration/init.uwb.calib.sh new file mode 100644 index 00000000..a604885a --- /dev/null +++ b/uwb/calibration/init.uwb.calib.sh @@ -0,0 +1,57 @@ +#!/vendor/bin/sh +if [ -z "$2" ] +then + echo "usage is $0 input-calibration output_calibration" + exit 0 +fi +OUTPUT_CALIB="$2" +if [ ! -f "$OUTPUT_CALIB" ]; then + touch $OUTPUT_CALIB + chmod 0600 $OUTPUT_CALIB + file="$1" + while IFS=, read -r f1 f2 + do + case $f1 in + "UWB_cal_tx_xtal_reg_final_value") + if [ $((0x$f2)) -gt 63 ]; then + f2=63 + fi + echo 'xtal_trim=0x'$f2 >> $OUTPUT_CALIB + ;; + "UWB_TX1RX1_CH5_tx_ant_delay_cal_data") + echo 'ant0.ch5.prf64.ant_delay=0x'$f2 >> $OUTPUT_CALIB + ;; + "UWB_TX1RX1_CH5_rx_ant_delay_cal_data") + echo 'ant1.ch5.prf64.ant_delay=0x'$f2 >> $OUTPUT_CALIB + ;; + "UWB_TX1RX1_CH9_tx_ant_delay_cal_data") + echo 'ant0.ch9.prf64.ant_delay=0x'$f2 >> $OUTPUT_CALIB + ;; + "UWB_TX1RX1_CH9_rx_ant_delay_cal_data") + echo 'ant1.ch9.prf64.ant_delay=0x'$f2 >> $OUTPUT_CALIB + ;; + "UWB_RX2_CH5_cal_pdoa_data") + # float value * 2048 + #/vendor/bin/sh does not support "bc" + base=2048 + ones=${f2%%.*} + dec=${f2#*.} + ones="$(($ones*$base))" + if [ ${#dec} -eq 2 ]; then + dec="$(($dec*$base/100))" + echo 'ant1.ant3.ch5.pdoa_offset='$(($ones+$dec)) >> $OUTPUT_CALIB + fi + ;; + "UWB_RX2_CH9_cal_pdoa_data") + base=2048 + ones=${f2%%.*} + dec=${f2#*.} + ones="$(($ones*$base))" + if [ ${#dec} -eq 2 ]; then + dec="$(($dec*$base/100))" + echo 'ant1.ant3.ch9.pdoa_offset='$(($ones+$dec)) >> $OUTPUT_CALIB + fi + esac + done <"$file" + exit 0 +fi diff --git a/uwb/calibration/init.uwb.calib.xtal.sh b/uwb/calibration/init.uwb.calib.xtal.sh new file mode 100644 index 00000000..efdfd6b0 --- /dev/null +++ b/uwb/calibration/init.uwb.calib.xtal.sh @@ -0,0 +1,25 @@ +#!/vendor/bin/sh +# only use xtal_trim from factory calibration +if [ -z "$2" ] +then + echo "usage is $0 input-calibration output_calibration" + exit 0 +fi +OUTPUT_CALIB="$2" +if [ ! -f "$OUTPUT_CALIB" ]; then + touch $OUTPUT_CALIB + chmod 0644 $OUTPUT_CALIB + file="$1" + while IFS=, read -r f1 f2 + do + case $f1 in + "UWB_cal_tx_xtal_reg_final_value") + if [ $((0x$f2)) -gt 63 ]; then + f2=63 + fi + echo 'xtal_trim=0x'$f2 >> $OUTPUT_CALIB + ;; + esac + done <"$file" + exit 0 +fi diff --git a/uwb/uwb.mk b/uwb/uwb.mk index 72663b41..718a52af 100644 --- a/uwb/uwb.mk +++ b/uwb/uwb.mk @@ -35,7 +35,8 @@ PRODUCT_COPY_FILES += \ $(LOCAL_UWB_CAL_DIR)/UWB-calibration-tj.conf:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-tj.conf \ $(LOCAL_UWB_CAL_DIR)/UWB-calibration-tm.conf:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-tm.conf \ $(LOCAL_UWB_CAL_DIR)/UWB-calibration-ua.conf:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-ua.conf \ - $(LOCAL_UWB_CAL_DIR)/UWB-calibration-uz.conf:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-uz.conf + $(LOCAL_UWB_CAL_DIR)/UWB-calibration-uz.conf:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-uz.conf \ + $(LOCAL_UWB_CAL_DIR)/init.uwb.calib.xtal.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.uwb.calib.sh \ PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.uwb.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/android.hardware.uwb.xml + frameworks/native/data/etc/android.hardware.uwb.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.uwb.xml diff --git a/vendor_dlkm.blocklist b/vendor_dlkm.blocklist deleted file mode 100644 index b259ab6d..00000000 --- a/vendor_dlkm.blocklist +++ /dev/null @@ -1,15 +0,0 @@ -blocklist bcmdhd43752 -blocklist bcmdhd4389 -blocklist cl_dsp -blocklist drv2624 -blocklist ftm5 -blocklist input-cs40l26-i2c -blocklist pktgen -blocklist sec_touch -blocklist snd-soc-cs35l41-i2c -blocklist snd-soc-cs35l41-spi -blocklist st33spi -blocklist st54spi -blocklist uwb_desense.ko -blocklist uwb-hal.ko -blocklist uwbcore.ko diff --git a/wifi/BoardConfig-wifi.mk b/wifi/BoardConfig-wifi.mk new file mode 100644 index 00000000..58a97780 --- /dev/null +++ b/wifi/BoardConfig-wifi.mk @@ -0,0 +1,33 @@ +# +# Copyright (C) 2021 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. +# + +# WiFi +BOARD_WLAN_DEVICE := bcmdhd +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd +WPA_SUPPLICANT_VERSION := VER_0_8_X +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +BOARD_HOSTAPD_DRIVER := NL80211 +# Wifi interface combination - {1 STA + 1 AP} or {1 STA + 1 AP_BRIDGED} or {1 STA + 1 P2P} +# or {1 STA + 1 NAN} or {2 STA} +WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN, AP, AP_BRIDGED}, 1}}, {{{STA}, 2}} +WIFI_FEATURE_WIFI_EXT_HAL := true +WIFI_FEATURE_IMU_DETECTION := true +# Avoid Wifi reset on MAC Address change +WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true +WIFI_FEATURE_HOSTAPD_11AX := true +BOARD_HOSTAPD_CONFIG_80211W_MFP_OPTIONAL := true +