diff --git a/Android.bp b/Android.bp index 57ebe85b..77f50b3a 100644 --- a/Android.bp +++ b/Android.bp @@ -34,3 +34,11 @@ license { "NOTICE", ], } + +prebuilt_etc { + name: "preinstalled-packages-product-gs101-device-debug.xml", + src: "preinstalled-packages-product-gs101-device-debug.xml", + product_specific: true, + sub_dir: "sysconfig", + filename_from_src: true, +} diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index 9be8d92f..7883c20c 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -169,6 +169,7 @@ BOARD_USE_ENC_SW_CSC := true BOARD_SUPPORT_MFC_ENC_RGB := true BOARD_USE_BLOB_ALLOCATOR := false BOARD_SUPPORT_MFC_ENC_BT2020 := true +BOARD_SUPPORT_FLEXIBLE_P010 := true ######################## @@ -220,12 +221,15 @@ $(call soong_config_set,haptics,actuator_model,$(ACTUATOR_MODEL)) # SoundTriggerHAL Configuration #BOARD_USE_SOUNDTRIGGER_HAL := false +# Vibrator HAL actuator model and adaptive haptics configuration +$(call soong_config_set,haptics,actuator_model,$(ACTUATOR_MODEL)) +$(call soong_config_set,haptics,adaptive_haptics_feature,$(ADAPTIVE_HAPTICS_FEATURE)) + # HWComposer BOARD_HWC_VERSION := libhwc2.1 TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := false BOARD_HDMI_INCAPABLE := true TARGET_USES_HWC2 := true -HWC_SKIP_VALIDATE := true HWC_SUPPORT_RENDER_INTENT := true HWC_SUPPORT_COLOR_TRANSFORM := true #BOARD_USES_DISPLAYPORT := true @@ -368,11 +372,11 @@ BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULE BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)) BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE))) -BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load)) +BOARD_VENDOR_KERNEL_MODULES_LOAD += $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load)) ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD $(error vendor_dlkm.modules.load not found or empty) endif -BOARD_VENDOR_KERNEL_MODULES := $(KERNEL_MODULES) +BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES) # Using BUILD_COPY_HEADERS BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true diff --git a/OWNERS b/OWNERS index 4d9cf6e4..68657e89 100644 --- a/OWNERS +++ b/OWNERS @@ -1,2 +1,5 @@ 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 + +# per-file for Pixel device makefiles, see go/pixel-device-mk-owner-checklist for details. +per-file *.mk=file:device/google/gs-common:master:/OWNERS diff --git a/aosp_common.mk b/aosp_common.mk index 5ba98821..d4d8d94a 100644 --- a/aosp_common.mk +++ b/aosp_common.mk @@ -53,3 +53,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk) # TODO: fix # PRODUCT_RESTRICT_VENDOR_FILES := all + +# Exclude features that are not available on AOSP devices. +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/aosp_excluded_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/aosp_excluded_hardware.xml \ No newline at end of file diff --git a/bluetooth/bluetooth.mk b/bluetooth/bluetooth.mk deleted file mode 100644 index f2036106..00000000 --- a/bluetooth/bluetooth.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_PACKAGES += \ - android.hardware.bluetooth@1.1-service.bcmbtlinux - -BOARD_SEPOLICY_DIRS += device/google/gs101-sepolicy/bluetooth diff --git a/conf/init.aoc.daemon.rc b/conf/init.aoc.daemon.rc deleted file mode 100644 index 1cf204e1..00000000 --- a/conf/init.aoc.daemon.rc +++ /dev/null @@ -1 +0,0 @@ -# AoC firmware will be loaded by Daemon \ No newline at end of file diff --git a/conf/init.aoc.nodaemon.rc b/conf/init.aoc.nodaemon.rc deleted file mode 100644 index 329d7d34..00000000 --- a/conf/init.aoc.nodaemon.rc +++ /dev/null @@ -1,3 +0,0 @@ -# Load AoC firmware and boot -on property:vendor.all.modules.ready=1 - write /sys/devices/platform/19000000.aoc/firmware aoc.bin \ No newline at end of file diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc index e3697fcf..16acb952 100644 --- a/conf/init.gs101.rc +++ b/conf/init.gs101.rc @@ -61,6 +61,14 @@ on init 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 + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu1_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu2_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu3_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu4_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu5_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/memlat_cpuidle_state_aware + chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/memlat_cpuidle_state_aware chmod 0220 /proc/vendor_sched/set_task_group_bg chmod 0220 /proc/vendor_sched/set_task_group_cam @@ -170,6 +178,16 @@ on init write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/up_rate_limit_us 500 write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/down_rate_limit_us 20000 + # memlat cpuidle awareness setting + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu1_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu2_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu3_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu4_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu5_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/memlat_cpuidle_state_aware 2 + write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/memlat_cpuidle_state_aware 2 + # RT uclamp setting write /proc/sys/kernel/sched_util_clamp_min_rt_default 0 @@ -243,8 +261,8 @@ on init # Modem temperature driver chown radio system /sys/devices/platform/cp-tm1/cp_temp - # Loading common kernel modules in background - start insmod_sh_common + # insert display module + start init_display # Charge stats (write 0) chown system system /sys/class/power_supply/battery/charge_stats @@ -321,9 +339,6 @@ on init # Power Stats HAL chown system system /dev/bbd_pwrstat - # start watchdogd - start watchdogd - # Add a boost for NNAPI HAL write /proc/vendor_sched/nnapi_prefer_idle 0 write /proc/vendor_sched/nnapi_uclamp_min 512 @@ -346,6 +361,9 @@ on init write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/mem_latency/ratio_ceil 3200 write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/mem_latency/ratio_ceil 3200 + # Set boost_adpf_prio, -1 by default + write /proc/vendor_sched/boost_adpf_prio ${persist.device_config.vendor_system_native_boot.boost_adpf_prio:--1} + on init && property:ro.boot.hw.soc.rev=0 setprop vendor.powerhal.config powerhint_a0.json @@ -409,7 +427,6 @@ on post-fs-data chmod 0664 /sys/devices/platform/1c2c0000.drmdsim/hs_clock chmod 0664 /sys/devices/platform/1c2d0000.drmdsim/hs_clock - setprop vold.post_fs_data_done 1 setprop wifi.direct.interface p2p-dev-wlan0 setprop wifi.aware.interface aware_nmi0 @@ -641,38 +658,6 @@ service abox /vendor/bin/main_abox 17c50000.abox group audioserver seclabel u:r:abox:s0 -# GPS -service lhd /vendor/bin/hw/lhd /vendor/etc/gnss/lhd.conf - class main - user gps - group system inet net_raw sdcard_rw - ioprio be 0 - -service gpsd /vendor/bin/hw/gpsd -c /vendor/etc/gnss/gps.xml - class main - user gps - group system gps radio inet wakelock sdcard_rw net_raw - ioprio be 0 - -service scd /vendor/bin/hw/scd /vendor/etc/gnss/scd.conf - class main - user gps - group system inet net_raw wakelock - ioprio be 0 - -service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-brcm - class hal - user gps - group system gps radio - ioprio be 0 - priority -1 - -# disable gps service if no gps h/w -on property:vendor.ril.cbd.svc=0 - stop gpsd - stop lhd - stop scd - # on userdebug and eng builds, enable kgdb on the serial console on property:ro.debuggable=1 write /sys/module/kgdboc/parameters/kgdboc ttyFIQ1 @@ -734,6 +719,9 @@ on property:sys.boot_completed=1 swapon_all /vendor/etc/fstab.${ro.board.platform} write /proc/sys/vm/swappiness 100 + # Force empty CMA + write /sys/kernel/vendor_mm/cma/farawimg/force_empty 1 + # Back to default VM settings write /proc/sys/vm/dirty_expire_centisecs 3000 write /proc/sys/vm/dirty_background_ratio 10 @@ -748,7 +736,7 @@ on property:sys.boot_completed=1 # Setup final cpuset 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/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-3} 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} @@ -758,15 +746,22 @@ on property:sys.boot_completed=1 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 + + # Set ug group + write /proc/vendor_sched/bg_ug 0 + write /proc/vendor_sched/sysbg_ug 0 + write /proc/vendor_sched/ota_ug 0 + write /proc/vendor_sched/dex2oat_ug 1 + write /proc/vendor_sched/ta_ug 1 + + # Set bg group throttle + write /proc/vendor_sched/ug_bg_group_throttle ${persist.device_config.vendor_system_native.ug_bg_group_throttle:-308} + + # Set uclamp.max for some groups, which could indicate cpu importance used in scheduling write /proc/vendor_sched/bg_uclamp_max 512 - write /dev/cpuctl/background/cpu.uclamp.max 50 write /proc/vendor_sched/sysbg_uclamp_max 512 - write /dev/cpuctl/system-background/cpu.uclamp.max 50 + write /proc/vendor_sched/ota_uclamp_max 512 write /proc/vendor_sched/dex2oat_uclamp_max 615 - write /dev/cpuctl/dex2oat/cpu.uclamp.max 60 - 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 @@ -786,12 +781,6 @@ on property:sys.boot_completed=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 /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 write /dev/cpuctl/system-background/cpu.shares 1024 @@ -841,19 +830,13 @@ on property:persist.sys.test_harness=1 && property:persist.vendor.testing_batte on property:persist.vendor.adaptive.charge.soc=* write /sys/class/power_supply/battery/charge_limit ${persist.vendor.adaptive.charge.soc} -service insmod_sh_common /vendor/bin/init.insmod.sh /vendor/etc/init.insmod.gs101.cfg +service init_display /vendor/bin/init.display.sh class main user root group root system disabled oneshot -# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin -service watchdogd /system/bin/watchdogd 10 20 - class core - oneshot - seclabel u:r:watchdogd:s0 - # bugreport is triggered by holding down volume down, volume up and power service bugreport /system/bin/dumpstate -d -p -z class main @@ -871,6 +854,7 @@ on post-fs-data symlink /mnt/vendor/persist/ss /data/vendor/ss/persist chown root system /data/vendor/ss/persist chmod 0770 /data/vendor/ss/persist + chown system system /data/vendor/ss/persist/nsp restart storageproxyd @@ -913,6 +897,9 @@ on fs on post-fs-data mkdir /data/vendor/powerstats 0771 system system chown system system /data/vendor/powerstats + # Thermal Residency Stats (write 1 to reset) + chown system system /sys/kernel/metrics/thermal/tr_by_group/tmu/stats_reset + chown system system /sys/kernel/metrics/thermal/tr_by_group/spmic/stats_reset on property:vendor.thermal.link_ready=1 # BCL @@ -973,14 +960,23 @@ on property:vendor.thermal.link_ready=1 chown system system /dev/thermal/tz-by-name/usb_pwr_therm2/trip_point_0_temp chown system system /dev/thermal/tz-by-name/usb_pwr_therm2/trip_point_0_hyst chown system system /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp + chmod 664 /dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote + chmod 664 /dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote + chmod 664 /dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote + chmod 664 /dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote chown system system /dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote + chmod 664 /dev/thermal/cdev-by-name/tpu_cooling/user_vote chown system system /dev/thermal/cdev-by-name/tpu_cooling/user_vote + chmod 664 /dev/thermal/cdev-by-name/fcc/cur_state chown system system /dev/thermal/cdev-by-name/fcc/cur_state + chmod 664 /dev/thermal/cdev-by-name/dc_icl/cur_state chown system system /dev/thermal/cdev-by-name/dc_icl/cur_state + chmod 664 /dev/thermal/cdev-by-name/wlc_fcc/cur_state chown system system /dev/thermal/cdev-by-name/wlc_fcc/cur_state + chmod 664 /dev/thermal/cdev-by-name/usbc-port/cur_state chown system system /dev/thermal/cdev-by-name/usbc-port/cur_state on charger @@ -1018,10 +1014,14 @@ on property:persist.device_config.vendor_system_native.top-app_cpuset=* 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} + write /dev/cpuset/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-3} 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} + +# Set esim property for LPA +on property:persist.vendor.modem.esim_profiles_exist=* + setprop persist.modem.esim_profiles_exist ${persist.vendor.modem.esim_profiles_exist} diff --git a/conf/init.gs101.usb.rc b/conf/init.gs101.usb.rc index 6b04012e..110d1b7b 100644 --- a/conf/init.gs101.usb.rc +++ b/conf/init.gs101.usb.rc @@ -71,6 +71,45 @@ on early-boot # acm function for uwb mkdir /config/usb_gadget/g1/functions/acm.uwb0 + # uvc function + mkdir /config/usb_gadget/g1/functions/uvc.0 + write /config/usb_gadget/g1/functions/uvc.0/function_name "Android Webcam" + write /config/usb_gadget/g1/functions/uvc.0/streaming_maxpacket 3072 + # write /config/usb_gadget/g1/functions/uvc.0/streaming_maxburst 5 + # write /config/usb_gadget/g1/functions/uvc.0/streaming_interval 2 + # setup control params + mkdir /config/usb_gadget/g1/functions/uvc.0/control/header/h + symlink /config/usb_gadget/g1/functions/uvc.0/control/header/h /config/usb_gadget/g1/functions/uvc.0/control/class/fs/h + symlink /config/usb_gadget/g1/functions/uvc.0/control/header/h /config/usb_gadget/g1/functions/uvc.0/control/class/ss/h + # advertise 720p resolution for webcam encoded as mjpeg + mkdir /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m + mkdir /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/wHeight 720 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/wWidth 1280 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize 1843200 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwDefaultFrameInterval 333333 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwFrameInterval "166666 +333333 +416666 +666666" + # advertise 1080p resolution for webcam encoded as mjpeg + mkdir /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/wHeight 1080 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/wWidth 1920 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwMaxVideoFrameBufferSize 4147200 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwDefaultFrameInterval 333333 + write /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwFrameInterval "166666 +333333 +416666 +666666" + # TODO: Add uncompressed streams + # setup streaming params + mkdir /config/usb_gadget/g1/functions/uvc.0/streaming/header/h + symlink /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/m + symlink /config/usb_gadget/g1/functions/uvc.0/streaming/header/h /config/usb_gadget/g1/functions/uvc.0/streaming/class/fs/h + symlink /config/usb_gadget/g1/functions/uvc.0/streaming/header/h /config/usb_gadget/g1/functions/uvc.0/streaming/class/hs/h + symlink /config/usb_gadget/g1/functions/uvc.0/streaming/header/h /config/usb_gadget/g1/functions/uvc.0/streaming/class/ss/h + # chown file/folder permission chown system system /config/usb_gadget/ chown system system /config/usb_gadget/g1 @@ -135,6 +174,99 @@ on early-boot chown system system /config/usb_gadget/g1/functions/rndis.gs4/protocol chown system system /config/usb_gadget/g1/functions/rndis.gs4/qmult chown system system /config/usb_gadget/g1/functions/rndis.gs4/subclass + chown system system /config/usb_gadget/g1/functions/uvc.0 + chown system system /config/usb_gadget/g1/functions/uvc.0/control + chown system system /config/usb_gadget/g1/functions/uvc.0/control/bInterfaceNumber + chown system system /config/usb_gadget/g1/functions/uvc.0/control/class + chown system system /config/usb_gadget/g1/functions/uvc.0/control/class/fs + chown system system /config/usb_gadget/g1/functions/uvc.0/control/class/fs/h + chown system system /config/usb_gadget/g1/functions/uvc.0/control/class/ss + chown system system /config/usb_gadget/g1/functions/uvc.0/control/class/ss/h + chown system system /config/usb_gadget/g1/functions/uvc.0/control/header + chown system system /config/usb_gadget/g1/functions/uvc.0/control/header/h + chown system system /config/usb_gadget/g1/functions/uvc.0/control/header/h/bcdUVC + chown system system /config/usb_gadget/g1/functions/uvc.0/control/header/h/dwClockFrequency + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing/default + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing/default/bmControls + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing/default/bSourceID + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing/default/bUnitID + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing/default/iProcessing + chown system system /config/usb_gadget/g1/functions/uvc.0/control/processing/default/wMaxMultiplier + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/bAssocTerminal + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/bmControls + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/bTerminalID + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/iTerminal + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/wObjectiveFocalLengthMax + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/wObjectiveFocalLengthMin + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/wOcularFocalLength + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/camera/default/wTerminalType + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output/default + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output/default/bAssocTerminal + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output/default/bSourceID + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output/default/bTerminalID + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output/default/iTerminal + chown system system /config/usb_gadget/g1/functions/uvc.0/control/terminal/output/default/wTerminalType + chown system system /config/usb_gadget/g1/functions/uvc.0/function_name + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming_interval + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming_maxburst + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming_maxpacket + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/bInterfaceNumber + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class/fs + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class/fs/h + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class/hs + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class/hs/h + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class/ss + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/class/ss/h + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/color_matching + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/color_matching/default + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/color_matching/default/bColorPrimaries + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/color_matching/default/bMatrixCoefficients + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/color_matching/default/bTransferCharacteristics + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/bmInfo + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/bStillCaptureMethod + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/bTerminalLink + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/bTriggerSupport + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/bTriggerUsage + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/header/h/m + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/bFrameIndex + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/bmCapabilities + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwDefaultFrameInterval + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwFrameInterval + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwMaxBitRate + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwMaxVideoFrameBufferSize + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/dwMinBitRate + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/wHeight + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/1080p/wWidth + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/bFrameIndex + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/bmCapabilities + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwDefaultFrameInterval + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwFrameInterval + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwMaxBitRate + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/dwMinBitRate + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/wHeight + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/720p/wWidth + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bAspectRatioX + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bAspectRatioY + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bDefaultFrameIndex + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bFormatIndex + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bmaControls + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bmFlags + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bmInterlaceFlags + chown system system /config/usb_gadget/g1/functions/uvc.0/streaming/uncompressed chown system system /config/usb_gadget/g1/idProduct chown system system /config/usb_gadget/g1/idVendor chown system system /config/usb_gadget/g1/max_speed diff --git a/conf/ueventd.gs101.rc b/conf/ueventd.gs101.rc index a821fd12..5ed8fca1 100644 --- a/conf/ueventd.gs101.rc +++ b/conf/ueventd.gs101.rc @@ -75,8 +75,8 @@ /dev/hdcp2 0660 media media # jpeg -/dev/m2m1shot_jpeg 0660 media media -/dev/video12 0660 cameraserver media +/dev/m2m1shot_jpeg 0660 media media +/dev/video12 0660 system system # audio /dev/seiren 0660 system audio @@ -214,3 +214,9 @@ # Raw HID devices /dev/hidraw* 0660 system system +# sysfs LED nodes for external USB devices +/sys/devices/platform/11110000.usb/11110000.dwc3/xhci-hcd-exynos.5.auto/usb2/2-1/*/*/leds/* brightness 0664 system system +/sys/devices/platform/11110000.usb/11110000.dwc3/xhci-hcd-exynos.5.auto/usb2/2-1/*/*/leds/* multi_intensity 0664 system system +/sys/devices/platform/11110000.usb/11110000.dwc3/xhci-hcd-exynos.4.auto/usb2/2-1/*/*/leds/* brightness 0664 system system +/sys/devices/platform/11110000.usb/11110000.dwc3/xhci-hcd-exynos.4.auto/usb2/2-1/*/*/leds/* multi_intensity 0664 system system + diff --git a/default-permissions.xml b/default-permissions.xml index 425b93f8..3c2063a3 100644 --- a/default-permissions.xml +++ b/default-permissions.xml @@ -82,8 +82,6 @@ - - diff --git a/device.mk b/device.mk index 4a568ef4..8d7d83cc 100644 --- a/device.mk +++ b/device.mk @@ -15,6 +15,22 @@ # include device/google/gs-common/device.mk +include device/google/gs-common/gs_watchdogd/watchdog.mk +include device/google/gs-common/ramdump/ramdump.mk +include device/google/gs-common/soc/soc.mk +include device/google/gs-common/soc/freq.mk +include device/google/gs-common/modem/modem.mk +include device/google/gs-common/aoc/aoc.mk +include device/google/gs-common/thermal/thermal.mk +include device/google/gs-common/pixel_metrics/pixel_metrics.mk +include device/google/gs-common/performance/perf.mk +include device/google/gs-common/display/dump.mk +include device/google/gs101/dumpstate/item.mk +include device/google/gs-common/radio/dump.mk +include device/google/gs-common/gear/dumpstate/aidl.mk +include device/google/gs-common/camera/dump.mk +include device/google/gs-common/gps/dump/log.mk +include device/google/gs-common/widevine/widevine.mk TARGET_BOARD_PLATFORM := gs101 DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false) @@ -35,25 +51,18 @@ 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 \ hardware/google/graphics/common \ + hardware/google/gchips/gralloc4 \ hardware/google/graphics/gs101 \ hardware/google/interfaces \ hardware/google/pixel \ device/google/gs101 \ device/google/gs101/powerstats \ + system/chre/host/hal_generic \ vendor/google/whitechapel/tools \ - vendor/broadcom/bluetooth \ vendor/google/camera \ vendor/google/interfaces \ vendor/google_devices/common/proprietary/confirmatioui_hal \ @@ -106,8 +115,8 @@ endif # From system.property PRODUCT_PROPERTY_OVERRIDES += \ ro.telephony.default_network=27 \ - persist.vendor.ril.use.iccid_to_plmn=1 \ - persist.vendor.ril.emergencynumber.mode=5 + persist.vendor.ril.db_ecc.use.iccid_to_plmn=1 \ + persist.vendor.ril.db_ecc.id.type=5 #rild.libpath=/system/lib64/libsec-ril.so \ #rild.libargs=-d /dev/umts_ipc0 @@ -169,13 +178,10 @@ 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))) # Audio client implementation for RIL USES_GAUDIO := true -endif # ###################### # GRAPHICS - GPU (begin) @@ -205,6 +211,14 @@ PRODUCT_VENDOR_PROPERTIES += \ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ debug.mali.disable_backend_affinity=true +# Mali Configuration Properties +PRODUCT_VENDOR_PROPERTIES += \ + vendor.mali.platform.config=/vendor/etc/mali/platform.config \ + vendor.mali.debug.config=/vendor/etc/mali/debug.config \ + vendor.mali.base_protected_max_core_count=3 \ + vendor.mali.base_protected_tls_max=67108864 \ + vendor.mali.platform_agt_frequency_khz=24576 + ifeq ($(USE_SWIFTSHADER),true) PRODUCT_PACKAGES += \ libGLESv1_CM_swiftshader \ @@ -217,8 +231,8 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.vulkan.version-1_3.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-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 + frameworks/native/data/etc/android.software.vulkan.deqp.level-2023-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \ + frameworks/native/data/etc/android.software.opengles.deqp.level-2023-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml ifeq ($(USE_SWIFTSHADER),true) PRODUCT_VENDOR_PROPERTIES += \ @@ -228,6 +242,11 @@ PRODUCT_VENDOR_PROPERTIES += \ ro.hardware.egl = mali endif +# Configure EGL blobcache +PRODUCT_VENDOR_PROPERTIES += \ + ro.egl.blobcache.multifile=true \ + ro.egl.blobcache.multifile_limit=33554432 \ + PRODUCT_VENDOR_PROPERTIES += \ ro.opengles.version=196610 \ graphics.gpu.profiler.support=true \ @@ -278,15 +297,6 @@ PRODUCT_COPY_FILES += \ device/google/gs101/conf/init.debug.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.debug.rc endif -# If AoC Daemon is not present on this build, load firmware at boot via rc -ifeq ($(wildcard vendor/google/whitechapel/aoc/aocd),) -PRODUCT_COPY_FILES += \ - device/google/gs101/conf/init.aoc.nodaemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.aoc.rc -else -PRODUCT_COPY_FILES += \ - device/google/gs101/conf/init.aoc.daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.aoc.rc -endif - # Recovery files PRODUCT_COPY_FILES += \ device/google/gs101/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.gs101.rc @@ -308,12 +318,10 @@ PRODUCT_COPY_FILES += \ # Shell scripts PRODUCT_COPY_FILES += \ - device/google/gs101/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \ + device/google/gs101/init.display.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.display.sh \ device/google/gs101/disable_contaminant_detection.sh:$(TARGET_COPY_OUT_VENDOR)/bin/hw/disable_contaminant_detection.sh -# insmod files -PRODUCT_COPY_FILES += \ - device/google/gs101/init.insmod.gs101.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/init.insmod.gs101.cfg +include device/google/gs-common/insmod/insmod.mk # For creating dtbo image PRODUCT_HOST_PACKAGES += \ @@ -418,8 +426,8 @@ PRODUCT_COPY_FILES += \ 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 +# Add sensor HAL AIDL product packages +PRODUCT_PACKAGES += android.hardware.sensors-service.multihal # USB HAL PRODUCT_PACKAGES += \ @@ -454,21 +462,6 @@ include hardware/google/pixel/rebalance_interrupts/rebalance_interrupts.mk PRODUCT_PACKAGES += \ android.hardware.power.stats-service.pixel -# dumpstate HAL -PRODUCT_PACKAGES += \ - android.hardware.dumpstate@1.1-service.gs101 - -# AoC support -PRODUCT_PACKAGES += \ - aocd - -# AoC debug support -PRODUCT_PACKAGES_DEBUG += \ - aocdump \ - aocutil \ - aoc_audio_cfg \ - vp_util - # # Audio HALs # @@ -527,11 +520,7 @@ PRODUCT_PACKAGES += \ # WideVine modules PRODUCT_PACKAGES += \ - android.hardware.drm-service.clearkey \ - android.hardware.drm-service.widevine \ - liboemcrypto \ - - + liboemcrypto $(call soong_config_set,google3a_config,soc,gs101) $(call soong_config_set,google3a_config,gcam_awb,true) @@ -558,7 +547,7 @@ endif # WiFi PRODUCT_PACKAGES += \ - android.hardware.wifi@1.0-service \ + android.hardware.wifi-service \ wificond \ libwpa_client \ WifiOverlay \ @@ -573,6 +562,9 @@ PRODUCT_PACKAGES_DEBUG += \ f2fs.fibmap \ dump.f2fs +# Storage dump +include device/google/gs-common/storage/storage.mk + # Storage health HAL PRODUCT_PACKAGES += \ android.hardware.health.storage-service.default @@ -584,12 +576,19 @@ PRODUCT_PACKAGES += \ $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/compression_with_xor.mk) + +# Enable usage of io_uring in fastbootd +PRODUCT_VENDOR_PROPERTIES += sys.usb.ffs.io_uring_enabled=true + # Enforce generic ramdisk allow list $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk) # Titan-M ifeq (,$(filter true, $(BOARD_WITHOUT_DTLS))) -include hardware/google/pixel/dauntless/dauntless.mk +include device/google/gs-common/dauntless/gsc.mk +else +# include dauntless sepolicy to avoid compile error on devices without dauntless +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dauntless/sepolicy endif # Copy Camera HFD Setfiles @@ -623,7 +622,6 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml\ frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml\ vendor/google/services/LyricCameraHAL/src/vendor.android.hardware.camera.preview-dis.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/vendor.android.hardware.camera.preview-dis.xml\ - vendor/google/services/LyricCameraHAL/src/vendor.android.hardware.camera.stream-usecase.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/vendor.android.hardware.camera.stream-usecase.xml\ #PRODUCT_COPY_FILES += \ frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \ @@ -804,15 +802,28 @@ PRODUCT_PACKAGES += \ libopenvx-opencl endif -# GPS HAL +# Location ifeq (,$(filter tangor citron,$(subst _, ,$(TARGET_PRODUCT)))) -include device/google/gs101/gnss/device-gnss.mk +include device/google/gs-common/gps/brcm/device.mk +PRODUCT_COPY_FILES += \ + device/google/gs101/location/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) + PRODUCT_COPY_FILES += \ + device/google/gs101/location/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ + device/google/gs101/location/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf +else + PRODUCT_COPY_FILES += \ + device/google/gs101/location/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ + device/google/gs101/location/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf +endif endif - # Trusty (KM, GK, Storage) $(call inherit-product, system/core/trusty/trusty-storage.mk) $(call inherit-product, system/core/trusty/trusty-base.mk) +# Trusty dump +include device/google/gs-common/trusty/trusty.mk + # Trusty unit test tool PRODUCT_PACKAGES_DEBUG += trusty-ut-ctrl @@ -828,11 +839,6 @@ PRODUCT_PACKAGES += \ PRODUCT_PROPERTY_OVERRIDES += \ ro.frp.pst=/dev/block/by-name/frp -# 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 - # System props to enable Bluetooth Quality Report (BQR) feature ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_PRODUCT_PROPERTIES += \ @@ -860,7 +866,7 @@ PRODUCT_PRODUCT_PROPERTIES += \ # Use FUSE BPF PRODUCT_PRODUCT_PROPERTIES += \ - ro.fuse.bpf.enabled=false + ro.fuse.bpf.enabled=true # Use /product/etc/fstab.postinstall to mount system_other PRODUCT_PRODUCT_PROPERTIES += \ @@ -906,6 +912,7 @@ $(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHA #RCS Test Messaging App PRODUCT_PACKAGES_DEBUG += \ + preinstalled-packages-product-gs101-device-debug.xml \ TestRcsApp PRODUCT_PACKAGES += ShannonRcs @@ -924,6 +931,8 @@ SUPPORT_MULTI_SIM := true SUPPORT_NR := true # Using IRadio 1.6 USE_RADIO_HAL_1_6 := true +# Support SecureElement HAL for HIDL +USE_SE_HIDL := true #$(call inherit-product, vendor/google_devices/telephony/common/device-vendor.mk) #$(call inherit-product, vendor/google_devices/gs101/proprietary/device-vendor.mk) @@ -941,11 +950,7 @@ endif #$(call inherit-product-if-exists, hardware/google_devices/gs101/gs101.mk) #$(call inherit-product-if-exists, vendor/google_devices/common/exynos-vendor.mk) #$(call inherit-product-if-exists, hardware/broadcom/wlan/bcmdhd/firmware/bcm4375/device-bcm.mk) -ifeq ($(wildcard vendor/google/sensors/usf),) -$(call inherit-product-if-exists, vendor/google_devices/gs101/proprietary/usf/usf_product.mk) -else -$(call inherit-product-if-exists, vendor/google/sensors/usf/android/usf_efw_product.mk) -endif +include device/google/gs-common/sensors/sensors.mk $(call inherit-product-if-exists, vendor/google/services/LyricCameraHAL/src/build/device-vendor.mk) $(call inherit-product-if-exists, vendor/google/camera/devices/whi/device-vendor.mk) @@ -999,61 +1004,7 @@ PRODUCT_PACKAGES += \ # Audio # Audio HAL Server & Default Implementations -PRODUCT_PACKAGES += \ - android.hardware.audio.service \ - android.hardware.audio@7.1-impl \ - android.hardware.audio.effect@7.0-impl \ - android.hardware.bluetooth.audio-impl \ - android.hardware.soundtrigger@2.3-impl \ - vendor.google.whitechapel.audio.audioext@4.0-impl - -#Audio HAL libraries -PRODUCT_PACKAGES += \ - audio.primary.$(TARGET_BOARD_PLATFORM) \ - audio.platform.aoc \ - sound_trigger.primary.$(TARGET_BOARD_PLATFORM) \ - audio_bt_aoc \ - audio_tunnel_aoc \ - aoc_aud_ext \ - libaoctuningdecoder \ - libaoc_waves \ - liboffloadeffect \ - audio_waves_aoc \ - audio_fortemedia_aoc \ - audio_bluenote_aoc \ - audio_usb_aoc \ - audio_spk_35l41 \ - audio.usb.default \ - audio.usbv2.default \ - audio.bluetooth.default \ - audio.r_submix.default \ - libamcsextfile \ - audio_amcs_ext \ - - -#Audio Vendor libraries -PRODUCT_PACKAGES += \ - libfvsam_prm_parser \ - libmahalcontroller \ - libAlgFx_HiFi3z - -# AudioHAL Configurations -PRODUCT_COPY_FILES += \ - frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/a2dp_in_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/hearing_aid_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/hearing_aid_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ - -#Audio soong -PRODUCT_SOONG_NAMESPACES += \ - vendor/google/whitechapel/audio/hal \ - vendor/google/whitechapel/audio/interfaces - -$(call soong_config_set,aoc_audio_board,platform,$(TARGET_BOARD_PLATFORM)) +include device/google/gs-common/audio/hidl_gs101.mk ## AoC soong PRODUCT_SOONG_NAMESPACES += \ @@ -1075,12 +1026,6 @@ PRODUCT_PROPERTY_OVERRIDES += \ # PRODUCT_PROPERTY_OVERRIDES += \ # ro.audio.spatializer_enabled=true -ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) -# IAudioMetricExt HIDL -PRODUCT_PACKAGES += \ - vendor.google.audiometricext@1.0-service-vendor -endif - # vndservicemanager and vndservice no longer included in API 30+, however needed by vendor code. # See b/148807371 for reference PRODUCT_PACKAGES += vndservicemanager @@ -1115,7 +1060,12 @@ PRODUCT_PACKAGES += \ include hardware/google/pixel/thermal/device.mk PRODUCT_PROPERTY_OVERRIDES += persist.vendor.enable.thermal.genl=true -include device/google/gs101/edgetpu/edgetpu.mk +# EdgeTPU +include device/google/gs-common/edgetpu/edgetpu.mk +# Config variables for TPU chip on device. +$(call soong_config_set,edgetpu_config,chip,abrolhos) +# TPU firmware +PRODUCT_PACKAGES += edgetpu-abrolhos.fw # Connectivity Thermal Power Manager PRODUCT_PACKAGES += \ @@ -1179,7 +1129,7 @@ PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer # Install product specific framework compatibility matrix # (TODO: b/169535506) This includes the FCM for system_ext and product partition. # It must be split into the FCM of each partition. -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE := device/google/gs101/device_framework_matrix_product.xml +DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs101/device_framework_matrix_product.xml # Preopt SystemUI PRODUCT_DEXPREOPT_SPEED_APPS += SystemUIGoogle # For internal @@ -1200,3 +1150,6 @@ PRODUCT_PROPERTY_OVERRIDES += \ # Call deleteAllKeys if vold detects a factory reset PRODUCT_VENDOR_PROPERTIES += ro.crypto.metadata_init_delete_all_keys.enabled=true + +# Hardware Info Collection +include hardware/google/pixel/HardwareInfo/HardwareInfo.mk diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml index 38ac5d85..4184c3e0 100644 --- a/device_framework_matrix_product.xml +++ b/device_framework_matrix_product.xml @@ -47,6 +47,10 @@ IDebugHost default + + IDebugManager + default + com.google.edgetpu @@ -56,9 +60,17 @@ default + + com.google.edgetpu.dba + 1 + + IDevice + default + + com.google.hardware.pixel.display - 7 + 8 IDisplay default @@ -66,44 +78,12 @@ com.google.input + 2 ITouchContextService default - - hardware.google.bluetooth.bt_channel_avoidance - 1.0 - - IBTChannelAvoidance - default - - - - hardware.google.bluetooth.sar - 1.1 - - IBluetoothSar - default - - - - hardware.google.bluetooth.ext - 1.0 - - IBluetoothExt - default - - - - hardware.google.bluetooth.ccc - hwbinder - 1.1 - - IBluetoothCcc - default - - hardware.qorvo.uwb 2 @@ -136,17 +116,9 @@ default - - vendor.google.whitechapel.audio.audioext - 4.0 - - IAudioExt - default - - - + vendor.google.wifi_ext - 1.3 + 1 IWifiExt default @@ -170,12 +142,4 @@ rilExternal - - vendor.google.audiometricext - 1.0 - - IAudioMetricExt - default - - diff --git a/device_framework_matrix_product_wireless.xml b/device_framework_matrix_product_wireless.xml deleted file mode 100644 index 8b27097c..00000000 --- a/device_framework_matrix_product_wireless.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.wireless_charger - 1.3 - - IWirelessCharger - default - - - diff --git a/dumpstate/Android.bp b/dumpstate/Android.bp new file mode 100644 index 00000000..8acc9e3b --- /dev/null +++ b/dumpstate/Android.bp @@ -0,0 +1,11 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +sh_binary { + name: "dump_gs101.sh", + src: "dump_gs101.sh", + vendor: true, + sub_dir: "dump", +} + diff --git a/dumpstate/Android.mk b/dumpstate/Android.mk deleted file mode 100644 index d9fee2c0..00000000 --- a/dumpstate/Android.mk +++ /dev/null @@ -1,47 +0,0 @@ -# -# Copyright 2016 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. -# - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.dumpstate@1.1-service.gs101 -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE -LOCAL_INIT_RC := android.hardware.dumpstate@1.1-service.gs101.rc -LOCAL_MODULE_RELATIVE_PATH := hw - -LOCAL_SRC_FILES := \ - DumpstateDevice.cpp \ - service.cpp - -LOCAL_SHARED_LIBRARIES := \ - android.hardware.dumpstate@1.0 \ - android.hardware.dumpstate@1.1 \ - libbase \ - libcutils \ - libdumpstateutil \ - libhidlbase \ - libhidltransport \ - libhwbinder \ - liblog \ - libutils - -LOCAL_CFLAGS := -Werror -Wall - -LOCAL_MODULE_TAGS := optional -LOCAL_PROPRIETARY_MODULE := true - -include $(BUILD_EXECUTABLE) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp deleted file mode 100644 index f8ee8e3f..00000000 --- a/dumpstate/DumpstateDevice.cpp +++ /dev/null @@ -1,1307 +0,0 @@ -/* - * Copyright 2016 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 "dumpstate_device" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "DumpstateDevice.h" - -#include "DumpstateUtil.h" - -#define MODEM_LOG_DIRECTORY "/data/vendor/radio/logs/always-on" -#define MODEM_EXTENDED_LOG_DIRECTORY "/data/vendor/radio/extended_logs" -#define MODEM_LOG_HISTORY_DIRECTORY "/data/vendor/radio/logs/history" -#define RIL_LOG_DIRECTORY "/data/vendor/radio" -#define RIL_LOG_DIRECTORY_PROPERTY "persist.vendor.ril.log.base_dir" -#define RIL_LOG_NUMBER_PROPERTY "persist.vendor.ril.log.num_file" -#define MODEM_LOGGING_PERSIST_PROPERTY "persist.vendor.sys.modem.logging.enable" -#define MODEM_LOGGING_PROPERTY "vendor.sys.modem.logging.enable" -#define MODEM_LOGGING_STATUS_PROPERTY "vendor.sys.modem.logging.status" -#define MODEM_LOGGING_NUMBER_BUGREPORT_PROPERTY "persist.vendor.sys.modem.logging.br_num" -#define MODEM_LOGGING_PATH_PROPERTY "vendor.sys.modem.logging.log_path" -#define GPS_LOG_DIRECTORY "/data/vendor/gps/logs" -#define GPS_LOG_NUMBER_PROPERTY "persist.vendor.gps.aol.log_num" -#define GPS_LOGGING_STATUS_PROPERTY "vendor.gps.aol.enabled" - -#define UFS_BOOTDEVICE "ro.boot.bootdevice" - -#define TCPDUMP_LOG_DIRECTORY "/data/vendor/tcpdump_logger/logs" -#define TCPDUMP_NUMBER_BUGREPORT "persist.vendor.tcpdump.log.br_num" -#define TCPDUMP_PERSIST_PROPERTY "persist.vendor.tcpdump.log.alwayson" - -#define HW_REVISION "ro.boot.hardware.revision" - -using android::os::dumpstate::CommandOptions; -using android::os::dumpstate::DumpFileToFd; -using android::os::dumpstate::PropertiesHelper; -using android::os::dumpstate::RunCommandToFd; - -namespace android { -namespace hardware { -namespace dumpstate { -namespace V1_1 { -namespace implementation { - -#define GPS_LOG_PREFIX "gl-" -#define GPS_MCU_LOG_PREFIX "esw-" -#define MODEM_LOG_PREFIX "sbuff_" -#define EXTENDED_LOG_PREFIX "extended_log_" -#define RIL_LOG_PREFIX "rild.log." -#define BUFSIZE 65536 -#define TCPDUMP_LOG_PREFIX "tcpdump" - -typedef std::chrono::time_point timepoint_t; - -const char kVerboseLoggingProperty[] = "persist.vendor.verbose_logging_enabled"; - -void copyFile(std::string srcFile, std::string destFile) { - uint8_t buffer[BUFSIZE]; - ssize_t size; - - int fdSrc = open(srcFile.c_str(), O_RDONLY); - if (fdSrc < 0) { - ALOGD("Failed to open source file %s\n", srcFile.c_str()); - return; - } - - int fdDest = open(destFile.c_str(), O_WRONLY | O_CREAT, 0666); - if (fdDest < 0) { - ALOGD("Failed to open destination file %s\n", destFile.c_str()); - close(fdSrc); - return; - } - - ALOGD("Copying %s to %s\n", srcFile.c_str(), destFile.c_str()); - while ((size = TEMP_FAILURE_RETRY(read(fdSrc, buffer, BUFSIZE))) > 0) { - TEMP_FAILURE_RETRY(write(fdDest, buffer, size)); - } - - close(fdDest); - close(fdSrc); -} - -void dumpLogs(int fd, std::string srcDir, std::string destDir, int maxFileNum, - const char *logPrefix) { - (void) fd; - struct dirent **dirent_list = NULL; - int num_entries = scandir(srcDir.c_str(), - &dirent_list, - 0, - (int (*)(const struct dirent **, const struct dirent **)) alphasort); - if (!dirent_list) { - return; - } else if (num_entries <= 0) { - return; - } - - int copiedFiles = 0; - - for (int i = num_entries - 1; i >= 0; i--) { - ALOGD("Found %s\n", dirent_list[i]->d_name); - - if (0 != strncmp(dirent_list[i]->d_name, logPrefix, strlen(logPrefix))) { - continue; - } - - if ((copiedFiles >= maxFileNum) && (maxFileNum != -1)) { - ALOGD("Skipped %s\n", dirent_list[i]->d_name); - continue; - } - - copiedFiles++; - - std::string srcLogFile = srcDir + "/" + dirent_list[i]->d_name; - std::string destLogFile = destDir + "/" + dirent_list[i]->d_name; - copyFile(srcLogFile, destLogFile); - - ALOGD("Copying %s to %s\n", srcLogFile.c_str(), destLogFile.c_str()); - } - - while (num_entries--) { - free(dirent_list[num_entries]); - } - - free(dirent_list); -} - -void dumpRilLogs(int fd, std::string destDir) { - std::string rilLogDir = - android::base::GetProperty(RIL_LOG_DIRECTORY_PROPERTY, RIL_LOG_DIRECTORY); - - int maxFileNum = android::base::GetIntProperty(RIL_LOG_NUMBER_PROPERTY, 50); - - const std::string currentLogDir = rilLogDir + "/cur"; - const std::string previousLogDir = rilLogDir + "/prev"; - const std::string currentDestDir = destDir + "/cur"; - const std::string previousDestDir = destDir + "/prev"; - - RunCommandToFd(fd, "MKDIR RIL CUR LOG", {"/vendor/bin/mkdir", "-p", currentDestDir.c_str()}, - CommandOptions::WithTimeout(2).Build()); - RunCommandToFd(fd, "MKDIR RIL PREV LOG", {"/vendor/bin/mkdir", "-p", previousDestDir.c_str()}, - CommandOptions::WithTimeout(2).Build()); - - dumpLogs(fd, currentLogDir, currentDestDir, maxFileNum, RIL_LOG_PREFIX); - dumpLogs(fd, previousLogDir, previousDestDir, maxFileNum, RIL_LOG_PREFIX); -} - -void dumpNetmgrLogs(std::string destDir) { - const std::vector netmgrLogs - { - "/data/vendor/radio/metrics_data", - "/data/vendor/radio/omadm_logs.txt", - "/data/vendor/radio/power_anomaly_data.txt", - }; - for (const auto& logFile : netmgrLogs) { - copyFile(logFile, destDir + "/" + basename(logFile.c_str())); - } -} - -/** Dumps last synced NV data into bugreports */ -void dumpModemEFS(std::string destDir) { - const std::string EFS_DIRECTORY = "/mnt/vendor/efs/"; - const std::vector nv_files - { - EFS_DIRECTORY+"nv_normal.bin", - EFS_DIRECTORY+"nv_protected.bin", - }; - for (const auto& logFile : nv_files) { - copyFile(logFile, destDir + "/" + basename(logFile.c_str())); - } -} - -void dumpGpsLogs(int fd, std::string destDir) { - const std::string gpsLogDir = GPS_LOG_DIRECTORY; - const std::string gpsTmpLogDir = gpsLogDir + "/.tmp"; - const std::string gpsDestDir = destDir + "/gps"; - int maxFileNum = android::base::GetIntProperty(GPS_LOG_NUMBER_PROPERTY, 20); - - RunCommandToFd(fd, "MKDIR GPS LOG", {"/vendor/bin/mkdir", "-p", gpsDestDir.c_str()}, - CommandOptions::WithTimeout(2).Build()); - - dumpLogs(fd, gpsTmpLogDir, gpsDestDir, 1, GPS_LOG_PREFIX); - dumpLogs(fd, gpsLogDir, gpsDestDir, 3, GPS_MCU_LOG_PREFIX); - dumpLogs(fd, gpsLogDir, gpsDestDir, maxFileNum, GPS_LOG_PREFIX); -} - -void dumpCameraLogs(int fd, const std::string &destDir) { - static const std::string kCameraLogDir = "/data/vendor/camera/profiler"; - const std::string cameraDestDir = destDir + "/camera"; - RunCommandToFd(fd, "MKDIR CAMERA LOG", {"/vendor/bin/mkdir", "-p", cameraDestDir.c_str()}, - CommandOptions::WithTimeout(2).Build()); - // Attach multiple latest sessions (in case the user is running concurrent - // 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) { - android::base::WriteStringToFd( - "\n" - "------ Section start: " + sectionName + " ------\n" - "\n", fd); - return std::chrono::steady_clock::now(); -} - -void endSection(int fd, const std::string §ionName, timepoint_t startTime) { - auto endTime = std::chrono::steady_clock::now(); - auto elapsedMsec = std::chrono::duration_cast - (endTime - startTime).count(); - - android::base::WriteStringToFd( - "\n" - "------ Section end: " + sectionName + " ------\n" - "Elapsed msec: " + std::to_string(elapsedMsec) + "\n" - "\n", fd); -} - -// If you are adding a single RunCommandToFd() or DumpFileToFd() call, please -// add it to dumpMiscSection(). But if you are adding multiple items that are -// related to each other - for instance, for a Foo peripheral - please add them -// to a new dump function and include it in this table so it can be accessed from the -// command line, e.g.: -// lshal debug android.hardware.dumpstate@1.0::IDumpstateDevice/default foo -// -// However, if your addition generates attachments and/or binary data for the -// bugreport (i.e. if it requires two file descriptors to execute), it must not be -// added to this table and should instead be added to dumpstateBoard() below. - -DumpstateDevice::DumpstateDevice() - : mTextSections{ - { "pre-touch", [this](int fd) { dumpPreTouchSection(fd); } }, - { "soc", [this](int fd) { dumpSocSection(fd); } }, - { "storage", [this](int fd) { dumpStorageSection(fd); } }, - { "memory", [this](int fd) { dumpMemorySection(fd); } }, - { "Devfreq", [this](int fd) { dumpDevfreqSection(fd); } }, - { "cpu", [this](int fd) { dumpCpuSection(fd); } }, - { "power", [this](int fd) { dumpPowerSection(fd); } }, - { "thermal", [this](int fd) { dumpThermalSection(fd); } }, - { "touch", [this](int fd) { dumpTouchSection(fd); } }, - { "display", [this](int fd) { dumpDisplaySection(fd); } }, - { "sensors-usf", [this](int fd) { dumpSensorsUSFSection(fd); } }, - { "aoc", [this](int fd) { dumpAoCSection(fd); } }, - { "ramdump", [this](int fd) { dumpRamdumpSection(fd); } }, - { "misc", [this](int fd) { dumpMiscSection(fd); } }, - { "gsc", [this](int fd) { dumpGscSection(fd); } }, - { "camera", [this](int fd) { dumpCameraSection(fd); } }, - { "trusty", [this](int fd) { dumpTrustySection(fd); } }, - { "modem", [this](int fd) { dumpModemSection(fd); } }, - { "perf-metrics", [this](int fd) { dumpPerfMetricsSection(fd); } }, - } { -} - -// Dump data requested by an argument to the "debug" HAL interface, or help info -// if the specified section is not supported. -void DumpstateDevice::dumpTextSection(int fd, const std::string §ionName) { - bool dumpAll = (sectionName == kAllSections); - - for (const auto §ion : mTextSections) { - if (dumpAll || sectionName == section.first) { - auto startTime = startSection(fd, section.first); - section.second(fd); - endSection(fd, section.first, startTime); - - if (!dumpAll) { - return; - } - } - } - - if (dumpAll) { - return; - } - - // An unsupported section was requested on the command line - android::base::WriteStringToFd("Unrecognized text section: " + sectionName + "\n", fd); - android::base::WriteStringToFd("Try \"" + kAllSections + "\" or one of the following:", fd); - for (const auto §ion : mTextSections) { - android::base::WriteStringToFd(" " + section.first, fd); - } - android::base::WriteStringToFd("\nNote: sections with attachments (e.g. modem) are" - "not avalable from the command line.\n", fd); -} - -// Dump items related to power and battery -void DumpstateDevice::dumpPowerSection(int fd) { - struct stat buffer; - - RunCommandToFd(fd, "Power Stats Times", {"/vendor/bin/sh", "-c", - "echo -n \"Boot: \" && /vendor/bin/uptime -s && " - "echo -n \"Now: \" && date"}); - - RunCommandToFd(fd, "ACPM stats", {"/vendor/bin/sh", "-c", - "for f in /sys/devices/platform/acpm_stats/*_stats ; do " - "echo \"\\n\\n$f\" ; cat $f ; " - "done"}); - - DumpFileToFd(fd, "CPU PM stats", "/sys/devices/system/cpu/cpupm/cpupm/time_in_state"); - - DumpFileToFd(fd, "GENPD summary", "/d/pm_genpd/pm_genpd_summary"); - - DumpFileToFd(fd, "Power supply property battery", "/sys/class/power_supply/battery/uevent"); - DumpFileToFd(fd, "Power supply property dc", "/sys/class/power_supply/dc/uevent"); - DumpFileToFd(fd, "Power supply property gcpm", "/sys/class/power_supply/gcpm/uevent"); - DumpFileToFd(fd, "Power supply property gcpm_pps", "/sys/class/power_supply/gcpm_pps/uevent"); - DumpFileToFd(fd, "Power supply property main-charger", "/sys/class/power_supply/main-charger/uevent"); - DumpFileToFd(fd, "Power supply property pca9486-mains", "/sys/class/power_supply/pca9468-mains/uevent"); - DumpFileToFd(fd, "Power supply property tcpm", "/sys/class/power_supply/tcpm-source-psy-i2c-max77759tcpc/uevent"); - DumpFileToFd(fd, "Power supply property usb", "/sys/class/power_supply/usb/uevent"); - DumpFileToFd(fd, "Power supply property wireless", "/sys/class/power_supply/wireless/uevent"); - if (!stat("/sys/class/power_supply/maxfg", &buffer)) { - DumpFileToFd(fd, "Power supply property maxfg", "/sys/class/power_supply/maxfg/uevent"); - DumpFileToFd(fd, "m5_state", "/sys/class/power_supply/maxfg/m5_model_state"); - DumpFileToFd(fd, "maxfg", "/dev/logbuffer_maxfg"); - DumpFileToFd(fd, "maxfg", "/dev/logbuffer_maxfg_monitor"); - } else { - DumpFileToFd(fd, "Power supply property maxfg_base", "/sys/class/power_supply/maxfg_base/uevent"); - DumpFileToFd(fd, "Power supply property maxfg_flip", "/sys/class/power_supply/maxfg_flip/uevent"); - DumpFileToFd(fd, "m5_state", "/sys/class/power_supply/maxfg_base/m5_model_state"); - DumpFileToFd(fd, "maxfg_base", "/dev/logbuffer_maxfg_base"); - DumpFileToFd(fd, "maxfg_flip", "/dev/logbuffer_maxfg_flip"); - 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"); - } else if (!PropertiesHelper::IsUserBuild()) { - if (!stat("/sys/kernel/debug/tcpm", &buffer)) { - RunCommandToFd(fd, "TCPM logs", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/tcpm/*"}); - } else { - RunCommandToFd(fd, "TCPM logs", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/usb/tcpm*"}); - } - } - - RunCommandToFd(fd, "TCPC", {"/vendor/bin/sh", "-c", - "for f in /sys/devices/platform/10d50000.hsi2c/i2c-*/i2c-max77759tcpc;" - "do echo \"registers:\"; cat $f/registers;" - "echo \"frs:\"; cat $f/frs;" - "echo \"auto_discharge:\"; cat $f/auto_discharge;" - "echo \"bc12_enabled:\"; cat $f/bc12_enabled;" - "echo \"cc_toggle_enable:\"; cat $f/cc_toggle_enable;" - "echo \"contaminant_detection:\"; cat $f/contaminant_detection;" - "echo \"contaminant_detection_status:\"; cat $f/contaminant_detection_status; done"}); - - DumpFileToFd(fd, "PD Engine", "/dev/logbuffer_usbpd"); - DumpFileToFd(fd, "POGO Transport", "/dev/logbuffer_pogo_transport"); - DumpFileToFd(fd, "PPS-google_cpm", "/dev/logbuffer_cpm"); - DumpFileToFd(fd, "PPS-dc", "/dev/logbuffer_pca9468"); - - DumpFileToFd(fd, "Battery Health", "/sys/class/power_supply/battery/health_index_stats"); - DumpFileToFd(fd, "BMS", "/dev/logbuffer_ssoc"); - DumpFileToFd(fd, "TTF", "/dev/logbuffer_ttf"); - 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"); - DumpFileToFd(fd, "TEMP/DOCK-DEFEND", "/dev/logbuffer_bd"); - - RunCommandToFd(fd, "TRICKLE-DEFEND Config", {"/vendor/bin/sh", "-c", - " cd /sys/devices/platform/google,battery/power_supply/battery/;" - " for f in `ls bd_*` ; do echo \"$f: `cat $f`\" ; done"}); - - RunCommandToFd(fd, "DWELL-DEFEND Config", {"/vendor/bin/sh", "-c", - " cd /sys/devices/platform/google,charger/;" - " for f in `ls charge_s*` ; do echo \"$f: `cat $f`\" ; done"}); - - RunCommandToFd(fd, "TEMP-DEFEND Config", {"/vendor/bin/sh", "-c", - " cd /sys/devices/platform/google,charger/;" - " for f in `ls bd_*` ; do echo \"$f: `cat $f`\" ; done"}); - 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", - "for f in /d/maxfg* ; do " - "regs=`cat $f/fg_model`; echo $f: ;" - "echo \"$regs\"; done"}); - - RunCommandToFd(fd, "fg_alo_ver", {"/vendor/bin/sh", "-c", - "for f in /d/maxfg* ; do " - "regs=`cat $f/algo_ver`; echo $f: ;" - "echo \"$regs\"; done"}); - - RunCommandToFd(fd, "fg_model_ok", {"/vendor/bin/sh", "-c", - "for f in /d/maxfg* ; do " - "regs=`cat $f/model_ok`; echo $f: ;" - "echo \"$regs\"; done"}); - - - /* FG Registers */ - RunCommandToFd(fd, "fg registers", {"/vendor/bin/sh", "-c", - "for f in /d/maxfg* ; do " - "regs=`cat $f/registers`; echo $f: ;" - "echo \"$regs\"; done"}); - } - - /* 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 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"); - if (!PropertiesHelper::IsUserBuild()) { - RunCommandToFd(fd, "Google Charger", {"/vendor/bin/sh", "-c", "cd /sys/kernel/debug/google_charger/; " - "for f in `ls pps_*` ; do echo \"$f: `cat $f`\" ; done"}); - RunCommandToFd(fd, "Google Battery", {"/vendor/bin/sh", "-c", "cd /sys/kernel/debug/google_battery/; " - "for f in `ls ssoc_*` ; do echo \"$f: `cat $f`\" ; done"}); - } - - DumpFileToFd(fd, "WLC logs", "/dev/logbuffer_wireless"); - DumpFileToFd(fd, "WLC VER", "/sys/class/power_supply/wireless/device/version"); - DumpFileToFd(fd, "WLC STATUS", "/sys/class/power_supply/wireless/device/status"); - DumpFileToFd(fd, "WLC FW Version", "/sys/class/power_supply/wireless/device/fw_rev"); - DumpFileToFd(fd, "RTX", "/dev/logbuffer_rtx"); - - if (!PropertiesHelper::IsUserBuild()) { - RunCommandToFd(fd, "gvotables", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/gvotables/*/status"}); - } - RunCommandToFd(fd, "Mitigation Stats", {"/vendor/bin/sh", "-c", "echo \"Source\\t\\tCount\\tSOC\\tTime\\tVoltage\"; " - "for f in `ls /sys/devices/virtual/pmic/mitigation/last_triggered_count/*` ; " - "do count=`cat $f`; " - "a=${f/\\/sys\\/devices\\/virtual\\/pmic\\/mitigation\\/last_triggered_count\\//}; " - "b=${f/last_triggered_count/last_triggered_capacity}; " - "c=${f/last_triggered_count/last_triggered_timestamp/}; " - "d=${f/last_triggered_count/last_triggered_voltage/}; " - "cnt=`cat $f`; " - "cap=`cat ${b/count/cap}`; " - "ti=`cat ${c/count/time}`; " - "volt=`cat ${d/count/volt}`; " - "echo \"${a/_count/} " - "\\t$cnt\\t$cap\\t$ti\\t$volt\" ; done"}); - RunCommandToFd(fd, "Clock Divider Ratio", {"/vendor/bin/sh", "-c", "echo \"Source\\t\\tRatio\"; " - "for f in `ls /sys/devices/virtual/pmic/mitigation/clock_ratio/*` ; " - "do ratio=`cat $f`; " - "a=${f/\\/sys\\/devices\\/virtual\\/pmic\\/mitigation\\/clock_ratio\\//}; " - "echo \"${a/_ratio/} \\t$ratio\" ; done"}); - RunCommandToFd(fd, "Clock Stats", {"/vendor/bin/sh", "-c", "echo \"Source\\t\\tStats\"; " - "for f in `ls /sys/devices/virtual/pmic/mitigation/clock_stats/*` ; " - "do stats=`cat $f`; " - "a=${f/\\/sys\\/devices\\/virtual\\/pmic\\/mitigation\\/clock_stats\\//}; " - "echo \"${a/_stats/} \\t$stats\" ; done"}); - RunCommandToFd(fd, "Triggered Level", {"/vendor/bin/sh", "-c", "echo \"Source\\t\\tLevel\"; " - "for f in `ls /sys/devices/virtual/pmic/mitigation/triggered_lvl/*` ; " - "do lvl=`cat $f`; " - "a=${f/\\/sys\\/devices\\/virtual\\/pmic\\/mitigation\\/triggered_lvl\\//}; " - "echo \"${a/_lvl/} \\t$lvl\" ; done"}); - RunCommandToFd(fd, "Instruction", {"/vendor/bin/sh", "-c", - "for f in `ls /sys/devices/virtual/pmic/mitigation/instruction/*` ; " - "do val=`cat $f` ; " - "a=${f/\\/sys\\/devices\\/virtual\\/pmic\\/mitigation\\/instruction\\//}; " - "echo \"$a=$val\" ; done"}); - -} - -// Dump items related to thermal -void DumpstateDevice::dumpThermalSection(int fd) { - RunCommandToFd(fd, "Temperatures", {"/vendor/bin/sh", "-c", - "for f in /sys/class/thermal/thermal* ; do " - "type=`cat $f/type` ; temp=`cat $f/temp` ; echo \"$type: $temp\" ; " - "done"}); - RunCommandToFd(fd, "Cooling Device Current State", {"/vendor/bin/sh", "-c", - "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 " - "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"); - DumpFileToFd(fd, "TMU_TOP fall thresholds:", "/sys/module/gs101_thermal/parameters/tmu_top_reg_dump_fall_thres"); - DumpFileToFd(fd, "TMU_SUB rise thresholds:", "/sys/module/gs101_thermal/parameters/tmu_sub_reg_dump_rise_thres"); - DumpFileToFd(fd, "TMU_SUB fall thresholds:", "/sys/module/gs101_thermal/parameters/tmu_sub_reg_dump_fall_thres"); - DumpFileToFd(fd, "Temperature Residency Metrics:", "/sys/kernel/metrics/temp_residency/temp_residency_all/stats"); -} - -// 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", - "/sys/class/spi_master/spi6/spi6.0", - "/proc/fts_ext/driver_test"}; - const char lsi_spi_path[] = "/sys/devices/virtual/sec/tsp"; - char cmd[256]; - - for (int i = 0; i < 4; i+=2) { - snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i + 1]); - if (!access(cmd, R_OK)) { - snprintf(cmd, sizeof(cmd), "echo A0 01 01 > %s", stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Force Set AP as Bus Owner with Bugreport Flag", - {"/vendor/bin/sh", "-c", cmd}); - } - - snprintf(cmd, sizeof(cmd), "%s/appid", stm_cmd_path[i]); - if (!access(cmd, R_OK)) { - // Touch firmware version - DumpFileToFd(fd, "STM touch firmware version", cmd); - - // Touch controller status - snprintf(cmd, sizeof(cmd), "%s/status", stm_cmd_path[i]); - DumpFileToFd(fd, "STM touch status", cmd); - - // Mutual raw data - snprintf(cmd, sizeof(cmd), - "echo 13 00 01 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", - stm_cmd_path[i], stm_cmd_path[i]); - RunCommandToFd(fd, "Mutual Raw", {"/vendor/bin/sh", "-c", cmd}); - - // Mutual strength data - snprintf(cmd, sizeof(cmd), - "echo 17 01 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", - stm_cmd_path[i], stm_cmd_path[i]); - RunCommandToFd(fd, "Mutual Strength", {"/vendor/bin/sh", "-c", cmd}); - - // Self raw data - snprintf(cmd, sizeof(cmd), - "echo 15 00 01 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", - stm_cmd_path[i], stm_cmd_path[i]); - RunCommandToFd(fd, "Self Raw", {"/vendor/bin/sh", "-c", cmd}); - } - - snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i + 1]); - if (!access(cmd, R_OK)) { - snprintf(cmd, sizeof(cmd), - "echo 01 A4 06 C3 > %s; echo 02 A7 00 00 00 40 00 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "HDM debug information (32 bytes)", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 23 00 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Mutual Raw Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 23 03 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Mutual Baseline Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 23 02 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Mutual Strength Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 24 00 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Self Raw Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 24 03 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Self Baseline Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 24 02 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Self Strength Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 32 10 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Mutual Compensation", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 32 11 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Mutual Low Power Compensation", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 33 12 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Self Compensation", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 34 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Golden Mutual Raw Data", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), "echo 01 FA 20 00 00 24 80 > %s", - stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Packaging Plant - HW reset", - {"/vendor/bin/sh", "-c", cmd}); - snprintf(cmd, sizeof(cmd), "echo 01 FA 20 00 00 68 08 > %s", - stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Packaging Plant - Hibernate Memory", - {"/vendor/bin/sh", "-c", cmd}); - snprintf(cmd, sizeof(cmd), - "echo 02 FB 00 04 3F D8 00 10 01 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Packaging Plant - Read 16 bytes from Address 0x00041FD8", - {"/vendor/bin/sh", "-c", cmd}); - - snprintf(cmd, sizeof(cmd), - "echo 01 A4 06 C3 > %s; echo 02 A7 00 00 00 40 00 > %s && cat %s", - stm_cmd_path[i + 1], stm_cmd_path[i + 1], stm_cmd_path[i + 1]); - RunCommandToFd(fd, "HDM debug information (32 bytes)", - {"/vendor/bin/sh", "-c", cmd}); - } - - snprintf(cmd, sizeof(cmd), "%s/stm_fts_cmd", stm_cmd_path[i]); - if (!access(cmd, R_OK)) { - // ITO raw data - snprintf(cmd, sizeof(cmd), - "echo 01 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", - stm_cmd_path[i], stm_cmd_path[i]); - RunCommandToFd(fd, "ITO Raw", {"/vendor/bin/sh", "-c", cmd}); - } - - snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i + 1]); - if (!access(cmd, R_OK)) { - snprintf(cmd, sizeof(cmd), "echo A0 00 01 > %s", stm_cmd_path[i + 1]); - RunCommandToFd(fd, "Restore Bus Owner", - {"/vendor/bin/sh", "-c", cmd}); - } - } - - if (!access(lsi_spi_path, R_OK)) { - // Enable: force touch active - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "force_touch_active,2,1", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); - - // Firmware info - snprintf(cmd, sizeof(cmd), "%s/fw_version", lsi_spi_path); - DumpFileToFd(fd, "LSI firmware version", cmd); - - // Touch status - snprintf(cmd, sizeof(cmd), "%s/status", lsi_spi_path); - DumpFileToFd(fd, "LSI touch status", cmd); - - // Calibration info - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "get_mis_cal_info", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Calibration info", {"/vendor/bin/sh", "-c", cmd}); - - // Mutual strength - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_delta_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Mutual Strength", {"/vendor/bin/sh", "-c", cmd}); - - // Self strength - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_self_delta_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Self Strength", {"/vendor/bin/sh", "-c", cmd}); - - // TYPE_AMBIENT_DATA - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawdata_read_type,3", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "TYPE_AMBIENT_DATA", {"/vendor/bin/sh", "-c", cmd}); - - // TYPE_DECODED_DATA - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawdata_read_type,5", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "TYPE_DECODED_DATA", {"/vendor/bin/sh", "-c", cmd}); - - // TYPE_OFFSET_DATA_SEC - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawdata_read_type,19", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "TYPE_OFFSET_DATA_SEC", {"/vendor/bin/sh", "-c", cmd}); - - // TYPE_NOI_P2P_MIN - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawdata_read_type,30", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "TYPE_NOI_P2P_MIN", {"/vendor/bin/sh", "-c", cmd}); - - // TYPE_NOI_P2P_MAX - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawdata_read_type,31", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "TYPE_NOI_P2P_MAX", {"/vendor/bin/sh", "-c", cmd}); - - // Raw cap - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawcap_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Mutual Raw Cap", {"/vendor/bin/sh", "-c", cmd}); - - // Self raw cap - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_self_rawcap_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Self Raw Cap", {"/vendor/bin/sh", "-c", cmd}); - - // CM2 - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "run_rawcap_high_freq_read_all", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "CM2", {"/vendor/bin/sh", "-c", cmd}); - - // Disable: force touch active - snprintf(cmd, sizeof(cmd), - "echo %s > %s/cmd && cat %s/cmd_result", - "force_touch_active,2,0", - lsi_spi_path, lsi_spi_path); - RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); - } -} - -// Dump items related to SoC -void DumpstateDevice::dumpSocSection(int fd) { - DumpFileToFd(fd, "AP HW TUNE", "/sys/devices/system/chip-id/ap_hw_tune_str"); - DumpFileToFd(fd, "EVT VERSION", "/sys/devices/system/chip-id/evt_ver"); - DumpFileToFd(fd, "LOT ID", "/sys/devices/system/chip-id/lot_id"); - DumpFileToFd(fd, "PRODUCT ID", "/sys/devices/system/chip-id/product_id"); - DumpFileToFd(fd, "REVISION", "/sys/devices/system/chip-id/revision"); - DumpFileToFd(fd, "RAW STR", "/sys/devices/system/chip-id/raw_str"); -} - -// Dump items related to CPUs -void DumpstateDevice::dumpCpuSection(int fd) { - DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present"); - DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online"); - RunCommandToFd(fd, "CPU time-in-state", {"/vendor/bin/sh", "-c", - "for cpu in /sys/devices/system/cpu/cpu*; do " - "f=$cpu/cpufreq/stats/time_in_state; " - "if [ ! -f $f ]; then continue; fi; " - "echo $f:; cat $f; " - "done"}); - RunCommandToFd(fd, "CPU cpuidle", {"/vendor/bin/sh", "-c", - "for cpu in /sys/devices/system/cpu/cpu*; do " - "for d in $cpu/cpuidle/state*; do " - "if [ ! -d $d ]; then continue; fi; " - "echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; " - "done; " - "done"}); - DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts"); -} - -// Dump items related to Devfreq & BTS -void DumpstateDevice::dumpDevfreqSection(int fd) { - DumpFileToFd(fd, "MIF DVFS", - "/sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/time_in_state"); - DumpFileToFd(fd, "INT DVFS", - "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/time_in_state"); - DumpFileToFd(fd, "INTCAM DVFS", - "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/time_in_state"); - DumpFileToFd(fd, "DISP DVFS", - "/sys/devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp/time_in_state"); - DumpFileToFd(fd, "CAM DVFS", - "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam/time_in_state"); - DumpFileToFd(fd, "TNR DVFS", - "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr/time_in_state"); - DumpFileToFd(fd, "MFC DVFS", - "/sys/devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc/time_in_state"); - DumpFileToFd(fd, "BO DVFS", - "/sys/devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo/time_in_state"); - DumpFileToFd(fd, "BTS stats", "/sys/devices/platform/exynos-bts/bts_stats"); -} - -// Dump items related to memory -void DumpstateDevice::dumpMemorySection(int fd) { - RunCommandToFd(fd, "ION HEAPS", {"/vendor/bin/sh", "-c", - "for d in $(ls -d /d/ion/*); do " - "if [ -f $d ]; then " - "echo --- $d; cat $d; " - "else " - "for f in $(ls $d); do " - "echo --- $d/$f; cat $d/$f; " - "done; " - "fi; " - "done"}); - DumpFileToFd(fd, "dmabuf info", "/d/dma_buf/bufinfo"); - 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 " - "echo --- $d; cat $d; " - "else " - "for f in $(ls $d); do " - "echo --- $d/$f; cat $d/$f; " - "done; " - "fi; " - "done"}); -} - -static void DumpF2FS(int fd) { - DumpFileToFd(fd, "F2FS", "/sys/kernel/debug/f2fs/status"); - RunCommandToFd(fd, "F2FS - fsck time (ms)", {"/vendor/bin/sh", "-c", "getprop ro.boottime.init.fsck.data"}); - RunCommandToFd(fd, "F2FS - checkpoint=disable time (ms)", {"/vendor/bin/sh", "-c", "getprop ro.boottime.init.mount.data"}); -} - -static void DumpUFS(int fd) { - DumpFileToFd(fd, "UFS model", "/sys/block/sda/device/model"); - DumpFileToFd(fd, "UFS rev", "/sys/block/sda/device/rev"); - DumpFileToFd(fd, "UFS size", "/sys/block/sda/size"); - - DumpFileToFd(fd, "UFS Slow IO Read", "/dev/sys/block/bootdevice/slowio_read_cnt"); - DumpFileToFd(fd, "UFS Slow IO Write", "/dev/sys/block/bootdevice/slowio_write_cnt"); - DumpFileToFd(fd, "UFS Slow IO Unmap", "/dev/sys/block/bootdevice/slowio_unmap_cnt"); - DumpFileToFd(fd, "UFS Slow IO Sync", "/dev/sys/block/bootdevice/slowio_sync_cnt"); - - RunCommandToFd(fd, "UFS err_stats", {"/vendor/bin/sh", "-c", - "path=\"/dev/sys/block/bootdevice/err_stats\"; " - "for node in `ls $path/* | grep -v reset_err_status`; do " - "printf \"%s:%d\\n\" $(basename $node) $(cat $node); done;"}); - - - RunCommandToFd(fd, "UFS io_stats", {"/vendor/bin/sh", "-c", - "path=\"/dev/sys/block/bootdevice/io_stats\"; " - "printf \"\\t\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "ReadCnt ReadBytes WriteCnt WriteBytes RWCnt RWBytes; " - "str=$(cat $path/*_start); arr=($str); " - "printf \"Started: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; " - "str=$(cat $path/*_complete); arr=($str); " - "printf \"Completed: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; " - "str=$(cat $path/*_maxdiff); arr=($str); " - "printf \"MaxDiff: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\\n\" " - "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; "}); - - RunCommandToFd(fd, "UFS req_stats", {"/vendor/bin/sh", "-c", - "path=\"/dev/sys/block/bootdevice/req_stats\"; " - "printf \"\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "All Write Read Security Flush Discard; " - "str=$(cat $path/*_min); arr=($str); " - "printf \"Min:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " - "str=$(cat $path/*_max); arr=($str); " - "printf \"Max:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " - "str=$(cat $path/*_avg); arr=($str); " - "printf \"Avg.:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " - "str=$(cat $path/*_sum); arr=($str); " - "printf \"Count:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\\n\" " - "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]};"}); - - std::string ufs_health = "for f in $(find /dev/sys/block/bootdevice/health_descriptor -type f); do if [[ -r $f && -f $f ]]; then echo --- $f; cat $f; echo ''; fi; done"; - RunCommandToFd(fd, "UFS health", {"/vendor/bin/sh", "-c", ufs_health.c_str()}); -} - -// Dump items related to storage -void DumpstateDevice::dumpStorageSection(int fd) { - DumpF2FS(fd); - DumpUFS(fd); -} - -// Dump items related to display -void DumpstateDevice::dumpDisplaySection(int fd) { - // Dump counters for decon drivers - const std::string decon_device_sysfs_path("/sys/class/drm/card0/device/"); - for(int i = 0; i <= 2; ++i){ - const std::string decon_num_str = std::to_string(i); - const std::string decon_counter_path = decon_device_sysfs_path + - "decon" + decon_num_str + - "/counters"; - if (access(decon_counter_path.c_str(), R_OK) == 0){ - DumpFileToFd(fd, "DECON-" + decon_num_str + " counters", - decon_counter_path); - } - else{ - ::android::base::WriteStringToFd("No counters for DECON-" + - decon_num_str + " found at path (" + decon_counter_path + ")\n", - fd); - } - } - DumpFileToFd(fd, "CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event"); - DumpFileToFd(fd, "CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event"); - RunCommandToFd(fd, "libdisplaycolor", {"/vendor/bin/dumpsys", "displaycolor", "-v"}, - CommandOptions::WithTimeout(2).Build()); - DumpFileToFd(fd, "Primary panel extra info", "/sys/devices/platform/exynos-drm/primary-panel/panel_extinfo"); - DumpFileToFd(fd, "secondary panel extra info", "/sys/devices/platform/exynos-drm/secondary-panel/panel_extinfo"); -} - -// Dump items related to AoC -void DumpstateDevice::dumpAoCSection(int fd) { - DumpFileToFd(fd, "AoC Service Status", "/sys/devices/platform/19000000.aoc/services"); - DumpFileToFd(fd, "AoC Restarts", "/sys/devices/platform/19000000.aoc/restart_count"); - DumpFileToFd(fd, "AoC Coredumps", "/sys/devices/platform/19000000.aoc/coredump_count"); - DumpFileToFd(fd, "AoC ring buf wake", "/sys/devices/platform/19000000.aoc/control/ring_buffer_wakeup"); - DumpFileToFd(fd, "AoC host ipc wake", "/sys/devices/platform/19000000.aoc/control/host_ipc_wakeup"); - DumpFileToFd(fd, "AoC usf wake", "/sys/devices/platform/19000000.aoc/control/usf_wakeup"); - DumpFileToFd(fd, "AoC audio wake", "/sys/devices/platform/19000000.aoc/control/audio_wakeup"); - DumpFileToFd(fd, "AoC logging wake", "/sys/devices/platform/19000000.aoc/control/logging_wakeup"); - 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_a32"); - DumpFileToFd(fd, "AoC memory votes", "/sys/devices/platform/19000000.aoc/control/memory_votes_ff1"); - 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()); -} - -// Dump items related to sensors usf. -void DumpstateDevice::dumpSensorsUSFSection(int fd) { - CommandOptions options = CommandOptions::WithTimeout(2).Build(); - RunCommandToFd(fd, "USF statistics", - {"/vendor/bin/sh", "-c", "usf_stats get --all"}, - options); - if (!PropertiesHelper::IsUserBuild()) { - // Not a user build, if this is also not a production device dump the USF registry. - std::string hwRev = android::base::GetProperty(HW_REVISION, ""); - if (hwRev.find("PROTO") != std::string::npos || - hwRev.find("EVT") != std::string::npos || - hwRev.find("DVT") != std::string::npos) { - RunCommandToFd(fd, "USF Registry", - {"/vendor/bin/sh", "-c", "usf_reg_edit save -"}, - options); - RunCommandToFd(fd, "USF Last Stat Buffer", - {"/vendor/bin/sh", "-c", "cat /data/vendor/sensors/debug/stats.history"}, - options); - } - } -} - -// Gzip binary data and dump to fd in base64 format. Cmd to decode is also attached. -void dumpGzippedFileInBase64ToFd(int fd, const char* title, const char* file_path) { - auto cmd = android::base::StringPrintf("echo 'base64 -d <i, header->size, std::string(header->buf, header->i).c_str()), fd); - } else { - android::base::WriteStringToFd("*** Ramdump misc file: abl.log: File not found\n", fd); - } - dumpGzippedFileInBase64ToFd( - fd, "Ramdump misc file: acpm.lst (gzipped in base64)", "/mnt/vendor/ramdump/acpm.lst"); - dumpGzippedFileInBase64ToFd( - fd, "Ramdump misc file: s2d.lst (gzipped in base64)", "/mnt/vendor/ramdump/s2d.lst"); -} - -// Dump items that don't fit well into any other section -void DumpstateDevice::dumpMiscSection(int fd) { - RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); - DumpFileToFd(fd, "VENDOR PROC DUMP", "/proc/vendor_sched/dump_task"); -} - -// Dump items related to GSC -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 -void DumpstateDevice::dumpCameraSection(int fd) { - RunCommandToFd(fd, "Camera HAL Graph State Dump", {"/vendor/bin/sh", "-c", - "for f in $(ls -t /data/vendor/camera/hal_graph_state*.txt |head -1); do " - "echo $f ; cat $f ; done"}, - CommandOptions::WithTimeout(4).Build()); -} - -void DumpstateDevice::dumpTrustySection(int fd) { - DumpFileToFd(fd, "Trusty TEE0 Logs", "/dev/trusty-log0"); -} - -// Dump items related to modem -void DumpstateDevice::dumpModemSection(int fd) { - DumpFileToFd(fd, "Modem Stat", "/data/vendor/modem_stat/debug.txt"); - RunCommandToFd(fd, "Modem SSR history", {"/vendor/bin/sh", "-c", - "for f in $(ls /data/vendor/ssrdump/crashinfo_modem*); do " - "echo $f ; cat $f ; done"}, - CommandOptions::WithTimeout(2).Build()); - RunCommandToFd(fd, "RFSD error log", {"/vendor/bin/sh", "-c", - "for f in $(ls /data/vendor/log/rfsd/rfslog_*); do " - "echo $f ; cat $f ; done"}, - CommandOptions::WithTimeout(2).Build()); -} - -static void *dumpModemThread(void *data) { - std::string modemLogDir = MODEM_LOG_DIRECTORY; - std::string extendedLogDir = MODEM_EXTENDED_LOG_DIRECTORY; - std::string modemLogHistoryDir = MODEM_LOG_HISTORY_DIRECTORY; - std::string tcpdumpLogDir = TCPDUMP_LOG_DIRECTORY; - static const std::string sectionName = "modem"; - - const std::string modemLogCombined = modemLogDir + "/modem_log_all.tar"; - const std::string modemLogAllDir = modemLogDir + "/modem_log"; - - long fdModem = (long)data; - - ALOGD("dumpModemThread started\n"); - - RunCommandToFd(STDOUT_FILENO, "MKDIR MODEM LOG", {"/vendor/bin/mkdir", "-p", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); - - bool modemLogEnabled = android::base::GetBoolProperty(MODEM_LOGGING_PERSIST_PROPERTY, false); - if (modemLogEnabled && android::base::GetProperty(MODEM_LOGGING_PATH_PROPERTY, "") == MODEM_LOG_DIRECTORY) { - bool modemLogStarted = android::base::GetBoolProperty(MODEM_LOGGING_STATUS_PROPERTY, false); - int maxFileNum = android::base::GetIntProperty(MODEM_LOGGING_NUMBER_BUGREPORT_PROPERTY, 100); - - if (modemLogStarted) { - android::base::SetProperty(MODEM_LOGGING_PROPERTY, "false"); - ALOGD("Stopping modem logging...\n"); - } else { - ALOGD("modem logging is not running\n"); - } - - for (int i = 0; i < 15; i++) { - if (!android::base::GetBoolProperty(MODEM_LOGGING_STATUS_PROPERTY, false)) { - ALOGD("modem logging stopped\n"); - sleep(1); - break; - } - sleep(1); - } - - dumpLogs(STDOUT_FILENO, modemLogDir, modemLogAllDir, maxFileNum, MODEM_LOG_PREFIX); - - if (modemLogStarted) { - ALOGD("Restarting modem logging...\n"); - android::base::SetProperty(MODEM_LOGGING_PROPERTY, "true"); - } - } - - if (!PropertiesHelper::IsUserBuild()) { - bool gpsLogEnabled = android::base::GetBoolProperty(GPS_LOGGING_STATUS_PROPERTY, false); - bool tcpdumpEnabled = android::base::GetBoolProperty(TCPDUMP_PERSIST_PROPERTY, false); - bool cameraLogsEnabled = android::base::GetBoolProperty( - "vendor.camera.debug.camera_performance_analyzer.attach_to_bugreport", true); - - if (tcpdumpEnabled) { - dumpLogs(STDOUT_FILENO, tcpdumpLogDir, modemLogAllDir, android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX); - } - - if (gpsLogEnabled) { - dumpGpsLogs(STDOUT_FILENO, modemLogAllDir); - } else { - ALOGD("gps logging is not running\n"); - } - - if (cameraLogsEnabled) { - dumpCameraLogs(STDOUT_FILENO, modemLogAllDir); - } - - dumpLogs(STDOUT_FILENO, extendedLogDir, modemLogAllDir, 50, EXTENDED_LOG_PREFIX); - dumpLogs(STDOUT_FILENO, modemLogHistoryDir, modemLogAllDir, 2, "Logging"); - dumpRilLogs(STDOUT_FILENO, modemLogAllDir); - dumpNetmgrLogs(modemLogAllDir); - dumpModemEFS(modemLogAllDir); - } - - ALOGD("Going to compress logs\n"); - - RunCommandToFd(STDOUT_FILENO, "TAR LOG", {"/vendor/bin/tar", "cvf", modemLogCombined.c_str(), "-C", modemLogAllDir.c_str(), "."}, CommandOptions::WithTimeout(25).Build()); - RunCommandToFd(STDOUT_FILENO, "CHG PERM", {"/vendor/bin/chmod", "a+w", modemLogCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); - - std::vector buffer(65536); - android::base::unique_fd fdLog(TEMP_FAILURE_RETRY(open(modemLogCombined.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK))); - - ALOGD("Going to write to dumpstate board binary\n"); - if (fdLog >= 0) { - while (1) { - ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fdLog, buffer.data(), buffer.size())); - - if (bytes_read == 0) { - break; - } else if (bytes_read < 0) { - ALOGD("read(%s): %s\n", modemLogCombined.c_str(), strerror(errno)); - break; - } - - ssize_t result = TEMP_FAILURE_RETRY(write(fdModem, buffer.data(), bytes_read)); - - if (result != bytes_read) { - ALOGD("Failed to write %ld bytes, actually written: %ld", bytes_read, result); - break; - } - } - } - - ALOGD("Going to remove logs\n"); - - RunCommandToFd(STDOUT_FILENO, "RM MODEM DIR", { "/vendor/bin/rm", "-r", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); - RunCommandToFd(STDOUT_FILENO, "RM LOG", { "/vendor/bin/rm", modemLogCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); - - ALOGD("dumpModemThread finished\n"); - - return NULL; -} - -void DumpstateDevice::dumpPerfMetricsSection(int fd) { - DumpFileToFd(fd, "Long running IRQ metrics", "/sys/kernel/metrics/irq/long_irq_metrics"); - DumpFileToFd(fd, "Resume latency metrics", "/sys/kernel/metrics/resume_latency/resume_latency_metrics"); -} - -// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow. -Return DumpstateDevice::dumpstateBoard(const hidl_handle &handle) { -// Ignore return value, just return an empty status. - dumpstateBoard_1_1(handle, DumpstateMode::DEFAULT, 30 * 1000 /* timeoutMillis */); - return Void(); -} - -// Methods from ::android::hardware::dumpstate::V1_1::IDumpstateDevice follow. -Return DumpstateDevice::dumpstateBoard_1_1(const hidl_handle& handle, - const DumpstateMode mode, - const uint64_t timeoutMillis) { - // Unused arguments. - (void) timeoutMillis; - - if (handle == nullptr || handle->numFds < 1) { - ALOGE("no FDs\n"); - return DumpstateStatus::ILLEGAL_ARGUMENT; - } - - int fd = handle->data[0]; - if (fd < 0) { - ALOGE("invalid FD: %d\n", handle->data[0]); - return DumpstateStatus::ILLEGAL_ARGUMENT; - } - - if (mode == DumpstateMode::WEAR) { - // We aren't a Wear device. - ALOGE("Unsupported mode: %d\n", mode); - return DumpstateStatus::UNSUPPORTED_MODE; - } else if (mode < DumpstateMode::FULL || mode > DumpstateMode::PROTO) { - ALOGE("Invalid mode: %d\n", mode); - return DumpstateStatus::ILLEGAL_ARGUMENT; - } - - // Create thread to collect modem related logs - pthread_t modemThreadHandle = 0; - if (getVerboseLoggingEnabled()) { - if (handle->numFds < 2) { - ALOGE("no FD for modem\n"); - } else { - int fdModem = handle->data[1]; - if (pthread_create(&modemThreadHandle, NULL, dumpModemThread, (void *)((long)fdModem)) != 0) { - ALOGE("could not create thread for dumpModem\n"); - } - } - } else { - ALOGD("Verbose logging is not enabled\n"); - } - - dumpTextSection(fd, kAllSections); - - if (modemThreadHandle) { - pthread_join(modemThreadHandle, NULL); - } - - return DumpstateStatus::OK; -} - -Return DumpstateDevice::setVerboseLoggingEnabled(const bool enable) { - ::android::base::SetProperty(kVerboseLoggingProperty, enable ? "true" : "false"); - return Void(); -} - -Return DumpstateDevice::getVerboseLoggingEnabled() { - return ::android::base::GetBoolProperty(kVerboseLoggingProperty, false); -} - -// Since HALs that support the debug() interface are automatically invoked during -// bugreport generation and we don't want to generate a second copy of the same -// data that will go into dumpstate_board.txt, this function will only do -// something if it is called with an option, e.g. -// lshal debug android.hardware.dumpstate@1.0::IDumpstateDevice/default all -// -// Also, note that sections which generate attachments and/or binary data when -// included in a bugreport are not available through the debug() interface. -Return DumpstateDevice::debug(const hidl_handle &handle, const hidl_vec &args) { - // Exit when dump is completed since this is a lazy HAL. - addPostCommandTask([]() { - exit(0); - }); - - if (handle == nullptr || handle->numFds < 1 || args.size() != 1) { - return Void(); - } - - int fd = handle->data[0]; - dumpTextSection(fd, static_cast(args[0])); - - fsync(fd); - return Void(); -} - - -} // namespace implementation -} // namespace V1_1 -} // namespace dumpstate -} // namespace hardware -} // namespace android diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h deleted file mode 100644 index f42ec198..00000000 --- a/dumpstate/DumpstateDevice.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ -#ifndef ANDROID_HARDWARE_DUMPSTATE_V1_1_DUMPSTATEDEVICE_H -#define ANDROID_HARDWARE_DUMPSTATE_V1_1_DUMPSTATEDEVICE_H - -#include -#include -#include -#include - -namespace android { -namespace hardware { -namespace dumpstate { -namespace V1_1 { -namespace implementation { - -using ::android::hardware::dumpstate::V1_1::DumpstateMode; -using ::android::hardware::dumpstate::V1_1::DumpstateStatus; -using ::android::hardware::dumpstate::V1_1::IDumpstateDevice; -using ::android::hardware::hidl_handle; -using ::android::hardware::hidl_string; -using ::android::hardware::hidl_vec; -using ::android::hardware::Return; - -struct DumpstateDevice : public IDumpstateDevice { - public: - DumpstateDevice(); - - // Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow. - Return dumpstateBoard(const hidl_handle& h) override; - - // Methods from ::android::hardware::dumpstate::V1_1::IDumpstateDevice follow. - Return dumpstateBoard_1_1(const hidl_handle& h, - const DumpstateMode mode, - const uint64_t timeoutMillis) override; - Return setVerboseLoggingEnabled(const bool enable) override; - Return getVerboseLoggingEnabled() override; - - // Methods from ::android::hidl::base::V1_0::IBase follow. - Return debug(const hidl_handle &fd, const hidl_vec &args) override; - - private: - const std::string kAllSections = "all"; - - std::vector>> mTextSections; - - void dumpTextSection(int fd, std::string const& sectionName); - - // Text sections that can be dumped individually on the command line in - // addition to being included in full dumps - void dumpPowerSection(int fd); - void dumpThermalSection(int fd); - void dumpPreTouchSection(int fd); - void dumpTouchSection(int fd); - void dumpSocSection(int fd); - void dumpCpuSection(int fd); - void dumpDevfreqSection(int fd); - void dumpMemorySection(int fd); - void dumpStorageSection(int fd); - void dumpDisplaySection(int fd); - void dumpSensorsUSFSection(int fd); - void dumpAoCSection(int fd); - void dumpRamdumpSection(int fd); - void dumpMiscSection(int fd); - void dumpGscSection(int fd); - void dumpCameraSection(int fd); - void dumpTrustySection(int fd); - void dumpModemSection(int fd); - void dumpPerfMetricsSection(int fd); -}; - -} // namespace implementation -} // namespace V1_0 -} // namespace dumpstate -} // namespace hardware -} // namespace android - -#endif // ANDROID_HARDWARE_DUMPSTATE_V1_1_DUMPSTATEDEVICE_H diff --git a/dumpstate/OWNERS b/dumpstate/OWNERS index c6adf312..233e1058 100644 --- a/dumpstate/OWNERS +++ b/dumpstate/OWNERS @@ -7,4 +7,4 @@ cyanhsieh@google.com rogerliao@google.com cyuanjen@google.com robinpeng@google.com - +pattjin@google.com diff --git a/dumpstate/android.hardware.dumpstate@1.1-service.gs101.rc b/dumpstate/android.hardware.dumpstate@1.1-service.gs101.rc deleted file mode 100644 index 6be0278b..00000000 --- a/dumpstate/android.hardware.dumpstate@1.1-service.gs101.rc +++ /dev/null @@ -1,6 +0,0 @@ -service vendor.dumpstate-1-1 /vendor/bin/hw/android.hardware.dumpstate@1.1-service.gs101 - class hal - user system - group system - interface android.hardware.dumpstate@1.0::IDumpstateDevice default - interface android.hardware.dumpstate@1.1::IDumpstateDevice default diff --git a/dumpstate/dump_gs101.sh b/dumpstate/dump_gs101.sh new file mode 100644 index 00000000..e6fdb015 --- /dev/null +++ b/dumpstate/dump_gs101.sh @@ -0,0 +1,311 @@ +#!/vendor/bin/sh +echo "------ Camera HAL Graph State Dump ------" +for f in $(ls -t /data/vendor/camera/hal_graph_state*.txt |head -1); do + echo $f + cat $f +done + +build_type="$(getprop ro.build.type)" + +echo "\n------ Power Stats Times ------" +echo -n "Boot: " && /vendor/bin/uptime -s && echo -n "Now: " && date; + +echo "\n------ ACPM stats ------" +for f in /sys/devices/platform/acpm_stats/*_stats ; do + echo "\n\n$f" + cat $f +done + +echo "\n------ CPU PM stats ------" +cat "/sys/devices/system/cpu/cpupm/cpupm/time_in_state" + +echo "\n------ GENPD summary ------" +cat "/d/pm_genpd/pm_genpd_summary" + +echo "\n------ Power supply property battery ------" +cat "/sys/class/power_supply/battery/uevent" +echo "\n------ Power supply property dc ------" +cat "/sys/class/power_supply/dc/uevent" +echo "\n------ Power supply property gcpm ------" +cat "/sys/class/power_supply/gcpm/uevent" +echo "\n------ Power supply property gcpm_pps ------" +cat "/sys/class/power_supply/gcpm_pps/uevent" +echo "\n------ Power supply property main-charger ------" +cat "/sys/class/power_supply/main-charger/uevent" +echo "\n------ Power supply property pca9486-mains ------" +cat "/sys/class/power_supply/pca9468-mains/uevent" +echo "\n------ Power supply property tcpm ------" +cat "/sys/class/power_supply/tcpm-source-psy-i2c-max77759tcpc/uevent" +echo "\n------ Power supply property usb ------" +cat "/sys/class/power_supply/usb/uevent" +echo "\n------ Power supply property wireless ------" +cat "/sys/class/power_supply/wireless/uevent" + +if [ -d "/sys/class/power_supply/maxfg" ] +then + echo "\n------ Power supply property maxfg ------" + cat "/sys/class/power_supply/maxfg/uevent" + echo "\n------ m5_state ------" + cat "/sys/class/power_supply/maxfg/m5_model_state" + echo "\n------ maxfg ------" + cat "/dev/logbuffer_maxfg" + echo "\n------ maxfg ------" + cat "/dev/logbuffer_maxfg_monitor" +else + echo "\n------ Power supply property maxfg_base ------" + cat "/sys/class/power_supply/maxfg_base/uevent" + echo "\n------ Power supply property maxfg_flip ------" + cat "/sys/class/power_supply/maxfg_flip/uevent" + echo "\n------ m5_state ------" + cat "/sys/class/power_supply/maxfg_base/m5_model_state" + echo "\n------ maxfg_base ------" + cat "/dev/logbuffer_maxfg_base" + echo "\n------ maxfg_flip ------" + cat "/dev/logbuffer_maxfg_flip" + echo "\n------ maxfg_base ------" + cat "/dev/logbuffer_maxfg_base_monitor" + echo "\n------ maxfg_flip ------" + cat "/dev/logbuffer_maxfg_flip_monitor" +fi + +if [ -d "/sys/class/power_supply/dock" ] +then + echo "\n------ Power supply property dock ------" + cat "/sys/class/power_supply/dock/uevent" +fi + +if [ -e "/dev/logbuffer_tcpm" ] +then + echo "\n------ Logbuffer TCPM ------" + cat "/dev/logbuffer_tcpm" + if [ -d "/sys/kernel/debug/tcpm" ] + then + echo "\n------ TCPM logs ------" + cat /sys/kernel/debug/tcpm/* + else + echo "\n------ TCPM logs ------" + cat /sys/kernel/debug/usb/tcpm* + fi +fi + +echo "\n------ TCPC ------" +for f in /sys/devices/platform/10d50000.hsi2c/i2c-*/i2c-max77759tcpc +do + echo "registers:" + cat $f/registers + echo "frs:" + cat $f/frs + echo "auto_discharge:" + cat $f/auto_discharge + echo "bc12_enabled:" + cat $f/bc12_enabled + echo "cc_toggle_enable:" + cat $f/cc_toggle_enable + echo "contaminant_detection:" + cat $f/contaminant_detection + echo "contaminant_detection_status:" + cat $f/contaminant_detection_status +done + +echo "\n------ PD Engine ------" +cat "/dev/logbuffer_usbpd" +echo "\n------ POGO Transport ------" +cat "/dev/logbuffer_pogo_transport" +echo "\n------ PPS-google_cpm ------" +cat "/dev/logbuffer_cpm" +echo "\n------ PPS-dc ------" +cat "/dev/logbuffer_pca9468" + +echo "\n------ Battery Health ------" +cat "/sys/class/power_supply/battery/health_index_stats" +echo "\n------ BMS ------" +cat "/dev/logbuffer_ssoc" +echo "\n------ TTF ------" +cat "/dev/logbuffer_ttf" +echo "\n------ TTF details ------" +cat "/sys/class/power_supply/battery/ttf_details" +echo "\n------ TTF stats ------" +cat "/sys/class/power_supply/battery/ttf_stats" +echo "\n------ maxq ------" +cat "/dev/logbuffer_maxq" +echo "\n------ aacr_state ------" +cat "/sys/class/power_supply/battery/aacr_state" +echo "\n------ TEMP/DOCK-DEFEND ------" +cat "/dev/logbuffer_bd" + +echo "\n------ TRICKLE-DEFEND Config ------" +cd /sys/devices/platform/google,battery/power_supply/battery/ +for f in `ls bd_*` +do + echo $f: `cat $f` +done + +echo "\n------ DWELL-DEFEND Config ------" +cd /sys/devices/platform/google,charger/ +for f in `ls charge_s*` +do + echo "$f: `cat $f`" +done + +echo "\n------ TEMP-DEFEND Config ------" +cd /sys/devices/platform/google,charger/ +for f in `ls bd_*` +do + echo "$f: `cat $f`" +done + +if [ $build_type = "userdebug" ] +then + echo "\n------ DC_registers dump ------" + cat "/sys/class/power_supply/pca9468-mains/device/registers_dump" + echo "\n------ max77759_chg registers dump ------" + cat "/d/max77759_chg/registers" + echo "\n------ max77729_pmic registers dump ------" + cat "/d/max77729_pmic/registers" + echo "\n------ Charging table dump ------" + cat "/d/google_battery/chg_raw_profile" + + echo "\n------ fg_model ------" + for f in /d/maxfg* + do + regs=`cat $f/fg_model` + echo $f: + echo "$regs" + done + + echo "\n------ fg_alo_ver ------" + for f in /d/maxfg* + do + regs=`cat $f/algo_ver` + echo $f: + echo "$regs" + done + + echo "\n------ fg_model_ok ------" + for f in /d/maxfg* + do + regs=`cat $f/model_ok` + echo $f: + echo "$regs" + done + + echo "\n------ fg registers ------" + for f in /d/maxfg* + do + regs=`cat $f/registers` + echo $f: + echo "$regs" + done +fi + +echo "\n------ Battery EEPROM ------" +if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom" ] +then + xxd /sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom +fi + +if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom" ] +then + xxd /sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom +fi + +if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom" ] +then + xxd /sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom +fi + +if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom" ] +then + xxd /sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom +fi + +if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom" ] +then + xxd /sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom +fi + +echo "\n------ Charger Stats ------" +cat "/sys/class/power_supply/battery/charge_details" +if [ $build_type = "userdebug" ] +then + echo "\n------ Google Charger ------" + cd /sys/kernel/debug/google_charger/ + for f in `ls pps_*` + do + echo "$f: `cat $f`" + done + echo "\n------ Google Battery ------" + cd /sys/kernel/debug/google_battery/ + for f in `ls ssoc_*` + do + echo "$f: `cat $f`" + done +fi + +echo "\n------ WLC logs ------" +cat "/dev/logbuffer_wireless" +echo "\n------ WLC VER ------" +cat "/sys/class/power_supply/wireless/device/version" +echo "\n------ WLC STATUS ------" +cat "/sys/class/power_supply/wireless/device/status" +echo "\n------ WLC FW Version ------" +cat "/sys/class/power_supply/wireless/device/fw_rev" +echo "\n------ RTX ------" +cat "/dev/logbuffer_rtx" + +if [ $build_type = "userdebug" ] +then + echo "\n------ gvotables ------" + cat /sys/kernel/debug/gvotables/*/status +fi + +echo "\n------ Mitigation Stats ------" +echo "Source\t\tCount\tSOC\tTime\tVoltage" +for f in `ls /sys/devices/virtual/pmic/mitigation/last_triggered_count/*` +do + count=`cat $f` + a=${f/\/sys\/devices\/virtual\/pmic\/mitigation\/last_triggered_count\//} + b=${f/last_triggered_count/last_triggered_capacity} + c=${f/last_triggered_count/last_triggered_timestamp/} + d=${f/last_triggered_count/last_triggered_voltage/} + cnt=`cat $f` + cap=`cat ${b/count/cap}` + ti=`cat ${c/count/time}` + volt=`cat ${d/count/volt}` + echo "${a/_count/} \t$cnt\t$cap\t$ti\t$volt" +done + +echo "\n------ Clock Divider Ratio ------" +echo \"Source\t\tRatio\" +for f in `ls /sys/devices/virtual/pmic/mitigation/clock_ratio/*` +do ratio=`cat $f` + a=${f/\/sys\/devices\/virtual\/pmic\/mitigation\/clock_ratio\//} + echo "${a/_ratio/} \t$ratio" +done + +echo "\n------ Clock Stats ------" +echo "Source\t\tStats" +for f in `ls /sys/devices/virtual/pmic/mitigation/clock_stats/*` +do + stats=`cat $f` + a=${f/\/sys\/devices\/virtual\/pmic\/mitigation\/clock_stats\//}; + echo "${a/_stats/} \t$stats" +done + +echo "\n------ Triggered Level ------" +echo "Source\t\tLevel" +for f in `ls /sys/devices/virtual/pmic/mitigation/triggered_lvl/*` +do + lvl=`cat $f` + a=${f/\/sys\/devices\/virtual\/pmic\/mitigation\/triggered_lvl\//} + echo "${a/_lvl/} \t$lvl" +done + +echo "\n------ Instruction ------" +for f in `ls /sys/devices/virtual/pmic/mitigation/instruction/*` +do + val=`cat $f` + a=${f/\/sys\/devices\/virtual\/pmic\/mitigation\/instruction\//} + echo "$a=$val" +done + diff --git a/dumpstate/item.mk b/dumpstate/item.mk new file mode 100644 index 00000000..7a1d2ba0 --- /dev/null +++ b/dumpstate/item.mk @@ -0,0 +1,2 @@ +PRODUCT_PACKAGES += dump_gs101.sh + diff --git a/dumpstate/service.cpp b/dumpstate/service.cpp deleted file mode 100644 index 47172311..00000000 --- a/dumpstate/service.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2016 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 "android.hardware.dumpstate@1.0-service.gs101" - -#include -#include - -#include "DumpstateDevice.h" - -using ::android::hardware::configureRpcThreadpool; -using ::android::hardware::dumpstate::V1_1::IDumpstateDevice; -using ::android::hardware::dumpstate::V1_1::implementation::DumpstateDevice; -using ::android::hardware::joinRpcThreadpool; -using ::android::sp; - - -int main(int /* argc */, char* /* argv */ []) { - sp dumpstate = new DumpstateDevice; - configureRpcThreadpool(1, true); - - android::status_t status = dumpstate->registerAsService(); - - if (status != android::OK) - { - ALOGE("Could not register DumpstateDevice service (%d).", status); - return -1; - } - - joinRpcThreadpool(); -} diff --git a/edgetpu/OWNERS b/edgetpu/OWNERS deleted file mode 100644 index 9eb92a96..00000000 --- a/edgetpu/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/edgetpu/edgetpu.mk b/edgetpu/edgetpu.mk deleted file mode 100644 index 49658ed2..00000000 --- a/edgetpu/edgetpu.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Config variables for TPU chip on device. -$(call soong_config_set,edgetpu_config,chip,abrolhos) - -# TPU logging service -PRODUCT_PACKAGES += \ - android.hardware.edgetpu.logging@service-edgetpu-logging - -# TPU firmware -PRODUCT_PACKAGES += \ - edgetpu-abrolhos.fw - -# TPU NN AIDL HAL -PRODUCT_PACKAGES += \ - android.hardware.neuralnetworks@service-darwinn-aidl - -# TPU application service -PRODUCT_PACKAGES += \ - vendor.google.edgetpu_app_service@1.0-service - -# TPU vendor service -PRODUCT_PACKAGES += \ - vendor.google.edgetpu_vendor_service@1.0-service - -# TPU HAL client library -PRODUCT_PACKAGES += \ - libedgetpu_client.google - -# TPU metrics logger library -PRODUCT_PACKAGES += \ - libmetrics_logger - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/edgetpu/ diff --git a/fingerprint/extension/Android.bp b/fingerprint/extension/Android.bp index f36f3d5d..fa2f13e3 100644 --- a/fingerprint/extension/Android.bp +++ b/fingerprint/extension/Android.bp @@ -8,7 +8,7 @@ package { } sh_binary { - name: "fingerprint.extension", + name: "fingerprint.extension.sh", init_rc: ["init.fingerprint.extension.rc"], src: "fingerprint.extension.sh", system_ext_specific: true, diff --git a/fingerprint/extension/fingerprint.extension.mk b/fingerprint/extension/fingerprint.extension.mk index 1b8270aa..0cb220d1 100644 --- a/fingerprint/extension/fingerprint.extension.mk +++ b/fingerprint/extension/fingerprint.extension.mk @@ -1,10 +1,14 @@ # Fingerprint extension feature -ifneq (,$(filter userdebug, $(TARGET_BUILD_VARIANT))) -$(call soong_config_set,fp_hal_feature,report_bug_support,true) -BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/vendor/ -SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/system_ext/public/ -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/system_ext/private/ -PRODUCT_PACKAGES += \ - fps_ext_bug_lib \ - fingerprint.extension +ifneq (,$(filter aosp% factory%, $(TARGET_PRODUCT))) +# Skip if device is AOSP or factory build +else + ifneq (,$(filter userdebug, $(TARGET_BUILD_VARIANT))) + $(call soong_config_set,fp_hal_feature,report_bug_support,true) + BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/vendor/ + SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/system_ext/public/ + SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/system_ext/private/ + PRODUCT_PACKAGES += \ + fps_ext_bug_lib \ + fingerprint.extension.sh + endif endif diff --git a/fingerprint/extension/init.fingerprint.extension.rc b/fingerprint/extension/init.fingerprint.extension.rc index 70bcfd2f..9277ce09 100644 --- a/fingerprint/extension/init.fingerprint.extension.rc +++ b/fingerprint/extension/init.fingerprint.extension.rc @@ -1,18 +1,18 @@ # init-fingerprint-extension-sh is to send intent command to app # for tracking fingerprint issue. -service fingerprint-extension-bug-latency /system_ext/bin/fingerprint.extension latency +service fingerprint-extension-bug-latency /system_ext/bin/fingerprint.extension.sh latency group shell user shell disabled oneshot -service fingerprint-extension-bug-lockout /system_ext/bin/fingerprint.extension lockout +service fingerprint-extension-bug-lockout /system_ext/bin/fingerprint.extension.sh lockout group shell user shell disabled oneshot -service fingerprint-extension-bug-auth /system_ext/bin/fingerprint.extension auth +service fingerprint-extension-bug-auth /system_ext/bin/fingerprint.extension.sh auth group shell user shell disabled diff --git a/fingerprint/udfps_common.mk b/fingerprint/udfps_common.mk index 9d413196..58088568 100644 --- a/fingerprint/udfps_common.mk +++ b/fingerprint/udfps_common.mk @@ -14,9 +14,6 @@ # limitations under the License. # -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml - # Fingerprint manifest ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) DEVICE_MANIFEST_FILE += \ diff --git a/fingerprint/udfps_shipping.mk b/fingerprint/udfps_shipping.mk index ed88f66b..c8203b18 100644 --- a/fingerprint/udfps_shipping.mk +++ b/fingerprint/udfps_shipping.mk @@ -14,5 +14,8 @@ # limitations under the License. # +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml + PRODUCT_PACKAGES += \ android.hardware.biometrics.fingerprint-service.goodix diff --git a/gnss/47765/Android.bp b/gnss/47765/Android.bp deleted file mode 100644 index 47ac1685..00000000 --- a/gnss/47765/Android.bp +++ /dev/null @@ -1,232 +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. - -soong_namespace { -} - -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_prebuilt_library_shared { - name: "android.hardware.gnss@2.1-impl-google", - arch: { - arm64: { - srcs: ["bin/android.hardware.gnss@2.1-impl-google.so"], - shared_libs: [ - "liblog", - "libhidlbase", - // "libhidltransport", - "libutils", - "android.hardware.gnss@1.0", - "android.hardware.gnss@1.1", - "android.hardware.gnss@2.0", - "android.hardware.gnss@2.1", - "android.hardware.gnss.measurement_corrections@1.0", - "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss-V2-ndk", - "libhardware", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because libhidltransport is deprecated - check_elf_files: false, -} - -cc_prebuilt_binary { - name: "android.hardware.gnss@2.1-service-brcm", - arch: { - arm64: { - srcs: ["bin/android.hardware.gnss@2.1-service-brcm"], - shared_libs: [ - "liblog", - "libutils", - "libhardware", - "android.hardware.gnss@1.0", - "libhidlbase", - // "libhidltransport", - // "libhwbinder", - "android.hardware.gnss@1.1", - "android.hardware.gnss@2.0", - "android.hardware.gnss@2.1", - "android.hardware.gnss-V2-ndk", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because libhidltransport is deprecated - // Bypass because libhwbinder is deprecated - check_elf_files: false, - vintf_fragments: ["android.hardware.gnss@2.1-service-brcm.xml"] -} - -cc_prebuilt_library_shared { - name: "flp.default", - arch: { - arm64: { - srcs: ["bin/flp.default.so"], - shared_libs: [ - "liblog", - "libcutils", - "libutils", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because soname mismatch - check_elf_files: false, -} - -cc_prebuilt_binary { - name: "gpsd", - arch: { - arm64: { - srcs: ["bin/gpsd"], - shared_libs: [ - "liblog", - "libutils", - "libhardware_legacy", - "libcutils", - "libssl", - "libcrypto", - // "libsitril-gps", - "android.frameworks.sensorservice@1.0", - "libhidlbase", - "libandroid_net", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because libsitril-gps is Android.mk module - check_elf_files: false, -} - -cc_prebuilt_library_shared { - name: "gps.default", - arch: { - arm64: { - srcs: ["bin/gps.default.so"], - shared_libs: [ - "liblog", - "libcutils", - "libutils", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because soname mismatch - check_elf_files: false, -} - -cc_prebuilt_binary { - name: "lhd", - arch: { - arm64: { - srcs: ["bin/lhd"], - shared_libs: [ - "liblog", - "libutils", - "libhardware_legacy", - "libc++", - "libc", - "libm", - "libz", - "android.hardware.contexthub@1.0", - "libhidlbase", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, -} - -cc_prebuilt_binary { - name: "scd", - arch: { - arm64: { - srcs: ["bin/scd"], - shared_libs: [ - "liblog", - "libutils", - "libssl", - "libcrypto", - "libandroid_net", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, -} diff --git a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml b/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml deleted file mode 100644 index 97538b88..00000000 --- a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 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 deleted file mode 100755 index b3295e3a..00000000 Binary files a/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so and /dev/null 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 deleted file mode 100755 index a42f6ebf..00000000 Binary files a/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm and /dev/null differ diff --git a/gnss/47765/bin/flp.default.so b/gnss/47765/bin/flp.default.so deleted file mode 100755 index fbf5a12c..00000000 Binary files a/gnss/47765/bin/flp.default.so and /dev/null differ diff --git a/gnss/47765/bin/gps.default.so b/gnss/47765/bin/gps.default.so deleted file mode 100755 index d1af0d2d..00000000 Binary files a/gnss/47765/bin/gps.default.so and /dev/null differ diff --git a/gnss/47765/bin/gpsd b/gnss/47765/bin/gpsd deleted file mode 100755 index b3989790..00000000 Binary files a/gnss/47765/bin/gpsd and /dev/null differ diff --git a/gnss/47765/bin/lhd b/gnss/47765/bin/lhd deleted file mode 100755 index fb0d3490..00000000 Binary files a/gnss/47765/bin/lhd and /dev/null differ diff --git a/gnss/47765/bin/scd b/gnss/47765/bin/scd deleted file mode 100755 index 1b2f1369..00000000 Binary files a/gnss/47765/bin/scd and /dev/null differ diff --git a/gnss/47765/config/gps.xml b/gnss/47765/config/gps.xml deleted file mode 100644 index 8b531e05..00000000 --- a/gnss/47765/config/gps.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - diff --git a/gnss/47765/config/gps.xml.oriole b/gnss/47765/config/gps.xml.oriole deleted file mode 100644 index d2550aff..00000000 --- a/gnss/47765/config/gps.xml.oriole +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - diff --git a/gnss/47765/config/gps.xml.raven b/gnss/47765/config/gps.xml.raven deleted file mode 100644 index 1b748e22..00000000 --- a/gnss/47765/config/gps.xml.raven +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - diff --git a/gnss/47765/config/gps_user.xml b/gnss/47765/config/gps_user.xml deleted file mode 100644 index f125fe0f..00000000 --- a/gnss/47765/config/gps_user.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - diff --git a/gnss/47765/config/gps_user.xml.oriole b/gnss/47765/config/gps_user.xml.oriole deleted file mode 100644 index 0f8ff323..00000000 --- a/gnss/47765/config/gps_user.xml.oriole +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - diff --git a/gnss/47765/config/gps_user.xml.raven b/gnss/47765/config/gps_user.xml.raven deleted file mode 100644 index 664aa94c..00000000 --- a/gnss/47765/config/gps_user.xml.raven +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - diff --git a/gnss/47765/firmware/SensorHub.patch b/gnss/47765/firmware/SensorHub.patch deleted file mode 100644 index b8684ca0..00000000 --- a/gnss/47765/firmware/SensorHub.patch +++ /dev/null @@ -1,7050 +0,0 @@ - - - - - - - - - - - - - - diff --git a/gnss/Android.mk b/gnss/Android.mk deleted file mode 100644 index 12f46b76..00000000 --- a/gnss/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2010 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. - - -# We're moving the emulator-specific platform libs to -# development.git/tools/emulator/. The following test is to ensure -# smooth builds even if the tree contains both versions. -# - -ifeq ($(BOARD_USES_EXYNOS_GNSS_DUMMY), true) - -LOCAL_PATH := $(call my-dir) - -# HAL module implemenation stored in -# hw/..so -include $(CLEAR_VARS) - -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware -LOCAL_SRC_FILES := gps_dummy.c -LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM) -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE -LOCAL_PROPRIETARY_MODULE := true - -include $(BUILD_SHARED_LIBRARY) - -endif diff --git a/gnss/device-gnss.mk b/gnss/device-gnss.mk deleted file mode 100644 index ee3a394e..00000000 --- a/gnss/device-gnss.mk +++ /dev/null @@ -1,49 +0,0 @@ -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \ - device/google/gs101/gnss/47765/config/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer \ - device/google/gs101/gnss/47765/firmware/SensorHub.patch:$(TARGET_COPY_OUT_VENDOR)/firmware/SensorHub.patch - -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - PRODUCT_COPY_FILES += \ - device/google/gs101/gnss/47765/config/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ - device/google/gs101/gnss/47765/config/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf -else - PRODUCT_COPY_FILES += \ - device/google/gs101/gnss/47765/config/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ - device/google/gs101/gnss/47765/config/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf -endif - -ifneq (,$(filter raven, $(subst _, ,$(TARGET_PRODUCT)))) - ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml - else - PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps_user.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml - endif -else ifneq (,$(filter oriole, $(subst _, ,$(TARGET_PRODUCT)))) - ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps.xml.oriole:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml - else - PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps_user.xml.oriole:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml - endif -else ifneq (,$(filter slider whitefin, $(subst _, ,$(TARGET_PRODUCT)))) - ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml - else - PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps_user.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml - endif -endif - -PRODUCT_SOONG_NAMESPACES += \ - device/google/gs101/gnss/47765 - -PRODUCT_PACKAGES += \ - android.hardware.gnss@2.1-impl-google \ - gps.default \ - flp.default \ - gpsd \ - lhd \ - scd \ - android.hardware.gnss@2.1-service-brcm - -PRODUCT_PACKAGES_DEBUG += \ - init.gps_log.rc diff --git a/gnss/gps_dummy.c b/gnss/gps_dummy.c deleted file mode 100644 index 9ccde1d3..00000000 --- a/gnss/gps_dummy.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -/* this implements a GPS hardware library for the Android emulator. - * the following code should be built as a shared library that will be - * placed into /system/lib/hw/gps.goldfish.so - * - * it will be loaded by the code in hardware/libhardware/hardware.c - * which is itself called from android_location_GpsLocationProvider.cpp - */ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "gps_dummy" -#include -//#include -#include - -#define GPS_DEBUG 0 - -#if GPS_DEBUG -# define D(...) ALOGD(__VA_ARGS__) -#else -# define D(...) ((void)0) -#endif - -static int -dummy_gps_init(GpsCallbacks* callbacks) -{ - return 0; -} - -static void -dummy_gps_cleanup(void) -{ -} - - -static int -dummy_gps_start() -{ - return 0; -} - - -static int -dummy_gps_stop() -{ - return 0; -} - - -static int -dummy_gps_inject_time(GpsUtcTime __unused time, - int64_t __unused timeReference, - int __unused uncertainty) -{ - return 0; -} - -static int -dummy_gps_inject_location(double __unused latitude, - double __unused longitude, - float __unused accuracy) -{ - return 0; -} - -static void -dummy_gps_delete_aiding_data(GpsAidingData __unused flags) -{ -} - -static int dummy_gps_set_position_mode(GpsPositionMode __unused mode, - GpsPositionRecurrence __unused recurrence, - uint32_t __unused min_interval, - uint32_t __unused preferred_accuracy, - uint32_t __unused preferred_time) -{ - // FIXME - support fix_frequency - return 0; -} - -static const void* -dummy_gps_get_extension(const char* __unused name) -{ - // no extensions supported - return NULL; -} - -static const GpsInterface dummyGpsInterface = { - sizeof(GpsInterface), - dummy_gps_init, - dummy_gps_start, - dummy_gps_stop, - dummy_gps_cleanup, - dummy_gps_inject_time, - dummy_gps_inject_location, - dummy_gps_delete_aiding_data, - dummy_gps_set_position_mode, - dummy_gps_get_extension, -}; - -const GpsInterface* gps__get_gps_interface(struct gps_device_t* __unused dev) -{ - return &dummyGpsInterface; -} - -static int open_gps(const struct hw_module_t* module, - char const* __unused name, - struct hw_device_t** device) -{ - struct gps_device_t *dev = (struct gps_device_t *)malloc(sizeof(struct gps_device_t)); - memset(dev, 0, sizeof(*dev)); - - dev->common.tag = HARDWARE_DEVICE_TAG; - dev->common.version = 0; - dev->common.module = (struct hw_module_t*)module; - dev->get_gps_interface = gps__get_gps_interface; - - *device = (struct hw_device_t*)dev; - return 0; -} - -static struct hw_module_methods_t gps_module_methods = { - .open = open_gps -}; - -struct hw_module_t HAL_MODULE_INFO_SYM = { - .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, - .id = GPS_HARDWARE_MODULE_ID, - .name = "Dummy GPS Module", - .author = "The Android Open Source Project", - .methods = &gps_module_methods, -}; diff --git a/init.display.sh b/init.display.sh new file mode 100755 index 00000000..bb942e3f --- /dev/null +++ b/init.display.sh @@ -0,0 +1,22 @@ +#!/vendor/bin/sh +modules_dir= + +for f in /vendor/lib/modules/*/modules.dep /vendor/lib/modules/modules.dep; do + if [[ -f "$f" ]]; then + modules_dir="$(dirname "$f")" + break + fi +done + +if [[ -z "${modules_dir}" ]]; then + echo "Unable to locate kernel modules directory" 2>&1 + exit 1 +fi + +panel_drv=`getprop ro.boot.primary_panel_drv` +if [[ -z "$panel_drv" ]]; then + panel_drv="panel-samsung-emul" +fi +modprobe -d "${modules_dir}" exynos-drm.ko +modprobe -d "${modules_dir}" $panel_drv.ko + diff --git a/init.insmod.gs101.cfg b/init.insmod.gs101.cfg deleted file mode 100644 index 1eb29b9a..00000000 --- a/init.insmod.gs101.cfg +++ /dev/null @@ -1,12 +0,0 @@ -#################################################### -# init.insmod.common.cfg # -# This file contains common kernel modules to load # -# at init time by init.insmod.sh script # -#################################################### - -# Load common kernel modules -# Modules here will be loaded *before* device specific modules -install_display_drivers -modprobe|-b * -# All common modules loaded -setprop|vendor.common.modules.ready diff --git a/init.insmod.sh b/init.insmod.sh deleted file mode 100755 index 645391af..00000000 --- a/init.insmod.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/vendor/bin/sh - -############################################################# -### init.insmod.cfg format: ### -### ----------------------------------------------------- ### -### [insmod|setprop|enable/moprobe|wait] [path|prop name] ### -### ... ### -############################################################# - -modules_dir= - -for f in /vendor/lib/modules/*/modules.dep /vendor/lib/modules/modules.dep; do - if [[ -f "$f" ]]; then - modules_dir="$(dirname "$f")" - break - fi -done - -if [[ -z "${modules_dir}" ]]; then - echo "Unable to locate kernel modules directory" 2>&1 - exit 1 -fi - -# imitates wait_for_file() in init -wait_for_file() -{ - filename="${1}" - timeout="${2:-5}" - - expiry=$(($(date "+%s")+timeout)) - while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]] - do - sleep 0.01 - done -} - -install_display_drivers() -{ - panel_drv=`getprop ro.boot.primary_panel_drv` - if [[ -z "$panel_drv" ]]; then - panel_drv="panel-samsung-emul" - fi - modprobe -d "${modules_dir}" exynos-drm.ko - modprobe -d "${modules_dir}" $panel_drv.ko -} - -if [ $# -eq 1 ]; then - cfg_file=$1 -else - # Set property even if there is no insmod config - # to unblock early-boot trigger - setprop vendor.common.modules.ready - setprop vendor.device.modules.ready - setprop vendor.all.modules.ready - setprop vendor.all.devices.ready - exit 1 -fi - -if [ -f $cfg_file ]; then - while IFS="|" read -r action arg - do - case $action in - "insmod") insmod $arg ;; - "setprop") setprop $arg 1 ;; - "enable") echo 1 > $arg ;; - "modprobe") - case ${arg} in - "-b *" | "-b") - arg="-b --all=${modules_dir}/modules.load" ;; - "*" | "") - arg="--all=${modules_dir}/modules.load" ;; - esac - modprobe -a -d "${modules_dir}" $arg ;; - "wait") wait_for_file $arg ;; - "install_display_drivers") install_display_drivers ;; - esac - done < $cfg_file -fi diff --git a/gnss/47765/config/gps.cer b/location/gps.cer similarity index 100% rename from gnss/47765/config/gps.cer rename to location/gps.cer diff --git a/gnss/47765/config/lhd.conf b/location/lhd.conf similarity index 100% rename from gnss/47765/config/lhd.conf rename to location/lhd.conf diff --git a/gnss/47765/config/lhd_user.conf b/location/lhd_user.conf similarity index 100% rename from gnss/47765/config/lhd_user.conf rename to location/lhd_user.conf diff --git a/gnss/47765/config/scd.conf b/location/scd.conf similarity index 100% rename from gnss/47765/config/scd.conf rename to location/scd.conf diff --git a/gnss/47765/config/scd_user.conf b/location/scd_user.conf similarity index 100% rename from gnss/47765/config/scd_user.conf rename to location/scd_user.conf diff --git a/manifest.xml b/manifest.xml index 09fbd8a7..038a3d48 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,31 +1,4 @@ - - android.hardware.audio - hwbinder - 7.1 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - android.hardware.media.omx hwbinder @@ -57,24 +30,6 @@ default - - android.hardware.dumpstate - hwbinder - 1.1 - - IDumpstateDevice - default - - - - android.hardware.bluetooth - hwbinder - 1.1 - - IBluetoothHci - default - - android.hardware.boot hwbinder @@ -92,64 +47,11 @@ com.google.input + 2 ITouchContextService default - - hardware.google.bluetooth.bt_channel_avoidance - hwbinder - 1.0 - - IBTChannelAvoidance - default - - - - hardware.google.bluetooth.ext - hwbinder - 1.0 - - IBluetoothExt - default - - - - hardware.google.bluetooth.sar - hwbinder - 1.1 - - IBluetoothSar - default - - - - hardware.google.bluetooth.ccc - hwbinder - 1.1 - - IBluetoothCcc - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - diff --git a/manifest_64.xml b/manifest_64.xml index 4edb2e92..122d1bb3 100644 --- a/manifest_64.xml +++ b/manifest_64.xml @@ -1,31 +1,4 @@ - - android.hardware.audio - hwbinder - 7.1 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - android.hardware.graphics.mapper passthrough @@ -44,24 +17,6 @@ default - - android.hardware.dumpstate - hwbinder - 1.1 - - IDumpstateDevice - default - - - - android.hardware.bluetooth - hwbinder - 1.1 - - IBluetoothHci - default - - android.hardware.boot hwbinder @@ -84,55 +39,11 @@ com.google.input + 2 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.1 - - IBluetoothCcc - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - diff --git a/media_codecs_aosp_c2.xml b/media_codecs_aosp_c2.xml index 31842ff8..cddd6177 100644 --- a/media_codecs_aosp_c2.xml +++ b/media_codecs_aosp_c2.xml @@ -47,11 +47,11 @@ - + - - + + @@ -166,10 +166,11 @@ + - + diff --git a/media_codecs_performance_c2.xml b/media_codecs_performance_c2.xml index 7000661b..358586ea 100644 --- a/media_codecs_performance_c2.xml +++ b/media_codecs_performance_c2.xml @@ -142,59 +142,52 @@ - - - - - - - - + + + + - - - - - - - - - - + + + + + + + - + - + - + - + - + + + + + + + - - - - - - - + + + + - - - - - - - + + + + @@ -250,5 +243,13 @@ + + + + + + + + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml index 3697d3a3..c5b563e7 100644 --- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml +++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml @@ -26,7 +26,7 @@ false - M21,0C19.94,0.01 18.83,0.04 17.73,0.11C16.91,0.17 16.09,0.25 15.3,0.36C14.5,0.48 13.72,0.62 12.95,0.81C11.42,1.19 9.97,1.72 8.65,2.43C7.32,3.14 6.12,4.02 5.08,5.07C4.04,6.11 3.15,7.31 2.44,8.64C1.73,9.97 1.19,11.42 0.82,12.94C0.63,13.7 0.48,14.49 0.37,15.29C0.25,16.09 0.17,16.9 0.12,17.72C0.05,18.82 0.02,19.93 0.01,21.55 + M21,0C19.94,0.01 18.83,0.04 17.73,0.11C16.91,0.17 16.09,0.25 15.3,0.36C14.5,0.48 13.72,0.62 12.95,0.81C11.42,1.19 9.97,1.72 8.65,2.43C7.32,3.14 6.12,4.02 5.08,5.07C4.04,6.11 3.15,7.31 2.44,8.64C1.73,9.97 1.19,11.42 0.82,12.94C0.63,13.7 0.48,14.49 0.37,15.29C0.25,16.09 0.17,16.9 0.12,17.72C0.05,18.82 0.02,19.93 0.01,21.55 android.sensor.light diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp index eb71d45e..72805622 100644 --- a/pixelstats/service.cpp +++ b/pixelstats/service.cpp @@ -57,12 +57,20 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = { UFS_ERR_PATH(auto_hibern8_err_count) }, .AmsRatePath = "/sys/devices/platform/audiometrics/ams_rate_read_once", - .TempResidencyPath = "/sys/kernel/metrics/temp_residency/temp_residency_all/stats", + .TempResidencyAndResetPaths = { + { + "/sys/kernel/metrics/thermal/tr_by_group/tmu/stats", + "/sys/kernel/metrics/thermal/tr_by_group/tmu/stats_reset" + }, + { + "/sys/kernel/metrics/thermal/tr_by_group/spmic/stats", + "/sys/kernel/metrics/thermal/tr_by_group/spmic/stats_reset" + } + }, }; const struct UeventListener::UeventPaths ueventPaths = { .AudioUevent = "/devices/virtual/amcs/amcs", - .WirelessChargerPtmcPath = "/sys/class/power_supply/wireless/device/ptmc_id", .TypeCPartnerUevent = "PRODUCT_TYPE="}; int main() { diff --git a/preinstalled-packages-product-gs101-device-debug.xml b/preinstalled-packages-product-gs101-device-debug.xml new file mode 100644 index 00000000..64524bcd --- /dev/null +++ b/preinstalled-packages-product-gs101-device-debug.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + diff --git a/radio/config/logging.conf b/radio/config/logging.conf index d57c82aa..e852dd57 100644 --- a/radio/config/logging.conf +++ b/radio/config/logging.conf @@ -1 +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 +modem_logging_control START -o /data/vendor/radio/logs/always-on -n 50 -s 50 -m /vendor/etc/modem/default.cfg --enable_exmetric --enable_exmetric_internal \ No newline at end of file diff --git a/rro_overlays/WifiOverlay/res/values/config.xml b/rro_overlays/WifiOverlay/res/values/config.xml index 4addce85..7a58d7d4 100644 --- a/rro_overlays/WifiOverlay/res/values/config.xml +++ b/rro_overlays/WifiOverlay/res/values/config.xml @@ -56,6 +56,7 @@ true + true true @@ -144,4 +145,18 @@ true + + + true + + + true + + + true diff --git a/sensorhal/sensorlist.cpp b/sensorhal/sensorlist.cpp deleted file mode 100644 index fb621822..00000000 --- a/sensorhal/sensorlist.cpp +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (C) 2016 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 "sensorlist.h" - -#include - -#include "hubdefs.h" - -using namespace android; - -const int kVersion = 1; - -const float kMinSampleRateHzAccel = 6.250f; -const float kMaxSampleRateHzAccel = 400.0f; -const float kAccelRangeG = 16.0f; -extern const float kScaleAccel = (kAccelRangeG * 9.81f / 32768.0f); - -const float kMinSampleRateHzGyro = 6.250f; -const float kMaxSampleRateHzGyro = 400.0f; - -const float kMinSampleRateHzMag = 3.125f; -const float kMaxSampleRateHzMag = 50.0f; -extern const float kScaleMag = 0.15f; - -const float kMinSampleRateHzPolling = 0.1f; -const float kMaxSampleRateHzPolling = 25.0f; - -const float kMinSampleRateHzPressure = 0.1f; -const float kMaxSampleRateHzPressure = 10.0f; - -const float kMinSampleRateHzTemperature = kMinSampleRateHzPolling; -const float kMaxSampleRateHzTemperature = kMaxSampleRateHzPolling; - -const float kMinSampleRateHzProximity = kMinSampleRateHzPolling; -const float kMaxSampleRateHzProximity = 5.0; - -const float kMinSampleRateHzLight = kMinSampleRateHzPolling; -const float kMaxSampleRateHzLight = 5.0; - -const float kMinSampleRateHzOrientation = 12.5f; -const float kMaxSampleRateHzOrientation = 200.0f; - -#ifdef DIRECT_REPORT_ENABLED -constexpr uint32_t kDirectReportFlagAccel = ( - // support up to rate level fast (nominal 200Hz); - (SENSOR_DIRECT_RATE_FAST << SENSOR_FLAG_SHIFT_DIRECT_REPORT) - // support ashmem and gralloc direct channel - | SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM - | SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC); -constexpr uint32_t kDirectReportFlagGyro = ( - // support up to rate level fast (nominal 200Hz); - (SENSOR_DIRECT_RATE_FAST << SENSOR_FLAG_SHIFT_DIRECT_REPORT) - // support ashmem and gralloc direct channel - | SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM - | SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC); -constexpr uint32_t kDirectReportFlagMag = ( - // support up to rate level normal (nominal 50Hz); - (SENSOR_DIRECT_RATE_NORMAL << SENSOR_FLAG_SHIFT_DIRECT_REPORT) - // support ashmem and gralloc direct channel - | SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM - | SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC); -#else -constexpr uint32_t kDirectReportFlagAccel = 0; -constexpr uint32_t kDirectReportFlagGyro = 0; -constexpr uint32_t kDirectReportFlagMag = 0; -#endif - -/* - * The fowllowing max count is determined by the total number of blocks - * avaliable in the shared nanohub buffer and number of samples each type of - * event can hold within a buffer block. - * For marlin's case, there are 239 blocks in the shared sensor buffer and - * each block can hold 30 OneAxis Samples, 15 ThreeAxis Samples or 24 - * RawThreeAxies Samples. - */ -const int kMaxOneAxisEventCount = 7170; -const int kMaxThreeAxisEventCount = 3585; -const int kMaxRawThreeAxisEventCount = 5736; - -const int kMinFifoReservedEventCount = 20; - -const char SENSOR_STRING_TYPE_INTERNAL_TEMPERATURE[] = - "com.google.sensor.internal_temperature"; -const char SENSOR_STRING_TYPE_SYNC[] = - "com.google.sensor.sync"; -const char SENSOR_STRING_TYPE_DOUBLE_TWIST[] = - "com.google.sensor.double_twist"; -const char SENSOR_STRING_TYPE_DOUBLE_TAP[] = - "com.google.sensor.double_tap"; -const char SENSOR_STRING_TYPE_DOUBLE_TOUCH[] = - "com.google.sensor.double_touch"; - -extern const sensor_t kSensorList[] = { - { - "TMD4903 Proximity Sensor", - "AMS", - kVersion, - COMMS_SENSOR_PROXIMITY, - SENSOR_TYPE_PROXIMITY, - 5.0f, // maxRange (cm) - 1.0f, // resolution (cm) - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzProximity), // minDelay - 300, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_PROXIMITY, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzProximity), // maxDelay - SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE, - { NULL, NULL } - }, - { - "TMD4903 Light Sensor", - "AMS", - kVersion, - COMMS_SENSOR_LIGHT, - SENSOR_TYPE_LIGHT, - 43000.0f, // maxRange (lx) - 10.0f, // XXX resolution (lx) - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzLight), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_LIGHT, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzLight), // maxDelay - SENSOR_FLAG_ON_CHANGE_MODE, - { NULL, NULL } - }, - { - "BMI160 accelerometer", - "Bosch", - kVersion, - COMMS_SENSOR_ACCEL, - SENSOR_TYPE_ACCELEROMETER, - GRAVITY_EARTH * kAccelRangeG, // maxRange - GRAVITY_EARTH * kAccelRangeG / 32768.0f, // resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzAccel), // minDelay - 3000, // XXX fifoReservedEventCount - kMaxRawThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_ACCELEROMETER, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzAccel), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE | kDirectReportFlagAccel, - { NULL, NULL } - }, - { - "BMI160 gyroscope", - "Bosch", - kVersion, - COMMS_SENSOR_GYRO, - SENSOR_TYPE_GYROSCOPE, - 1000.0f * M_PI / 180.0f, // maxRange - 1000.0f * M_PI / (180.0f * 32768.0f), // resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzGyro), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_GYROSCOPE, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzGyro), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE | kDirectReportFlagGyro, - { NULL, NULL } - }, - { - "BMI160 gyroscope (uncalibrated)", - "Bosch", - kVersion, - COMMS_SENSOR_GYRO_UNCALIBRATED, - SENSOR_TYPE_GYROSCOPE_UNCALIBRATED, - 1000.0f * M_PI / 180.0f, // maxRange - 1000.0f * M_PI / (180.0f * 32768.0f), // resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzGyro), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_GYROSCOPE_UNCALIBRATED, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzGyro), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE | kDirectReportFlagGyro, - { NULL, NULL } - }, - { - "AK09915 magnetometer", - "AKM", - kVersion, - COMMS_SENSOR_MAG, - SENSOR_TYPE_MAGNETIC_FIELD, - 1300.0f, // XXX maxRange - 0.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzMag), // minDelay - 600, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_MAGNETIC_FIELD, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzMag), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE | kDirectReportFlagMag, - { NULL, NULL } - }, - { - "AK09915 magnetometer (uncalibrated)", - "AKM", - kVersion, - COMMS_SENSOR_MAG_UNCALIBRATED, - SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED, - 1300.0f, // XXX maxRange - 0.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzMag), // minDelay - 600, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzMag), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE | kDirectReportFlagMag, - { NULL, NULL } - }, - { - "BMP285 pressure", - "Bosch", - kVersion, - COMMS_SENSOR_PRESSURE, - SENSOR_TYPE_PRESSURE, - 1100.0f, // maxRange (hPa) - 0.005f, // resolution (hPa) - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzPressure), // minDelay - 300, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_PRESSURE, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzPressure), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "BMP285 temperature", - "Bosch", - kVersion, - COMMS_SENSOR_TEMPERATURE, - SENSOR_TYPE_INTERNAL_TEMPERATURE, - 85.0f, // maxRange (degC) - 0.01, // resolution (degC) - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzTemperature), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_INTERNAL_TEMPERATURE, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzTemperature), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "Orientation", - "Google", - kVersion, - COMMS_SENSOR_ORIENTATION, - SENSOR_TYPE_ORIENTATION, - 360.0f, // maxRange (deg) - 1.0f, // XXX resolution (deg) - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzOrientation), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_ORIENTATION, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzOrientation), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "BMI160 Step detector", - "Bosch", - kVersion, - COMMS_SENSOR_STEP_DETECTOR, - SENSOR_TYPE_STEP_DETECTOR, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - 0, // minDelay - 100, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_STEP_DETECTOR, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_SPECIAL_REPORTING_MODE, - { NULL, NULL } - }, - { - "BMI160 Step counter", - "Bosch", - kVersion, - COMMS_SENSOR_STEP_COUNTER, - SENSOR_TYPE_STEP_COUNTER, - 1.0f, // XXX maxRange - 1.0f, // resolution - 0.0f, // XXX power - 0, // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_STEP_COUNTER, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_ON_CHANGE_MODE, - { NULL, NULL } - }, - { - "Significant motion", - "Google", - kVersion, - COMMS_SENSOR_SIGNIFICANT_MOTION, - SENSOR_TYPE_SIGNIFICANT_MOTION, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - -1, // minDelay - 0, // XXX fifoReservedEventCount - 0, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_SIGNIFICANT_MOTION, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ONE_SHOT_MODE, - { NULL, NULL } - }, - { - "Gravity", - "Google", - kVersion, - COMMS_SENSOR_GRAVITY, - SENSOR_TYPE_GRAVITY, - 1000.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzOrientation), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_GRAVITY, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzOrientation), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "Linear Acceleration", - "Google", - kVersion, - COMMS_SENSOR_LINEAR_ACCEL, - SENSOR_TYPE_LINEAR_ACCELERATION, - 1000.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzOrientation), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_LINEAR_ACCELERATION, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzOrientation), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "Rotation Vector", - "Google", - kVersion, - COMMS_SENSOR_ROTATION_VECTOR, - SENSOR_TYPE_ROTATION_VECTOR, - 1000.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzOrientation), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_ROTATION_VECTOR, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzOrientation), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "Geomagnetic Rotation Vector", - "Google", - kVersion, - COMMS_SENSOR_GEO_MAG, - SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR, - 1000.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzOrientation), // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzOrientation), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "Game Rotation Vector", - "Google", - kVersion, - COMMS_SENSOR_GAME_ROTATION_VECTOR, - SENSOR_TYPE_GAME_ROTATION_VECTOR, - 1000.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzOrientation), // minDelay - 300, // XXX fifoReservedEventCount - kMaxThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_GAME_ROTATION_VECTOR, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzOrientation), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE, - { NULL, NULL } - }, - { - "Tilt Detector", - "Google", - kVersion, - COMMS_SENSOR_TILT, - SENSOR_TYPE_TILT_DETECTOR, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - 0, // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_TILT_DETECTOR, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_SPECIAL_REPORTING_MODE, - { NULL, NULL } - }, - { - "Pickup Gesture", - "Google", - kVersion, - COMMS_SENSOR_GESTURE, - SENSOR_TYPE_PICK_UP_GESTURE, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - -1, // minDelay - 0, // XXX fifoReservedEventCount - 0, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_PICK_UP_GESTURE, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ONE_SHOT_MODE, - { NULL, NULL } - }, - { - "Sensors Sync", - "Google", - kVersion, - COMMS_SENSOR_SYNC, - SENSOR_TYPE_SYNC, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.1f, // XXX power - 0, // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_SYNC, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_SPECIAL_REPORTING_MODE, - { NULL, NULL } - }, - { - "Double Twist", - "Google", - kVersion, - COMMS_SENSOR_DOUBLE_TWIST, - SENSOR_TYPE_DOUBLE_TWIST, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.1f, // XXX power - 0, // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_DOUBLE_TWIST, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_SPECIAL_REPORTING_MODE, - { NULL, NULL } - }, - { - "Double Tap", - "Google", - kVersion, - COMMS_SENSOR_DOUBLE_TAP, - SENSOR_TYPE_DOUBLE_TAP, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.1f, // XXX power - 0, // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_DOUBLE_TAP, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_SPECIAL_REPORTING_MODE, - { NULL, NULL } - }, - { - "Device Orientation", - "Google", - kVersion, - COMMS_SENSOR_WINDOW_ORIENTATION, - SENSOR_TYPE_DEVICE_ORIENTATION, - 3.0f, // maxRange - 1.0f, // XXX resolution - 0.1f, // XXX power - 0, // minDelay - kMinFifoReservedEventCount, // XXX fifoReservedEventCount - kMaxOneAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_DEVICE_ORIENTATION, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_ON_CHANGE_MODE, - { NULL, NULL } - }, - { - "Double Touch", - "Google", - kVersion, - COMMS_SENSOR_DOUBLE_TOUCH, - SENSOR_TYPE_DOUBLE_TOUCH, - 1.0f, // maxRange - 1.0f, // XXX resolution - 0.0f, // XXX power - -1, // minDelay - 0, // XXX fifoReservedEventCount - 0, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_DOUBLE_TOUCH, - "", // requiredPermission - 0, // maxDelay - SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ONE_SHOT_MODE, - { NULL, NULL } - }, - { - "BMI160 accelerometer (uncalibrated)", - "Bosch", - kVersion, - COMMS_SENSOR_ACCEL_UNCALIBRATED, - SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED, - GRAVITY_EARTH * kAccelRangeG, // maxRange - GRAVITY_EARTH * kAccelRangeG / 32768.0f, // resolution - 0.0f, // XXX power - (int32_t)(1.0E6f / kMaxSampleRateHzAccel), // minDelay - 3000, // XXX fifoReservedEventCount - kMaxRawThreeAxisEventCount, // XXX fifoMaxEventCount - SENSOR_STRING_TYPE_ACCELEROMETER_UNCALIBRATED, - "", // requiredPermission - (long)(1.0E6f / kMinSampleRateHzAccel), // maxDelay - SENSOR_FLAG_CONTINUOUS_MODE | kDirectReportFlagAccel, - { NULL, NULL } - }, -}; - -extern const size_t kSensorCount = sizeof(kSensorList) / sizeof(sensor_t); diff --git a/sensors/Android.mk b/sensors/Android.mk deleted file mode 100644 index ce844c9a..00000000 --- a/sensors/Android.mk +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2009 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. - -ifeq ($(BOARD_USES_EXYNOS_SENSORS_DUMMY), true) - -LOCAL_PATH := $(call my-dir) - -# HAL module implemenation stored in -# hw/..so -include $(CLEAR_VARS) - -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware -LOCAL_SRC_FILES := sensors_dummy.c -LOCAL_MODULE := sensors.gs101 -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE -LOCAL_PROPRIETARY_MODULE := true - -include $(BUILD_SHARED_LIBRARY) - -endif diff --git a/sensors/sensors_dummy.c b/sensors/sensors_dummy.c deleted file mode 100644 index b1edd562..00000000 --- a/sensors/sensors_dummy.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Copyright (C) 2009 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. - */ - -/* this implements a sensors hardware library for the Android emulator. - * the following code should be built as a shared library that will be - * placed into /system/lib/hw/sensors.goldfish.so - * - * it will be loaded by the code in hardware/libhardware/hardware.c - * which is itself called from com_android_server_SensorService.cpp - */ - -#define SENSORS_SERVICE_NAME "sensors" - -#define LOG_TAG "Dummy_Sensors" - -#include -#include -#include -#include -#include -#include -#include -#include - -#if 0 -#define D(...) ALOGD(__VA_ARGS__) -#else -#define D(...) ((void)0) -#endif - -#define E(...) ALOGE(__VA_ARGS__) - -/** SENSOR IDS AND NAMES - **/ - -#define MAX_NUM_SENSORS 8 - -#define SUPPORTED_SENSORS ((1<"; -} - -static int -_sensorIdFromName( const char* name ) -{ - int nn; - - if (name == NULL) - return -1; - - for (nn = 0; nn < MAX_NUM_SENSORS; nn++) - if (!strcmp(name, _sensorIds[nn].name)) - return _sensorIds[nn].id; - - return -1; -} - -/* return the current time in nanoseconds */ -static int64_t now_ns(void) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (int64_t)ts.tv_sec * 1000000000 + ts.tv_nsec; -} - -/** SENSORS POLL DEVICE - ** - ** This one is used to read sensor data from the hardware. - ** We implement this by simply reading the data from the - ** emulator through the QEMUD channel. - **/ - -typedef struct SensorDevice { - struct sensors_poll_device_1 device; - sensors_event_t sensors[MAX_NUM_SENSORS]; - uint32_t pendingSensors; - int64_t timeStart; - int64_t timeOffset; - uint32_t active_sensors; - int fd; - pthread_mutex_t lock; -} SensorDevice; - -/* Grab the file descriptor to the emulator's sensors service pipe. - * This function returns a file descriptor on success, or -errno on - * failure, and assumes the SensorDevice instance's lock is held. - * - * This is needed because set_delay(), poll() and activate() can be called - * from different threads, and poll() is blocking. - * - * 1) On a first thread, de-activate() all sensors first, then call poll(), - * which results in the thread blocking. - * - * 2) On a second thread, slightly later, call set_delay() then activate() - * to enable the acceleration sensor. - * - * The system expects this to unblock the first thread which will receive - * new sensor events after the activate() call in 2). - * - * This cannot work if both threads don't use the same connection. - * - * TODO(digit): This protocol is brittle, implement another control channel - * for set_delay()/activate()/batch() when supporting HAL 1.3 - */ -static int sensor_device_get_fd_locked(SensorDevice* dev) { - /* Create connection to service on first call */ - if (dev->fd < 0) { - int ret = -errno; - E("%s: Could not open connection to service: %s", __FUNCTION__, - strerror(-ret)); - return ret; - } - return dev->fd; -} - -/* Pick up one pending sensor event. On success, this returns the sensor - * id, and sets |*event| accordingly. On failure, i.e. if there are no - * pending events, return -EINVAL. - * - * Note: The device's lock must be acquired. - */ -static int sensor_device_pick_pending_event_locked(SensorDevice* d, - sensors_event_t* event) -{ - uint32_t mask = SUPPORTED_SENSORS & d->pendingSensors; - - if (mask) { - uint32_t i = 31 - __builtin_clz(mask); - - pthread_mutex_lock(&d->lock); - d->pendingSensors &= ~(1U << i); - *event = d->sensors[i]; - event->sensor = i; - event->version = sizeof(*event); - pthread_mutex_unlock(&d->lock); - D("%s: %d [%f, %f, %f]", __FUNCTION__, - i, - event->data[0], - event->data[1], - event->data[2]); - return i; - } - E("No sensor to return!!! pendingSensors=0x%08x", d->pendingSensors); - // we may end-up in a busy loop, slow things down, just in case. - usleep(1000); - return -EINVAL; -} - -static int sensor_device_close(struct hw_device_t* dev0) -{ - SensorDevice* dev = (void*)dev0; - // Assume that there are no other threads blocked on poll() - if (dev->fd >= 0) { - close(dev->fd); - dev->fd = -1; - } - pthread_mutex_destroy(&dev->lock); - free(dev); - return 0; -} - -/* Return an array of sensor data. This function blocks until there is sensor - * related events to report. On success, it will write the events into the - * |data| array, which contains |count| items. The function returns the number - * of events written into the array, which shall never be greater than |count|. - * On error, return -errno code. - * - * Note that according to the sensor HAL [1], it shall never return 0! - * - * [1] http://source.android.com/devices/sensors/hal-interface.html - */ -static int sensor_device_poll(struct sensors_poll_device_t *dev0, - sensors_event_t* data, int count) -{ - return -EIO; -} - -static int sensor_device_activate(struct sensors_poll_device_t *dev0, - int handle, - int enabled) -{ - SensorDevice* dev = (void*)dev0; - - D("%s: handle=%s (%d) enabled=%d", __FUNCTION__, - _sensorIdToName(handle), handle, enabled); - - /* Sanity check */ - if (!ID_CHECK(handle)) { - E("%s: bad handle ID", __FUNCTION__); - return -EINVAL; - } - - /* Exit early if sensor is already enabled/disabled. */ - uint32_t mask = (1U << handle); - uint32_t sensors = enabled ? mask : 0; - - pthread_mutex_lock(&dev->lock); - - uint32_t active = dev->active_sensors; - uint32_t new_sensors = (active & ~mask) | (sensors & mask); - uint32_t changed = active ^ new_sensors; - - if (changed) - dev->active_sensors = new_sensors; - - pthread_mutex_unlock(&dev->lock); - return 0; -} - -static int sensor_device_default_flush( - struct sensors_poll_device_1* dev0, - int handle) { - - SensorDevice* dev = (void*)dev0; - - D("%s: handle=%s (%d)", __FUNCTION__, - _sensorIdToName(handle), handle); - - /* Sanity check */ - if (!ID_CHECK(handle)) { - E("%s: bad handle ID", __FUNCTION__); - return -EINVAL; - } - - pthread_mutex_lock(&dev->lock); - dev->sensors[handle].version = META_DATA_VERSION; - dev->sensors[handle].type = SENSOR_TYPE_META_DATA; - dev->sensors[handle].sensor = 0; - dev->sensors[handle].timestamp = 0; - dev->sensors[handle].meta_data.what = META_DATA_FLUSH_COMPLETE; - dev->pendingSensors |= (1U << handle); - pthread_mutex_unlock(&dev->lock); - - return 0; -} - -static int sensor_device_set_delay(struct sensors_poll_device_t *dev0, - int handle __unused, - int64_t ns) -{ - return 0; -} - -static int sensor_device_default_batch( - struct sensors_poll_device_1* dev, - int sensor_handle, - int flags, - int64_t sampling_period_ns, - int64_t max_report_latency_ns) { - return sensor_device_set_delay(dev, sensor_handle, sampling_period_ns); -} - -/** MODULE REGISTRATION SUPPORT - ** - ** This is required so that hardware/libhardware/hardware.c - ** will dlopen() this library appropriately. - **/ - -/* - * the following is the list of all supported sensors. - * this table is used to build sSensorList declared below - * according to which hardware sensors are reported as - * available from the emulator (see get_sensors_list below) - * - * note: numerical values for maxRange/resolution/power for - * all sensors but light, pressure and humidity were - * taken from the reference AK8976A implementation - */ -static const struct sensor_t sSensorListInit[] = { - { .name = "Accelerometer", - .vendor = "The Android Open Source Project", - .version = 1, - .handle = ID_ACCELERATION, - .type = SENSOR_TYPE_ACCELEROMETER, - .maxRange = 2.8f, - .resolution = 1.0f/4032.0f, - .power = 3.0f, - .minDelay = 10000, - .maxDelay = 60 * 1000 * 1000, - .fifoReservedEventCount = 0, - .fifoMaxEventCount = 0, - .stringType = 0, - .requiredPermission = 0, - .flags = SENSOR_FLAG_CONTINUOUS_MODE, - .reserved = {} - }, -}; - -static struct sensor_t sSensorList[1]; - -static int sensors__get_sensors_list(struct sensors_module_t* module __unused, - struct sensor_t const** list) -{ - *list = sSensorList; - - return 0; -} - -static int -open_sensors(const struct hw_module_t* module, - const char* name, - struct hw_device_t* *device) -{ - int status = -EINVAL; - - D("%s: name=%s", __FUNCTION__, name); - - if (!strcmp(name, SENSORS_HARDWARE_POLL)) { - SensorDevice *dev = malloc(sizeof(*dev)); - - memset(dev, 0, sizeof(*dev)); - - dev->device.common.tag = HARDWARE_DEVICE_TAG; - dev->device.common.version = SENSORS_DEVICE_API_VERSION_1_3; - dev->device.common.module = (struct hw_module_t*) module; - dev->device.common.close = sensor_device_close; - dev->device.poll = sensor_device_poll; - dev->device.activate = sensor_device_activate; - dev->device.setDelay = sensor_device_set_delay; - - // Version 1.3-specific functions - dev->device.batch = sensor_device_default_batch; - dev->device.flush = sensor_device_default_flush; - - dev->fd = -1; - pthread_mutex_init(&dev->lock, NULL); - - *device = &dev->device.common; - status = 0; - } - return status; -} - - -static struct hw_module_methods_t sensors_module_methods = { - .open = open_sensors -}; - -struct sensors_module_t HAL_MODULE_INFO_SYM = { - .common = { - .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, - .id = SENSORS_HARDWARE_MODULE_ID, - .name = "Dummy SENSORS Module", - .author = "The Android Open Source Project", - .methods = &sensors_module_methods, - }, - .get_sensors_list = sensors__get_sensors_list -}; diff --git a/task_profiles.json b/task_profiles.json index 4bcfe412..961857de 100644 --- a/task_profiles.json +++ b/task_profiles.json @@ -287,7 +287,7 @@ }, { "Name": "OtaProfiles", - "Profiles": [ "OtaPerformance", "ServiceCapacityLow", "LowIoPriority", "TimerSlackHigh" ] + "Profiles": [ "OtaPerformance", "ProcessCapacityNormal", "LowIoPriority", "TimerSlackHigh" ] } ] } diff --git a/thermal/Android.mk b/thermal/Android.mk deleted file mode 100644 index e69de29b..00000000 diff --git a/thermal/thermal.c b/thermal/thermal.c deleted file mode 100644 index e69de29b..00000000 diff --git a/tts/de-de/de-de-x-multi-r35.zvoice b/tts/de-de/de-de-x-multi-r43.zvoice similarity index 67% rename from tts/de-de/de-de-x-multi-r35.zvoice rename to tts/de-de/de-de-x-multi-r43.zvoice index 0e7d9a31..5c3afdb9 100644 Binary files a/tts/de-de/de-de-x-multi-r35.zvoice and b/tts/de-de/de-de-x-multi-r43.zvoice differ diff --git a/tts/es-es/es-es-x-multi-r35.zvoice b/tts/es-es/es-es-x-multi-r43.zvoice similarity index 55% rename from tts/es-es/es-es-x-multi-r35.zvoice rename to tts/es-es/es-es-x-multi-r43.zvoice index 4b35606e..2cebf9fd 100644 Binary files a/tts/es-es/es-es-x-multi-r35.zvoice and b/tts/es-es/es-es-x-multi-r43.zvoice differ diff --git a/tts/fr-fr/fr-fr-x-multi-r35.zvoice b/tts/fr-fr/fr-fr-x-multi-r44.zvoice similarity index 67% rename from tts/fr-fr/fr-fr-x-multi-r35.zvoice rename to tts/fr-fr/fr-fr-x-multi-r44.zvoice index 67e4f0d3..7cf7f42a 100644 Binary files a/tts/fr-fr/fr-fr-x-multi-r35.zvoice and b/tts/fr-fr/fr-fr-x-multi-r44.zvoice differ diff --git a/tts/it-it/it-it-x-multi-r32.zvoice b/tts/it-it/it-it-x-multi-r40.zvoice similarity index 54% rename from tts/it-it/it-it-x-multi-r32.zvoice rename to tts/it-it/it-it-x-multi-r40.zvoice index a90c9d87..fe10249c 100644 Binary files a/tts/it-it/it-it-x-multi-r32.zvoice and b/tts/it-it/it-it-x-multi-r40.zvoice differ diff --git a/tts/ja-jp/ja-jp-x-multi-r34.zvoice b/tts/ja-jp/ja-jp-x-multi-r42.zvoice similarity index 71% rename from tts/ja-jp/ja-jp-x-multi-r34.zvoice rename to tts/ja-jp/ja-jp-x-multi-r42.zvoice index dcb46dcb..7225ef01 100644 Binary files a/tts/ja-jp/ja-jp-x-multi-r34.zvoice and b/tts/ja-jp/ja-jp-x-multi-r42.zvoice differ diff --git a/tts/voice_packs.mk b/tts/voice_packs.mk index 9e535dd6..395ffb17 100644 --- a/tts/voice_packs.mk +++ b/tts/voice_packs.mk @@ -15,8 +15,8 @@ # Voice packs for Text-To-Speech PRODUCT_COPY_FILES += \ - device/google/gs101/tts/ja-jp/ja-jp-x-multi-r34.zvoice:product/tts/google/ja-jp/ja-jp-x-multi-r34.zvoice\ - device/google/gs101/tts/fr-fr/fr-fr-x-multi-r35.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-r35.zvoice\ - device/google/gs101/tts/de-de/de-de-x-multi-r35.zvoice:product/tts/google/de-de/de-de-x-multi-r35.zvoice\ - device/google/gs101/tts/it-it/it-it-x-multi-r32.zvoice:product/tts/google/it-it/it-it-x-multi-r32.zvoice\ - device/google/gs101/tts/es-es/es-es-x-multi-r35.zvoice:product/tts/google/es-es/es-es-x-multi-r35.zvoice + device/google/gs101/tts/ja-jp/ja-jp-x-multi-r42.zvoice:product/tts/google/ja-jp/ja-jp-x-multi-r42.zvoice\ + device/google/gs101/tts/fr-fr/fr-fr-x-multi-r44.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-r44.zvoice\ + device/google/gs101/tts/de-de/de-de-x-multi-r43.zvoice:product/tts/google/de-de/de-de-x-multi-r43.zvoice\ + device/google/gs101/tts/it-it/it-it-x-multi-r40.zvoice:product/tts/google/it-it/it-it-x-multi-r40.zvoice\ + device/google/gs101/tts/es-es/es-es-x-multi-r43.zvoice:product/tts/google/es-es/es-es-x-multi-r43.zvoice diff --git a/usb/gadget/Android.bp b/usb/gadget/Android.bp index d9e46471..16e77a01 100644 --- a/usb/gadget/Android.bp +++ b/usb/gadget/Android.bp @@ -44,7 +44,7 @@ cc_binary { "libbinder_ndk", ], static_libs: [ - "libpixelusb", + "libpixelusb-aidl", ], proprietary: true, export_shared_lib_headers: [ diff --git a/usb/gadget/UsbGadget.cpp b/usb/gadget/UsbGadget.cpp index 93138635..7ee70460 100644 --- a/usb/gadget/UsbGadget.cpp +++ b/usb/gadget/UsbGadget.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include namespace aidl { @@ -40,6 +42,9 @@ 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"; +using ::android::base::GetBoolProperty; +using ::android::hardware::google::pixel::usb::kUvcEnabled; + UsbGadget::UsbGadget() : mGadgetIrqPath("") { if (access(OS_DESC_PATH, R_OK) != 0) { ALOGE("configfs setup not done yet"); @@ -154,8 +159,8 @@ Status UsbGadget::tearDownGadget() { return Status::SUCCESS; } -static Status validateAndSetVidPid(uint64_t functions) { - Status ret = Status::SUCCESS; +static Status validateAndSetVidPid(int64_t functions) { + Status ret; std::string vendorFunctions = getVendorFunctions(); switch (functions) { @@ -302,6 +307,28 @@ static Status validateAndSetVidPid(uint64_t functions) { ret = Status(setVidPid("0x18d1", "0x4eec")); } break; + case GadgetFunction::UVC: + if (!(vendorFunctions == "user" || vendorFunctions == "")) { + ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); + ret = Status::CONFIGURATION_NOT_SUPPORTED; + } else if (!GetBoolProperty(kUvcEnabled, false)) { + ALOGE("UVC function not enabled by config"); + ret = Status::CONFIGURATION_NOT_SUPPORTED; + } else { + ret = Status(setVidPid("0x18d1", "0x4eed")); + } + break; + case GadgetFunction::ADB | GadgetFunction::UVC: + if (!(vendorFunctions == "user" || vendorFunctions == "")) { + ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str()); + ret = Status::CONFIGURATION_NOT_SUPPORTED; + } else if (!GetBoolProperty(kUvcEnabled, false)) { + ALOGE("UVC function not enabled by config"); + ret = Status::CONFIGURATION_NOT_SUPPORTED; + } else { + ret = Status(setVidPid("0x18d1", "0x4eee")); + } + break; default: ALOGE("Combination not supported"); ret = Status::CONFIGURATION_NOT_SUPPORTED; @@ -309,11 +336,14 @@ static Status validateAndSetVidPid(uint64_t functions) { return ret; } -ScopedAStatus UsbGadget::reset() { +ScopedAStatus UsbGadget::reset(const shared_ptr &callback, + int64_t in_transactionId) { ALOGI("USB Gadget reset"); if (!WriteStringToFile("none", PULLUP_PATH)) { ALOGI("Gadget cannot be pulled down"); + if (callback) + callback->resetCb(Status::ERROR, in_transactionId); return ScopedAStatus::fromServiceSpecificErrorWithMessage( -1, "Gadget cannot be pulled down"); } @@ -322,9 +352,13 @@ ScopedAStatus UsbGadget::reset() { if (!WriteStringToFile(kGadgetName, PULLUP_PATH)) { ALOGI("Gadget cannot be pulled up"); + if (callback) + callback->resetCb(Status::ERROR, in_transactionId); return ScopedAStatus::fromServiceSpecificErrorWithMessage( -1, "Gadget cannot be pulled up"); } + if (callback) + callback->resetCb(Status::SUCCESS, in_transactionId); return ScopedAStatus::ok(); } @@ -519,9 +553,7 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, } ALOGI("Usb Gadget setcurrent functions called successfully"); - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Usb Gadget setcurrent functions called successfully"); - + return ScopedAStatus::ok(); error: ALOGI("Usb Gadget setcurrent functions failed"); diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h index d7e20a6c..59759308 100644 --- a/usb/gadget/UsbGadget.h +++ b/usb/gadget/UsbGadget.h @@ -107,7 +107,8 @@ struct UsbGadget : public BnUsbGadget { ScopedAStatus getCurrentUsbFunctions(const shared_ptr &callback, int64_t in_transactionId) override; - ScopedAStatus reset() override; + ScopedAStatus reset(const shared_ptr &callback, + int64_t in_transactionId) override; ScopedAStatus getUsbSpeed(const shared_ptr &callback, int64_t in_transactionId) override; diff --git a/usb/gadget/android.hardware.usb.gadget-service.rc b/usb/gadget/android.hardware.usb.gadget-service.rc index 3c9c1cce..ba7d5f69 100644 --- a/usb/gadget/android.hardware.usb.gadget-service.rc +++ b/usb/gadget/android.hardware.usb.gadget-service.rc @@ -1,8 +1,7 @@ service vendor.usb-gadget-hal /vendor/bin/hw/android.hardware.usb.gadget-service.gs101 class hal user system - group system shell mtp wakelock - capabilities WAKE_ALARM BLOCK_SUSPEND + group system shell mtp on post-fs chown root system /sys/class/typec/port0/power_role diff --git a/usb/usb/Android.bp b/usb/usb/Android.bp index f0f50698..1530db58 100644 --- a/usb/usb/Android.bp +++ b/usb/usb/Android.bp @@ -42,8 +42,9 @@ cc_binary { "libhardware", "android.hardware.thermal@1.0", "android.hardware.thermal@2.0", - "android.hardware.usb.gadget@1.0", - "android.hardware.usb-V1-ndk", + "android.hardware.thermal-V1-ndk", + "android.hardware.usb.gadget@1.0", + "android.hardware.usb-V2-ndk", "libcutils", "android.frameworks.stats-V1-ndk", "pixelatoms-cpp", @@ -53,6 +54,7 @@ cc_binary { static_libs: [ "libpixelusb", "libpixelstats", + "libthermalutils", ], export_shared_lib_headers: [ "android.frameworks.stats-V1-ndk", diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp index d3c5036a..6993275a 100644 --- a/usb/usb/Usb.cpp +++ b/usb/usb/Usb.cpp @@ -44,6 +44,7 @@ using aidl::android::frameworks::stats::IStats; using android::base::GetProperty; +using android::base::Tokenize; using android::base::Trim; using android::hardware::google::pixel::getStatsService; using android::hardware::google::pixel::PixelAtoms::VendorUsbPortOverheat; @@ -59,6 +60,11 @@ volatile bool destroyThread; string enabledPath; constexpr char kHsi2cPath[] = "/sys/devices/platform/10d50000.hsi2c"; constexpr char kI2CPath[] = "/sys/devices/platform/10d50000.hsi2c/i2c-"; +constexpr char kComplianceWarningsPath[] = "device/non_compliant_reasons"; +constexpr char kComplianceWarningBC12[] = "bc12"; +constexpr char kComplianceWarningDebugAccessory[] = "debug-accessory"; +constexpr char kComplianceWarningMissingRp[] = "missing_rp"; +constexpr char kComplianceWarningOther[] = "other"; constexpr char kContaminantDetectionPath[] = "i2c-max77759tcpc/contaminant_detection"; constexpr char kStatusPath[] = "i2c-max77759tcpc/contaminant_detection_status"; constexpr char kSinkLimitEnable[] = "i2c-max77759tcpc/usb_limit_sink_enable"; @@ -275,6 +281,49 @@ Status queryMoistureDetectionStatus(std::vector *currentPortStatus) return Status::SUCCESS; } +Status queryNonCompliantChargerStatus(std::vector *currentPortStatus) { + string reasons, path; + + for (int i = 0; i < currentPortStatus->size(); i++) { + (*currentPortStatus)[i].supportsComplianceWarnings = true; + path = string(kTypecPath) + "/" + (*currentPortStatus)[i].portName + "/" + + string(kComplianceWarningsPath); + if (ReadFileToString(path.c_str(), &reasons)) { + std::vector reasonsList = Tokenize(reasons.c_str(), "[], \n\0"); + for (string reason : reasonsList) { + if (!strncmp(reason.c_str(), kComplianceWarningDebugAccessory, + strlen(kComplianceWarningDebugAccessory))) { + (*currentPortStatus)[i].complianceWarnings.push_back(ComplianceWarning::DEBUG_ACCESSORY); + continue; + } + if (!strncmp(reason.c_str(), kComplianceWarningBC12, + strlen(kComplianceWarningBC12))) { + (*currentPortStatus)[i].complianceWarnings.push_back(ComplianceWarning::BC_1_2); + continue; + } + if (!strncmp(reason.c_str(), kComplianceWarningMissingRp, + strlen(kComplianceWarningMissingRp))) { + (*currentPortStatus)[i].complianceWarnings.push_back(ComplianceWarning::MISSING_RP); + continue; + } + if (!strncmp(reason.c_str(), kComplianceWarningOther, + strlen(kComplianceWarningOther))) { + (*currentPortStatus)[i].complianceWarnings.push_back(ComplianceWarning::OTHER); + continue; + } + } + if ((*currentPortStatus)[i].complianceWarnings.size() > 0 && + (*currentPortStatus)[i].currentPowerRole == PortPowerRole::NONE) { + (*currentPortStatus)[i].currentMode = PortMode::UFP; + (*currentPortStatus)[i].currentPowerRole = PortPowerRole::SINK; + (*currentPortStatus)[i].currentDataRole = PortDataRole::NONE; + (*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::CONNECTED; + } + } + } + return Status::SUCCESS; +} + string appendRoleNodeHelper(const string &portName, PortRole::Tag tag) { string node("/sys/class/typec/" + portName); @@ -771,6 +820,7 @@ void queryVersionHelper(android::hardware::usb::Usb *usb, status = getPortStatusHelper(usb, currentPortStatus); queryMoistureDetectionStatus(currentPortStatus); queryPowerTransferStatus(currentPortStatus); + queryNonCompliantChargerStatus(currentPortStatus); if (usb->mCallback != NULL) { ScopedAStatus ret = usb->mCallback->notifyPortStatusChange(*currentPortStatus, status); diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index e052f433..43a8084c 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -8,30 +8,66 @@ on post-fs chown root system /sys/class/typec/port0/power_role chown root system /sys/class/typec/port0/data_role chown root system /sys/class/typec/port0/port_type + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/contaminant_detection 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-9/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_current 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-9/i2c-max77759tcpc/usb_limit_accessory_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_enable 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-9/i2c-max77759tcpc/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_current 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-9/i2c-max77759tcpc/usb_limit_sink_current + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_enable 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-9/i2c-max77759tcpc/usb_limit_sink_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_source_enable + chown root system /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_source_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/10d50000.hsi2c/i2c-9/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 @@ -42,28 +78,64 @@ on post-fs 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-0/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/contaminant_detection 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-9/i2c-max77759tcpc/contaminant_detection + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_current 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-9/i2c-max77759tcpc/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_enable 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-9/i2c-max77759tcpc/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_current 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-9/i2c-max77759tcpc/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_enable 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-9/i2c-max77759tcpc/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d50000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_source_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/10d50000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_source_enable chmod 664 /sys/devices/platform/google,pogo/move_data_to_usb diff --git a/usb/usb/android.hardware.usb-service.xml b/usb/usb/android.hardware.usb-service.xml index 60881948..c3f07f52 100644 --- a/usb/usb/android.hardware.usb-service.xml +++ b/usb/usb/android.hardware.usb-service.xml @@ -1,7 +1,7 @@ android.hardware.usb - 1 + 2 IUsb default diff --git a/wifi/p2p_supplicant_overlay.conf b/wifi/p2p_supplicant_overlay.conf index 4ec8453e..74d24d8f 100644 --- a/wifi/p2p_supplicant_overlay.conf +++ b/wifi/p2p_supplicant_overlay.conf @@ -8,3 +8,4 @@ p2p_add_cli_chan=1 disable_scan_offload=1 p2p_go_vht=1 p2p_pref_chan=124:149, 115:36 +p2p_6ghz_disable=1