Merge Android 14

Bug: 298295554
Merged-In: I6f85889399c989a9a65ab7e7178fd02f89e7847f
Change-Id: Iba298169eab2a1765b463753769afdc52a3d8c92
This commit is contained in:
Xin Li 2023-10-05 15:33:39 -07:00
commit 9cce39b482
79 changed files with 1371 additions and 11162 deletions

View file

@ -34,3 +34,11 @@ license {
"NOTICE",
],
}
prebuilt_etc {
name: "preinstalled-packages-product-gs201-device-debug.xml",
src: "preinstalled-packages-product-gs201-device-debug.xml",
product_specific: true,
sub_dir: "sysconfig",
filename_from_src: true,
}

View file

@ -196,6 +196,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
########################
@ -251,12 +252,15 @@ endif
# 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 := hwc3
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

2
OWNERS Normal file
View file

@ -0,0 +1,2 @@
# 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

View file

@ -1 +0,0 @@
# AoC firmware will be loaded by Daemon

View file

@ -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

View file

@ -1,26 +0,0 @@
PRODUCT_PACKAGES += \
aocd
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs201-sepolicy/aoc
ifeq (,$(filter aosp_%,$(TARGET_PRODUCT)))
# IAudioMetricExt HIDL
PRODUCT_PACKAGES += \
vendor.google.audiometricext@1.0-service-vendor
endif
# If AoC Daemon is not present on this build, load firmware at boot via rc
ifeq ($(wildcard vendor/google/whitechapel/aoc/aocd),)
PRODUCT_COPY_FILES += \
device/google/gs201/aoc/conf/init.aoc.nodaemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.aoc.rc
else
PRODUCT_COPY_FILES += \
device/google/gs201/aoc/conf/init.aoc.daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.aoc.rc
endif
# AoC debug support
PRODUCT_PACKAGES_DEBUG += \
aocdump \
aocutil \
aoc_audio_cfg \
vp_util

View file

@ -1,45 +0,0 @@
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package {
default_applicable_licenses: [
"//device/google/gs201:device_google_gs201_license",
],
}
cc_binary {
name: "battery_mitigation",
relative_install_path: "hw",
proprietary: true,
init_rc: ["battery_mitigation.rc"],
shared_libs: [
"libpixelmitigation",
"libbase",
"libbinder_ndk",
"libcutils",
"libhardware",
"libhidlbase",
"liblog",
"libutils",
"android.hardware.thermal@2.0"
],
srcs: [
"battery_mitigation.cpp",
],
cflags: [
"-Wall",
"-Werror",
],
}

View file

@ -1,109 +0,0 @@
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "battery-mitigation"
#include <battery_mitigation/BatteryMitigation.h>
using android::hardware::google::pixel::BatteryMitigation;
using android::hardware::google::pixel::MitigationConfig;
android::sp<BatteryMitigation> bmSp;
const struct MitigationConfig::Config cfg = {
.SystemPath = {
"/dev/thermal/tz-by-name/batoilo/temp",
"/dev/thermal/tz-by-name/smpl_gm/temp",
"/dev/thermal/tz-by-name/soc/temp",
"/dev/thermal/tz-by-name/vdroop1/temp",
"/dev/thermal/tz-by-name/vdroop2/temp",
"/dev/thermal/tz-by-name/ocp_gpu/temp",
"/dev/thermal/tz-by-name/ocp_tpu/temp",
"/dev/thermal/tz-by-name/soft_ocp_cpu2/temp",
"/dev/thermal/tz-by-name/soft_ocp_cpu1/temp",
"/dev/thermal/tz-by-name/battery/temp",
"/dev/thermal/tz-by-name/battery_cycle/temp",
"/sys/bus/iio/devices/iio:device0/lpf_power",
"/sys/bus/iio/devices/iio:device1/lpf_power",
"/dev/thermal/cdev-by-name/thermal-cpufreq-2/cur_state",
"/dev/thermal/cdev-by-name/thermal-cpufreq-1/cur_state",
"/dev/thermal/cdev-by-name/thermal-gpufreq-0/cur_state",
"/dev/thermal/cdev-by-name/tpu_cooling/cur_state",
"/dev/thermal/cdev-by-name/CAM/cur_state",
"/dev/thermal/cdev-by-name/DISP/cur_state",
"/dev/thermal/cdev-by-name/gxp-cooling/cur_state",
"/sys/class/power_supply/battery/voltage_now",
"/sys/class/power_supply/battery/current_now",
},
.FilteredZones = {
"batoilo",
"vdroop1",
"vdroop2",
"smpl_gm",
},
.SystemName = {
"batoilo", "smpl_gm", "soc", "vdroop1", "vdroop2", "ocp_gpu",
"ocp_tpu", "soft_ocp_cpu2", "soft_ocp_cpu1", "battery", "battery_cycle",
"main", "sub", "CPU2", "CPU1", "GPU", "TPU", "CAM", "DISP", "NPU",
"voltage_now", "current_now",
},
.LogFilePath = "/data/vendor/mitigation/thismeal.txt",
.TimestampFormat = "%Y-%m-%d %H:%M:%S",
};
const char kReadyFilePath[] = "/sys/devices/virtual/pmic/mitigation/instruction/ready";
const char kReadyProperty[] = "vendor.brownout.mitigation.ready";
const char kLastMealPath[] = "/data/vendor/mitigation/lastmeal.txt";
const char kBRRequestedProperty[] = "vendor.brownout_reason";
const std::regex kTimestampRegex("^\\S+\\s[0-9]+:[0-9]+:[0-9]+\\S+$");
int main(int /*argc*/, char ** /*argv*/) {
auto batteryMitigationStartTime = std::chrono::system_clock::now();
bmSp = new BatteryMitigation(cfg);
if (!bmSp) {
return 0;
}
bool mitigationLogTimeValid = bmSp->isMitigationLogTimeValid(batteryMitigationStartTime,
cfg.LogFilePath,
cfg.TimestampFormat,
kTimestampRegex);
std::string reason = android::base::GetProperty(kBRRequestedProperty, "");
if (!reason.empty() && mitigationLogTimeValid) {
std::ifstream src(cfg.LogFilePath, std::ios::in);
std::ofstream dst(kLastMealPath, std::ios::out);
dst << src.rdbuf();
}
bool isBatteryMitigationReady = false;
std::string ready_str;
int val = 0;
while (!isBatteryMitigationReady) {
if (!android::base::ReadFileToString(kReadyFilePath, &ready_str)) {
continue;
}
ready_str = android::base::Trim(ready_str);
if (!android::base::ParseInt(ready_str, &val)) {
continue;
}
if (val == 1) {
isBatteryMitigationReady = true;
}
}
android::base::SetProperty(kReadyProperty, "1");
while (true) {
pause();
}
return 0;
}

View file

@ -1,93 +0,0 @@
on property:vendor.thermal.link_ready=1
mkdir /data/vendor/mitigation 0755 system system
chown system system /data/vendor/mitigation
start vendor.battery_mitigation
on property:ro.boot.bootreason=reboot,uvlo,pmic,if && property:sys.boot.reason=reboot,uvlo,pmic,if
setprop vendor.brownout_reason "uvlo,pmic,if"
on property:ro.boot.bootreason=reboot,ocp,pmic,if && property:sys.boot.reason=reboot,ocp,pmic,if
setprop vendor.brownout_reason "ocp,pmic,if"
on property:ro.boot.bootreason=reboot,uvlo,pmic,main && property:sys.boot.reason=reboot,uvlo,pmic,main
setprop vendor.brownout_reason "uvlo,pmic,main"
on property:ro.boot.bootreason=reboot,uvlo,pmic,sub && property:sys.boot.reason=reboot,uvlo,pmic,sub
setprop vendor.brownout_reason "uvlo,pmic,sub"
on property:ro.boot.bootreason=reboot,ocp,buck1m && property:sys.boot.reason=reboot,ocp,buck1m
setprop vendor.brownout_reason "ocp,buck1m"
on property:ro.boot.bootreason=reboot,ocp,buck2m && property:sys.boot.reason=reboot,ocp,buck2m
setprop vendor.brownout_reason "ocp,buck2m"
on property:ro.boot.bootreason=reboot,ocp,buck3m && property:sys.boot.reason=reboot,ocp,buck3m
setprop vendor.brownout_reason "ocp,buck3m"
on property:ro.boot.bootreason=reboot,ocp,buck4m && property:sys.boot.reason=reboot,ocp,buck4m
setprop vendor.brownout_reason "ocp,buck4m"
on property:ro.boot.bootreason=reboot,ocp,buck5m && property:sys.boot.reason=reboot,ocp,buck5m
setprop vendor.brownout_reason "ocp,buck5m"
on property:ro.boot.bootreason=reboot,ocp,buck6m && property:sys.boot.reason=reboot,ocp,buck6m
setprop vendor.brownout_reason "ocp,buck6m"
on property:ro.boot.bootreason=reboot,ocp,buck7m && property:sys.boot.reason=reboot,ocp,buck7m
setprop vendor.brownout_reason "ocp,buck7m"
on property:ro.boot.bootreason=reboot,ocp,buck8m && property:sys.boot.reason=reboot,ocp,buck8m
setprop vendor.brownout_reason "ocp,buck8m"
on property:ro.boot.bootreason=reboot,ocp,buck9m && property:sys.boot.reason=reboot,ocp,buck9m
setprop vendor.brownout_reason "ocp,buck9m"
on property:ro.boot.bootreason=reboot,ocp,buck10m && property:sys.boot.reason=reboot,ocp,buck10m
setprop vendor.brownout_reason "ocp,buck10m"
on property:ro.boot.bootreason=reboot,ocp,buck1s && property:sys.boot.reason=reboot,ocp,buck1s
setprop vendor.brownout_reason "ocp,buck1s"
on property:ro.boot.bootreason=reboot,ocp,buck2s && property:sys.boot.reason=reboot,ocp,buck2s
setprop vendor.brownout_reason "ocp,buck2s"
on property:ro.boot.bootreason=reboot,ocp,buck3s && property:sys.boot.reason=reboot,ocp,buck3s
setprop vendor.brownout_reason "ocp,buck3s"
on property:ro.boot.bootreason=reboot,ocp,buck4s && property:sys.boot.reason=reboot,ocp,buck4s
setprop vendor.brownout_reason "ocp,buck4s"
on property:ro.boot.bootreason=reboot,ocp,buck5s && property:sys.boot.reason=reboot,ocp,buck5s
setprop vendor.brownout_reason "ocp,buck5s"
on property:ro.boot.bootreason=reboot,ocp,buck6s && property:sys.boot.reason=reboot,ocp,buck6s
setprop vendor.brownout_reason "ocp,buck6s"
on property:ro.boot.bootreason=reboot,ocp,buck7s && property:sys.boot.reason=reboot,ocp,buck7s
setprop vendor.brownout_reason "ocp,buck7s"
on property:ro.boot.bootreason=reboot,ocp,buck8s && property:sys.boot.reason=reboot,ocp,buck8s
setprop vendor.brownout_reason "ocp,buck8s"
on property:ro.boot.bootreason=reboot,ocp,buck9s && property:sys.boot.reason=reboot,ocp,buck9s
setprop vendor.brownout_reason "ocp,buck9s"
on property:ro.boot.bootreason=reboot,ocp,buck10s && property:sys.boot.reason=reboot,ocp,buck10s
setprop vendor.brownout_reason "ocp,buck10s"
on property:ro.boot.bootreason=reboot,ocp,buckds && property:sys.boot.reason=reboot,ocp,buckds
setprop vendor.brownout_reason "ocp,buckds"
on property:ro.boot.bootreason=reboot,ocp,buckas && property:sys.boot.reason=reboot,ocp,buckas
setprop vendor.brownout_reason "ocp,buckas"
on property:ro.boot.bootreason=reboot,ocp,buckcs && property:sys.boot.reason=reboot,ocp,buckcs
setprop vendor.brownout_reason "ocp,buckcs"
on property:ro.boot.bootreason=reboot,ocp,buckbs && property:sys.boot.reason=reboot,ocp,buckbs
setprop vendor.brownout_reason "ocp,buckbs"
service vendor.battery_mitigation /vendor/bin/hw/battery_mitigation
user system
group system
capabilities WAKE_ALARM BLOCK_SUSPEND

View file

@ -17,12 +17,6 @@ on init
chown system system /sys/devices/platform/sjtag_gsa/interface/dbg_itvl
chown system system /sys/devices/platform/sjtag_gsa/interface/end
chown system system /sys/devices/platform/sjtag_gsa/interface/pubkey
chown system system /d/maxfg/fg_model
chown system system /d/maxfg/registers
chown system system /d/maxfg_base/fg_model
chown system system /d/maxfg_base/registers
chown system system /d/maxfg_flip/registers
chown system system /d/maxfg_flip/nv_registers
on property:vendor.debug.ramdump.force_crash=true
write /sys/kernel/pixel_debug/trigger "null"
@ -39,6 +33,15 @@ on post-fs-data
chown bluetooth system /dev/logbuffer_btpower
chown bluetooth system /dev/logbuffer_tty18
# pKVM performance is different on A0 and B0 chips.
# Add extra tag to metrics collected on A0 to separate the results.
on property:ro.revision=PROTO1.0
setprop debug.hypervisor.metrics_tag "hwrev_a0"
on property:ro.revision=PROTO1.1
setprop debug.hypervisor.metrics_tag "hwrev_a0"
on property:ro.revision=EVT1.0
setprop debug.hypervisor.metrics_tag "hwrev_a0"
# Enable etm/etm2dram when ramdump is enabled.
on property:ro.boot.ramdump=enabled
write /sys/devices/platform/exynos-etm/etm_on 1

View file

@ -65,6 +65,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
@ -124,7 +132,7 @@ on init
symlink /data/app /factory
# Apply network parameters for high data performance.
write /proc/sys/net/core/rmem_default 327680
write /proc/sys/net/core/rmem_default 1310720
write /proc/sys/net/core/rmem_max 8388608
write /proc/sys/net/core/wmem_default 327680
write /proc/sys/net/core/wmem_max 8388608
@ -174,6 +182,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
@ -223,9 +241,10 @@ on init
chown system system /sys/devices/platform/10da0000.hsi2c/i2c-5/5-0050/eeprom
chown system system /sys/devices/platform/10da0000.hsi2c/i2c-6/6-0050/eeprom
chown system system /sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom
chown system system /sys/devices/platform/10da0000.hsi2c/i2c-9/9-0050/eeprom
# Loading common kernel modules in background
start insmod_sh_common
start init_display
# Charge stats (write 0)
chown system system /sys/class/power_supply/battery/charge_stats
@ -302,9 +321,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
@ -327,6 +343,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 late-fs
# Start bootanimation class before mount
start bootanim
@ -361,8 +380,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
# IPSEC PIDDIR for VoWiFi
mkdir /data/vendor/misc 0771 root system
mkdir /data/vendor/misc/vpn 0771 root system
@ -488,8 +505,6 @@ on early-boot
chown system system /dev/logbuffer_cpm
chown system system /dev/logbuffer_bd
chown system system /dev/logbuffer_dual_batt
chown system system /dev/logbuffer_pcie0
chown system system /dev/logbuffer_pcie1
on boot
@ -626,38 +641,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
@ -675,13 +658,6 @@ on property:vendor.device.modules.ready=1
chown system system /sys/devices/virtual/sec/tsp/cmd
chown system system /sys/devices/virtual/sec/tsp/cmd_result
chown system system /sys/devices/virtual/sec/tsp/status
chown system system /proc/goog_touch_interface/gti.0
chown system system /proc/goog_touch_interface/gti.0/ms_base
chown system system /proc/goog_touch_interface/gti.0/ms_diff
chown system system /proc/goog_touch_interface/gti.0/ms_raw
chown system system /proc/goog_touch_interface/gti.0/ss_base
chown system system /proc/goog_touch_interface/gti.0/ss_diff
chown system system /proc/goog_touch_interface/gti.0/ss_raw
# Allow access to touch
chown system input /dev/touch_offload
chmod 660 /dev/touch_offload
@ -744,7 +720,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}
@ -754,15 +730,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
@ -797,12 +780,6 @@ on property:sys.boot_completed=1
write /sys/devices/platform/18062080.pd-hsi0/power/async "enabled"
write /sys/devices/platform/14460000.pinctrl/power/async "enabled"
# Setup groups for SF (RT used for SF RE, SF used for SF main)
write /proc/vendor_sched/rt_uclamp_min 236
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
@ -899,19 +876,13 @@ on property:persist.sys.test_harness=1 && property:persist.vendor.testing_batte
on property:ro.debuggable=1
write /sys/module/scsi_mod/parameters/scsi_logging_level 63
service insmod_sh_common /vendor/bin/init.insmod.sh /vendor/etc/init.insmod.gs201.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
@ -928,13 +899,15 @@ 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
service storageproxyd /vendor/bin/storageproxyd -d /dev/trusty-ipc-dev0 \
-r /dev/sg1 -p /data/vendor/ss -t ufs
class early_hal
user root
user system
group system
# Write build info to kdebuginfo
on property:ro.build.fingerprint=*
@ -952,6 +925,9 @@ on post-fs-data
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.brownout.mitigation.ready=1
# BCL
@ -1010,16 +986,26 @@ on property:vendor.thermal.link_ready=1
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_therm/trip_point_0_temp
chown system system /dev/thermal/tz-by-name/usb_pwr_therm/trip_point_0_hyst
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/gxp-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/chg_mdis/cur_state
chown system system /dev/thermal/cdev-by-name/chg_mdis/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
@ -1075,7 +1061,7 @@ 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=*

View file

@ -71,6 +71,46 @@ 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 +175,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

View file

@ -16,6 +16,9 @@ on post-fs-data
# Modem MDS log folder
mkdir /data/vendor/radio/mds 0771 radio system
# Modem OTA UECap folder
mkdir /data/vendor/radio/ota_uecap 0773 radio system
# Unzipped modem images folder
mkdir /data/vendor/radio/image 0771 radio system

View file

@ -76,7 +76,7 @@
# jpeg
/dev/m2m1shot_jpeg 0660 media media
/dev/video12 0660 cameraserver media
/dev/video12 0660 system system
# audio
/dev/seiren 0660 system audio
@ -94,7 +94,9 @@
/dev/acd-debug 0660 system audio
/dev/acd-audio_tap* 0660 system audio
/dev/acd-audio_dcdoff_ref 0660 system audio
/dev/acd-mel_processor 0660 system audio
/dev/amcs 0660 system audio
/dev/acd-audio_rtp_* 0660 system radio
# Secure MEM driver
/dev/s5p-smem 0660 drm drmrpc
@ -142,6 +144,9 @@
# AoC
/dev/aoc 0660 system system
# AoC stats (UmfwStat)
/dev/acd-com.google.umfw_stat 0660 system system
# Sensors (USF)
/dev/acd-com.google.usf 0660 system system
/dev/acd-com.google.usf.non_wake_up 0660 system system
@ -222,3 +227,9 @@
# ODPM
/sys/bus/iio/devices/iio:device* enabled_rails 0660 system system
# sysfs LED nodes for external USB devices
/sys/devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.5.auto/usb2/2-1* brightness 0664 system system
/sys/devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.5.auto/usb2/2-1* multi_intensity 0664 system system
/sys/devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.4.auto/usb2/2-1* brightness 0664 system system
/sys/devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.4.auto/usb2/2-1* multi_intensity 0664 system system

View file

@ -85,8 +85,6 @@
<permission name="android.permission.READ_CALL_LOG" fixed="false"/>
<permission name="android.permission.WRITE_CALL_LOG" fixed="false"/>
<!-- Used to set up a Wi-Fi P2P network -->
<!-- TODO(b/231966826): Remove the location permission after Restore targets to T. -->
<permission name="android.permission.ACCESS_FINE_LOCATION" fixed="false"/>
<permission name="android.permission.NEARBY_WIFI_DEVICES" fixed="false"/>
<!-- Notifications -->
<permission name="android.permission.POST_NOTIFICATIONS" fixed="false"/>

216
device.mk
View file

@ -15,6 +15,23 @@
#
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/gs-common/camera/dump.mk
include device/google/gs-common/gxp/dump.mk
include device/google/gs-common/gps/dump/log.mk
include device/google/gs-common/radio/dump.mk
include device/google/gs-common/umfw_stat/umfw_stat.mk
include device/google/gs-common/gear/dumpstate/aidl.mk
include device/google/gs-common/widevine/widevine.mk
TARGET_BOARD_PLATFORM := gs201
@ -34,19 +51,19 @@ BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
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/gchips/gralloc4 \
hardware/google/graphics/common \
hardware/google/graphics/gs201 \
hardware/google/interfaces \
hardware/google/pixel \
device/google/gs201 \
device/google/gs201/powerstats \
system/chre/host/hal_generic \
vendor/google/whitechapel/tools \
vendor/google/interfaces \
vendor/google_devices/common/proprietary/confirmatioui_hal \
@ -98,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
@ -183,13 +200,14 @@ 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)))
ifeq ($(USES_GOOGLE_PREBUILT_MODEM_SVC),true)
USE_GOOGLE_PREBUILT_MODEM_SVC := true
endif
# Audio client implementation for RIL
USES_GAUDIO := true
endif
# ######################
# GRAPHICS - GPU (begin)
@ -217,6 +235,15 @@ PRODUCT_PACKAGES += \
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.vulkan=mali
# Mali Configuration Properties
# b/221255664 prevents setting PROTECTED_MAX_CORE_COUNT=2
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=1 \
vendor.mali.base_protected_tls_max=67108864 \
vendor.mali.platform_agt_frequency_khz=24576
ifeq ($(USE_SWIFTSHADER),true)
PRODUCT_PACKAGES += \
libGLESv1_CM_swiftshader \
@ -229,8 +256,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 += \
@ -240,10 +267,15 @@ 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 \
debug.renderengine.backend=skiaglthreaded \
debug.renderengine.backend=skiaglthreaded
# GRAPHICS - GPU (end)
# ####################
@ -312,12 +344,10 @@ PRODUCT_COPY_FILES += \
# Shell scripts
PRODUCT_COPY_FILES += \
device/google/gs201/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \
device/google/gs201/init.display.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.display.sh \
device/google/gs201/disable_contaminant_detection.sh:$(TARGET_COPY_OUT_VENDOR)/bin/hw/disable_contaminant_detection.sh
# insmod files
PRODUCT_COPY_FILES += \
device/google/gs201/init.insmod.gs201.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/init.insmod.gs201.cfg
include device/google/gs-common/insmod/insmod.mk
# For creating dtbo image
PRODUCT_HOST_PACKAGES += \
@ -397,8 +427,8 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.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 += \
@ -435,13 +465,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-service.gs201
# AoC support
include device/google/gs201/aoc/device.mk
#
# Audio HALs
#
@ -506,8 +529,8 @@ PANTHER_PRODUCT := %panther
CHEETAH_PRODUCT := %cheetah
LYNX_PRODUCT := %lynx
FELIX_PRODUCT := %felix
TANGOR_PRODUCT := %tangorpro
CLOUDRIPPER_PRODUCT := %cloudripper
TANGOR_PRODUCT := %tangorpro
ifneq (,$(filter $(PANTHER_PRODUCT), $(TARGET_PRODUCT)))
LOCAL_TARGET_PRODUCT := panther
else ifneq (,$(filter $(CHEETAH_PRODUCT), $(TARGET_PRODUCT)))
@ -516,10 +539,10 @@ else ifneq (,$(filter $(LYNX_PRODUCT), $(TARGET_PRODUCT)))
LOCAL_TARGET_PRODUCT := lynx
else ifneq (,$(filter $(FELIX_PRODUCT), $(TARGET_PRODUCT)))
LOCAL_TARGET_PRODUCT := felix
else ifneq (,$(filter $(TANGOR_PRODUCT), $(TARGET_PRODUCT)))
LOCAL_TARGET_PRODUCT := tangorpro
else ifneq (,$(filter $(CLOUDRIPPER_PRODUCT), $(TARGET_PRODUCT)))
LOCAL_TARGET_PRODUCT := cloudripper
else ifneq (,$(filter $(TANGOR_PRODUCT), $(TARGET_PRODUCT)))
LOCAL_TARGET_PRODUCT := tangorpro
else
# WAR: continue defaulting to slider build on gs201 to not
# break dev targets such as ravenclaw
@ -541,7 +564,7 @@ endif
# WiFi
PRODUCT_PACKAGES += \
android.hardware.wifi@1.0-service \
android.hardware.wifi-service \
wificond \
libwpa_client
@ -549,25 +572,21 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
ConnectivityOverlay
# Battery Mitigation
PRODUCT_PACKAGES += \
battery_mitigation
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_PACKAGES += BrownoutDetection
endif
PRODUCT_PACKAGES_DEBUG += \
f2fs_io \
check_f2fs \
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
# Battery Mitigation
include device/google/gs-common/battery_mitigation/bcl.mk
# storage pixelstats
-include hardware/google/pixel/pixelstats/device.mk
@ -582,7 +601,7 @@ $(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
endif
PRODUCT_PACKAGES_DEBUG += \
@ -622,7 +641,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 \
@ -795,9 +813,14 @@ endif
$(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 \
tipc-test
PRODUCT_PACKAGES_DEBUG += \
trusty-ut-ctrl \
tipc-test \
trusty_stats_test \
include device/google/gs101/confirmationui/confirmationui.mk
@ -806,11 +829,11 @@ PRODUCT_PACKAGES += \
securedpud.slider
# Trusty Metrics Daemon
#PRODUCT_SOONG_NAMESPACES += \
# vendor/google/trusty/common
#
#PRODUCT_PACKAGES += \
# trusty_metricsd
PRODUCT_SOONG_NAMESPACES += \
vendor/google/trusty/common
PRODUCT_PACKAGES += \
trusty_metricsd
$(call soong_config_set,google_displaycolor,displaycolor_platform,gs201)
PRODUCT_PACKAGES += \
@ -821,11 +844,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 += \
@ -851,6 +869,10 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_PRODUCT_PROPERTIES += \
persist.sys.fuse.passthrough.enable=true
# Use FUSE BPF
PRODUCT_PRODUCT_PROPERTIES += \
ro.fuse.bpf.enabled=true
# Use /product/etc/fstab.postinstall to mount system_other
PRODUCT_PRODUCT_PROPERTIES += \
ro.postinstall.fstab.prefix=/product
@ -893,6 +915,7 @@ PRODUCT_PACKAGES += ShannonIms
#RCS Test Messaging App
PRODUCT_PACKAGES_DEBUG += \
preinstalled-packages-product-gs201-device-debug.xml \
TestRcsApp
PRODUCT_PACKAGES += ShannonRcs
@ -913,6 +936,8 @@ SUPPORT_NR := true
SUPPORT_NR_DS := true
# Using IRadio 2.0
USE_RADIO_HAL_2_0 := true
# Support SecureElement HAL for HIDL
USE_SE_HIDL := true
# Using Early Send Device Info
USE_EARLY_SEND_DEVICE_INFO := true
@ -952,22 +977,19 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_COPY_FILES += \
device/google/$(TARGET_BOARD_PLATFORM)/conf/init.modem.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.modem.rc \
device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.modem:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.modem \
device/google/gs201/location/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer
#GPS HAL
include device/google/gs201/gnss/device-gnss.mk
include device/google/gs-common/gps/brcm/device.mk
endif
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs201-sepolicy/gps
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
#$(call inherit-product, hardware/google_devices/exynos5/exynos5.mk)
#$(call inherit-product-if-exists, hardware/google_devices/gs201/gs201.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/gs201/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)
@ -1001,63 +1023,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.soundtrigger@2.3-impl \
vendor.google.whitechapel.audio.audioext@4.0-impl \
android.hardware.bluetooth.audio-impl \
#
##Audio HAL libraries
PRODUCT_PACKAGES += \
audio.primary.$(TARGET_BOARD_PLATFORM) \
audio.platform.aoc \
audio_tunnel_aoc \
aoc_aud_ext \
libaoctuningdecoder \
liboffloadeffect \
audio_bt_aoc \
audio_waves_aoc \
audio_fortemedia_aoc \
audio_bluenote_aoc \
audio_usb_aoc \
audio_cca_aoc \
libamcsextfile \
audio_amcs_ext \
audio.usb.default \
audio.usbv2.default \
audio.bluetooth.default \
audio.r_submix.default \
audio_spk_35l41 \
sound_trigger.primary.$(TARGET_BOARD_PLATFORM)
# libaoc_waves \
#
##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/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 \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.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_gs201.mk
## AoC soong
PRODUCT_SOONG_NAMESPACES += \
@ -1118,10 +1084,13 @@ include device/google/gs101/telephony/pktrouter.mk
# Thermal HAL
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.enable.thermal.genl=true
include hardware/google/pixel/thermal/device.mk
$(call soong_config_set,thermal_hal_feature,pid,apply_2_0)
## TPU packages
include device/google/gs201/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,janeiro)
# TPU firmware
PRODUCT_PACKAGES += edgetpu-janeiro.fw
# Connectivity Thermal Power Manager
PRODUCT_PACKAGES += \
@ -1153,7 +1122,7 @@ PRODUCT_PROPERTY_OVERRIDES += \
# Suspend properties
PRODUCT_PROPERTY_OVERRIDES += \
suspend.short_suspend_threshold_millis=5000
suspend.short_suspend_threshold_millis=2000
# Enable Incremental on the device
PRODUCT_PROPERTY_OVERRIDES += \
@ -1176,11 +1145,12 @@ include hardware/google/pixel/wifi_ext/device.mk
# Battery Stats Viewer
PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer
PRODUCT_PACKAGES += dump_power_gs201.sh
# 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/gs201/device_framework_matrix_product.xml
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs201/device_framework_matrix_product.xml
# Preopt SystemUI
PRODUCT_DEXPREOPT_SPEED_APPS += SystemUIGoogle # For internal
@ -1197,3 +1167,9 @@ PRODUCT_COPY_FILES += \
# Call deleteAllKeys if vold detects a factory reset
PRODUCT_VENDOR_PROPERTIES += ro.crypto.metadata_init_delete_all_keys.enabled?=true
# Hardware Info
include hardware/google/pixel/HardwareInfo/HardwareInfo.mk
# UFS: the script is used to select the corresponding firmware to run FFU.
PRODUCT_PACKAGES += ufs_firmware_update.sh

View file

@ -47,6 +47,10 @@
<name>IDebugHost</name>
<instance>default</instance>
</interface>
<interface>
<name>IDebugManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>com.google.edgetpu</name>
@ -56,9 +60,17 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>com.google.edgetpu.dba</name>
<version>1</version>
<interface>
<name>IDevice</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>com.google.hardware.pixel.display</name>
<version>7</version>
<version>8</version>
<interface>
<name>IDisplay</name>
<instance>default</instance>
@ -66,6 +78,7 @@
</hal>
<hal format="aidl" optional="true">
<name>com.google.input</name>
<version>2</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
@ -87,38 +100,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>hardware.google.bluetooth.bt_channel_avoidance</name>
<version>1.0</version>
<interface>
<name>IBTChannelAvoidance</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>hardware.google.bluetooth.sar</name>
<version>1.1</version>
<interface>
<name>IBluetoothSar</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>hardware.google.bluetooth.ext</name>
<version>1.0</version>
<interface>
<name>IBluetoothExt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>hardware.google.bluetooth.ewp</name>
<version>1.0</version>
<interface>
<name>IBluetoothEwp</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.google.google_battery</name>
<version>2</version>
@ -135,30 +116,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.google.whitechapel.audio.audioext</name>
<version>4.0</version>
<interface>
<name>IAudioExt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<hal format="aidl" optional="true">
<name>vendor.google.wifi_ext</name>
<version>1.3</version>
<version>1</version>
<interface>
<name>IWifiExt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.google.wireless_charger</name>
<version>1.3</version>
<interface>
<name>IWirelessCharger</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.samsung_slsi.telephony.hardware.oemservice</name>
<version>1.0</version>
@ -177,12 +142,4 @@
<instance>rilExternal</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.google.audiometricext</name>
<version>1.0</version>
<interface>
<name>IAudioMetricExt</name>
<instance>default</instance>
</interface>
</hal>
</compatibility-matrix>

10
dumpstate/Android.bp Normal file
View file

@ -0,0 +1,10 @@
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
sh_binary {
name: "dump_power_gs201.sh",
src: "dump_power_gs201.sh",
vendor: true,
sub_dir: "dump",
}

View file

@ -1,44 +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-service.gs201
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.gs201.rc
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
Dumpstate.cpp \
service.cpp
LOCAL_SHARED_LIBRARIES := \
libbase \
libbinder_ndk \
libcutils \
libdumpstateutil \
liblog \
libutils \
android.hardware.dumpstate-V1-ndk
LOCAL_CFLAGS := -Werror -Wall
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_EXECUTABLE)

File diff suppressed because it is too large Load diff

View file

@ -1,96 +0,0 @@
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <aidl/android/hardware/dumpstate/BnDumpstateDevice.h>
#include <aidl/android/hardware/dumpstate/IDumpstateDevice.h>
#include <android/binder_status.h>
namespace aidl {
namespace android {
namespace hardware {
namespace dumpstate {
class Dumpstate : public BnDumpstateDevice {
public:
Dumpstate();
::ndk::ScopedAStatus dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds,
IDumpstateDevice::DumpstateMode in_mode,
int64_t in_timeoutMillis) override;
::ndk::ScopedAStatus getVerboseLoggingEnabled(bool* _aidl_return) override;
::ndk::ScopedAStatus setVerboseLoggingEnabled(bool in_enable) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
private:
const std::string kAllSections = "all";
std::vector<std::pair<std::string, std::function<void(int)>>> mTextSections;
std::vector<std::pair<std::string, std::function<void(int, const std::string &)>>> mLogSections;
void dumpLogs(int fd, std::string srcDir, std::string destDir, int maxFileNum,
const char *logPrefix);
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 dumpWlanSection(int fd);
void dumpModemSection(int fd);
void dumpPowerSection(int fd);
void dumpThermalSection(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 dumpTrustySection(int fd);
void dumpLEDSection(int fd);
void dumpPixelTraceSection(int fd);
void dumpPerfMetricsSection(int fd);
void dumpPCIeSection(int fd);
void dumpLogSection(int fd, int fdModem);
// Log sections to be dumped individually into dumpstate_board.bin
void dumpModemLogs(int fd, const std::string &destDir);
void dumpRadioLogs(int fd, const std::string &destDir);
void dumpCameraLogs(int fd, const std::string &destDir);
void dumpGpsLogs(int fd, const std::string &destDir);
void dumpGxpLogs(int fd, const std::string &destDir);
// Hybrid and binary sections that require an additional file descriptor
void dumpRilLogs(int fd, std::string destDir);
//bool getVerboseLoggingEnabledImpl();
//::ndk::ScopedAStatus dumpstateBoardImpl(const int fd, const bool full);
};
} // namespace dumpstate
} // namespace hardware
} // namespace android
} // namespace aidl

10
dumpstate/OWNERS Normal file
View file

@ -0,0 +1,10 @@
aaronding@google.com
rurumihong@google.com
adamshih@google.com
wilsonsung@google.com
lucaswei@google.com
cyanhsieh@google.com
rogerliao@google.com
cyuanjen@google.com
robinpeng@google.com
pattjin@google.com

1
dumpstate/README.txt Normal file
View file

@ -0,0 +1 @@
Please refer to go/pixel-recycle to modularize your code in this space.

View file

@ -1,5 +0,0 @@
service vendor.dumpstate-default /vendor/bin/hw/android.hardware.dumpstate-service.gs201
class hal
user system
group system
interface aidl android.hardware.dumpstate.IDumpstateDevice/default

View file

@ -0,0 +1,339 @@
#!/vendor/bin/sh
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"
if [ -d "/sys/class/power_supply/pca9468-mains/uevent" ]
then
echo "\n------ Power supply property pca9468-mains ------"
cat "/sys/class/power_supply/pca9468-mains/uevent"
else
echo "\n------ Power supply property pca94xx-mains ------"
cat "/sys/class/power_supply/pca94xx-mains/uevent"
fi
echo "\n------ Power supply property tcpm ------"
cat "/sys/class/power_supply/tcpm-source-psy-8-0025/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_monitor ------"
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_secondary ------"
cat "/sys/class/power_supply/maxfg_secondary/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_secondary ------"
cat "/dev/logbuffer_maxfg_secondary"
echo "\n------ maxfg_base_monitor ------"
cat "/dev/logbuffer_maxfg_base_monitor"
echo "\n------ maxfg_secondary_monitor ------"
cat "/dev/logbuffer_maxfg_secondary_monitor"
echo "\n------ google_dual_batt ------"
cat "/dev/logbuffer_dual_batt"
fi
if [ -e "/dev/maxfg_history" ]
then
echo "\n------ Maxim FG History ------"
xxd "/dev/maxfg_history"
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"
elif [ $build_type = "userdebug" ]
then
echo "\n------ TCPM logs ------"
if [ -d "/sys/kernel/debug/tcpm" ]
then
cat /sys/kernel/debug/tcpm/*
else
cat /sys/kernel/debug/usb/tcpm*
fi
fi
echo "\n------ TCPC ------"
for f in /sys/devices/platform/10d60000.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 "\nPOGO 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------ aacr_state ------"
cat "/sys/class/power_supply/battery/aacr_state"
echo "\n------ maxq ------"
cat "/dev/logbuffer_maxq"
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/pca94xx-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
echo "\n------ Maxim FG NV RAM ------"
for f in /d/maxfg*
do
regs=`cat $f/nv_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/10da0000.hsi2c/i2c-5/5-0050/eeprom" ]
then
xxd /sys/devices/platform/10da0000.hsi2c/i2c-5/5-0050/eeprom
fi
if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-6/6-0050/eeprom" ]
then
xxd /sys/devices/platform/10da0000.hsi2c/i2c-6/6-0050/eeprom
fi
if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom" ]
then
xxd /sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom
fi
if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-9/9-0050/eeprom" ]
then
xxd /sys/devices/platform/10da0000.hsi2c/i2c-9/9-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------ Lastmeal ------"
cat "/data/vendor/mitigation/lastmeal.txt"
echo "\n------ Thismeal ------"
cat "/data/vendor/mitigation/thismeal.txt"
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

View file

@ -1,37 +0,0 @@
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.dumpstate-service.gs201"
#include "Dumpstate.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::dumpstate::Dumpstate;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<Dumpstate> dumpstate = ndk::SharedRefBase::make<Dumpstate>();
const std::string instance = std::string() + Dumpstate::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(dumpstate->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // Unreachable
}

View file

@ -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

View file

@ -1,28 +0,0 @@
# Edgetpu packages
# Config variables for TPU chip on device.
$(call soong_config_set,edgetpu_config,chip,janeiro)
# TPU logging service
PRODUCT_PACKAGES += \
android.hardware.edgetpu.logging@service-edgetpu-logging
# TPU firmware
PRODUCT_PACKAGES += \
edgetpu-janeiro.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/
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs201-sepolicy/edgetpu/

View file

@ -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/gs201:device_google_gs201_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: [
"//device/google/gs201:device_google_gs201_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,
},
}

View file

@ -1,7 +0,0 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.gnss</name>
<version>2</version>
<fqname>IGnss/default</fqname>
</hal>
</manifest>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -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/<GPS_HARDWARE_MODULE_ID>.<ro.hardware>.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

View file

@ -1,19 +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/gs201/gnss/47765/config/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer \
device/google/gs201/gnss/47765/firmware/SensorHub.patch:$(TARGET_COPY_OUT_VENDOR)/firmware/SensorHub.patch
PRODUCT_SOONG_NAMESPACES += \
device/google/gs201/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

View file

@ -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 <errno.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#define LOG_TAG "gps_dummy"
#include <log/log.h>
//#include <cutils/sockets.h>
#include <hardware/gps.h>
#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,
};

22
init.display.sh Executable file
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -162,7 +162,7 @@ static bool DevInfoSync() {
return false;
}
android::base::unique_fd fd(open(DEVINFO_PATH, O_WRONLY));
android::base::unique_fd fd(open(DEVINFO_PATH, O_WRONLY | O_DSYNC));
return android::base::WriteFully(fd, &devinfo, sizeof devinfo);
}
@ -270,13 +270,13 @@ Return<void> BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb
std::string boot_lun_path =
std::string("/sys/devices/platform/") + boot_dev + "/pixel/boot_lun_enabled";
int fd = open(boot_lun_path.c_str(), O_RDWR);
int fd = open(boot_lun_path.c_str(), O_RDWR | O_DSYNC);
if (fd < 0) {
// Try old path for kernels < 5.4
// TODO: remove once kernel 4.19 support is deprecated
std::string boot_lun_path =
std::string("/sys/devices/platform/") + boot_dev + "/attributes/boot_lun_enabled";
fd = open(boot_lun_path.c_str(), O_RDWR);
fd = open(boot_lun_path.c_str(), O_RDWR | O_DSYNC);
if (fd < 0) {
_hidl_cb({false, "failed to open ufs attr boot_lun_enabled"});
return Void();

View file

@ -1,31 +1,4 @@
<manifest version="1.0" type="device" target-level="7">
<hal format="hidl">
<name>android.hardware.audio</name>
<transport>hwbinder</transport>
<version>7.1</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.audio.effect</name>
<transport>hwbinder</transport>
<version>7.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.soundtrigger</name>
<transport>hwbinder</transport>
<version>2.3</version>
<interface>
<name>ISoundTriggerHw</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.graphics.allocator</name>
<transport>hwbinder</transport>
@ -126,6 +99,7 @@
</hal>
<hal format="aidl">
<name>com.google.input</name>
<version>2</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
@ -139,22 +113,4 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.google.whitechapel.audio.audioext</name>
<transport>hwbinder</transport>
<version>4.0</version>
<interface>
<name>IAudioExt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.google.audiometricext</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IAudioMetricExt</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View file

@ -1,31 +1,4 @@
<manifest version="1.0" type="device" target-level="7">
<hal format="hidl">
<name>android.hardware.audio</name>
<transport>hwbinder</transport>
<version>7.1</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.audio.effect</name>
<transport>hwbinder</transport>
<version>7.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.soundtrigger</name>
<transport>hwbinder</transport>
<version>2.3</version>
<interface>
<name>ISoundTriggerHw</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.graphics.mapper</name>
<transport arch="32+64">passthrough</transport>
@ -35,13 +8,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl">
<name>android.hardware.dumpstate</name>
<interface>
<name>IDumpstateDevice</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.boot</name>
<transport>hwbinder</transport>
@ -59,27 +25,10 @@
</hal>
<hal format="aidl">
<name>com.google.input</name>
<version>2</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.google.whitechapel.audio.audioext</name>
<transport>hwbinder</transport>
<version>4.0</version>
<interface>
<name>IAudioExt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.google.audiometricext</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IAudioMetricExt</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View file

@ -49,11 +49,11 @@
<Feature name="low-latency" />
</MediaCodec>
<MediaCodec name="c2.exynos.hevc.decoder" type="video/hevc" >
<Limit name="size" min="64x64" max="3840x2160" />
<Limit name="size" min="64x64" max="3840x2176" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="block-count" range="1-32400" />
<Limit name="blocks-per-second" min="1" max="3888000" />
<Limit name="block-count" range="1-32640" />
<Limit name="blocks-per-second" min="1" max="3916800" />
<Limit name="bitrate" range="1-120000000" />
<Limit name="performance-point-1920x1080" range="240" />
<Limit name="performance-point-3840x2160" range="120" />
@ -176,12 +176,13 @@
<Limit name="performance-point-1920x1080" range="240" />
<Limit name="performance-point-3840x2160" range="120" />
<Limit name="concurrent-instances" max="16" />
<Limit name="quality" range="0-100" default="57" />
<Feature name="can-swap-width-height" value="1" />
<Feature name="vq-minimum-quality"/>
<Feature name="qp-bounds"/>
<Feature name="encoding-statistics"/>
<Feature name="hdr-editing" />
<Feature name="bitrate-modes" value="VBR,CBR,CBR-FD" />
<Feature name="bitrate-modes" value="VBR,CBR,CQ,CBR-FD" />
</MediaCodec>
<MediaCodec name="c2.exynos.mpeg4.encoder" type="video/mp4v-es">
<Limit name="size" min="32x32" max="2048x2048" />

View file

@ -155,28 +155,24 @@
<Limit name="measured-frame-rate-1920x1080" range="75-112" />
</MediaCodec>
<MediaCodec name="c2.google.av1.decoder" type="video/av01" update="true">
<!-- measured 90%:295-301 med:296 N=2 -->
<Limit name="measured-frame-rate-352x288" range="295-298" /> <!-- v90%=1.0 -->
<!-- measured 90%:196-207 med:196 N=2 -->
<Limit name="measured-frame-rate-640x360" range="196-201" /> <!-- v90%=1.0 -->
<!-- measured 90%:177-180 med:178 N=2 -->
<Limit name="measured-frame-rate-720x480" range="177-178" /> <!-- v90%=1.0 -->
<!-- measured 90%:81-82 med:82 N=2 -->
<Limit name="measured-frame-rate-1280x720" range="81-82" /> <!-- v90%=1.0 -->
<!-- measured 90%:45-47 med:46 N=2 -->
<Limit name="measured-frame-rate-1920x1080" range="45-46" /> <!-- v90%=1.0 -->
<Limit name="measured-frame-rate-352x288" range="630-748" />
<Limit name="measured-frame-rate-640x360" range="586-700" />
<Limit name="measured-frame-rate-720x480" range="575-690" />
<Limit name="measured-frame-rate-1280x720" range="247-460" />
<Limit name="measured-frame-rate-1920x1080" range="219-252" />
</MediaCodec>
<MediaCodec name="c2.google.av1.decoder.secure" type="video/av01" update="true">
<!-- measured 90%:295-301 med:296 N=2 -->
<Limit name="measured-frame-rate-352x288" range="295-298" /> <!-- v90%=1.0 -->
<!-- measured 90%:196-207 med:196 N=2 -->
<Limit name="measured-frame-rate-640x360" range="196-201" /> <!-- v90%=1.0 -->
<!-- measured 90%:177-180 med:178 N=2 -->
<Limit name="measured-frame-rate-720x480" range="177-178" /> <!-- v90%=1.0 -->
<!-- measured 90%:81-82 med:82 N=2 -->
<Limit name="measured-frame-rate-1280x720" range="81-82" /> <!-- v90%=1.0 -->
<!-- measured 90%:45-47 med:46 N=2 -->
<Limit name="measured-frame-rate-1920x1080" range="45-46" /> <!-- v90%=1.0 -->
<Limit name="measured-frame-rate-352x288" range="630-748" />
<Limit name="measured-frame-rate-640x360" range="586-700" />
<Limit name="measured-frame-rate-720x480" range="575-690" />
<Limit name="measured-frame-rate-1280x720" range="247-460" />
<Limit name="measured-frame-rate-1920x1080" range="219-252" />
</MediaCodec>
<MediaCodec name="c2.android.av1.decoder" type="video/av01" update="true">
<Limit name="measured-frame-rate-352x288" range="358-383" />
<Limit name="measured-frame-rate-640x360" range="207-221" />
<Limit name="measured-frame-rate-720x480" range="106-148" />
<Limit name="measured-frame-rate-1280x720" range="65-71" />
</MediaCodec>
</Decoders>
@ -251,5 +247,13 @@
<Limit name="measured-frame-rate-640x360" range="91-136" />
<Limit name="measured-frame-rate-1280x720" range="24-36" />
</MediaCodec>
<MediaCodec name="c2.android.av1.encoder" type="video/av01" update="true">
<!-- measured 90%:354-361 med:355 N=2 -->
<Limit name="measured-frame-rate-320x240" range="354-358" /> <!-- v90%=1.0 -->
<!-- measured 90%:81-85 med:81 N=2 -->
<Limit name="measured-frame-rate-720x480" range="81-83" /> <!-- v90%=1.0 -->
<!-- measured 90%:32-33 med:33 N=2 -->
<Limit name="measured-frame-rate-1280x720" range="32-33" /> <!-- v90%=1.0 -->
</MediaCodec>
</Encoders>
</MediaCodecs>

View file

@ -289,10 +289,4 @@
<item>"com.shannon.imsservice"</item>
<item>"com.android.phone"</item>
</string-array>
<!-- The list of packages to force slowJpegMode for Apps using Camera API1 -->
<string-array name="config_forceSlowJpegModeList" translatable="false">
<item>com.facebook.orca</item>
<item>com.skype.raider</item>
</string-array>
</resources>

View file

@ -26,5 +26,5 @@
<!-- Doze: does this device support STATE_DOZE_SUSPEND? -->
<bool name="doze_suspend_display_state_supported">false</bool>
<string name="config_rounded_mask">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</string>
<string name="config_rounded_mask" translatable="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</string>
</resources>

View file

@ -68,7 +68,16 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
"/sys/devices/platform/100b0000.AUR/trip_counter",
},
.CCARatePath = "/sys/devices/platform/audiometrics/cca_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"
}
},
.ResumeLatencyMetricsPath = "/sys/kernel/metrics/resume_latency/resume_latency_metrics",
.LongIRQMetricsPath = "/sys/kernel/metrics/irq/long_irq_metrics",
.ModemPcieLinkStatsPath = "/sys/devices/platform/11920000.pcie/link_stats",
@ -77,7 +86,6 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
const struct UeventListener::UeventPaths ueventPaths = {
.AudioUevent = "/devices/virtual/amcs/amcs",
.WirelessChargerPtmcPath = "/sys/class/power_supply/wireless/device/ptmc_id",
.TypeCPartnerUevent = "PRODUCT_TYPE="};
int main() {

View file

@ -16,6 +16,7 @@
#include <PowerStatsAidl.h>
#include <Gs201CommonDataProviders.h>
#include <AdaptiveDvfsStateResidencyDataProvider.h>
#include <AocTimedStateResidencyDataProvider.h>
#include <DevfreqStateResidencyDataProvider.h>
#include <DvfsStateResidencyDataProvider.h>
@ -33,6 +34,7 @@
#include <android/binder_process.h>
#include <log/log.h>
using aidl::android::hardware::power::stats::AdaptiveDvfsStateResidencyDataProvider;
using aidl::android::hardware::power::stats::AocTimedStateResidencyDataProvider;
using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider;
using aidl::android::hardware::power::stats::DvfsStateResidencyDataProvider;
@ -166,6 +168,15 @@ void addAoC(std::shared_ptr<PowerStats> p) {
void addDvfsStats(std::shared_ptr<PowerStats> p) {
// A constant to represent the number of nanoseconds in one millisecond
const int NS_TO_MS = 1000000;
std::string path = "/sys/devices/platform/acpm_stats/fvp_stats";
std::vector<std::pair<std::string, std::string>> adpCfgs = {
std::make_pair("CL0", "/sys/devices/system/cpu/cpufreq/policy0/stats"),
std::make_pair("CL1", "/sys/devices/system/cpu/cpufreq/policy4/stats"),
std::make_pair("CL2", "/sys/devices/system/cpu/cpufreq/policy6/stats")
};
p->addStateResidencyDataProvider(std::make_unique<AdaptiveDvfsStateResidencyDataProvider>(
path, NS_TO_MS, adpCfgs));
std::vector<DvfsStateResidencyDataProvider::Config> cfgs;
@ -187,7 +198,7 @@ void addDvfsStats(std::shared_ptr<PowerStats> p) {
}});
p->addStateResidencyDataProvider(std::make_unique<DvfsStateResidencyDataProvider>(
"/sys/devices/platform/acpm_stats/fvp_stats", NS_TO_MS, cfgs));
path, NS_TO_MS, cfgs));
}
void addSoC(std::shared_ptr<PowerStats> p) {
@ -523,18 +534,6 @@ void addPowerDomains(std::shared_ptr<PowerStats> p) {
}
void addDevfreq(std::shared_ptr<PowerStats> p) {
p->addStateResidencyDataProvider(std::make_unique<DevfreqStateResidencyDataProvider>(
"CL0",
"/sys/devices/system/cpu/cpufreq/policy0/stats"));
p->addStateResidencyDataProvider(std::make_unique<DevfreqStateResidencyDataProvider>(
"CL1",
"/sys/devices/system/cpu/cpufreq/policy4/stats"));
p->addStateResidencyDataProvider(std::make_unique<DevfreqStateResidencyDataProvider>(
"CL2",
"/sys/devices/system/cpu/cpufreq/policy6/stats"));
p->addStateResidencyDataProvider(std::make_unique<DevfreqStateResidencyDataProvider>(
"MIF",
"/sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif"));
@ -601,6 +600,14 @@ void addPixelStateResidencyDataProvider(std::shared_ptr<PowerStats> p) {
p->addStateResidencyDataProvider(std::move(pixelSdp));
}
void addCamera(std::shared_ptr<PowerStats> p) {
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
p,
EnergyConsumerType::CAMERA,
"CAMERA",
{"VSYS_PWR_CAM"}));
}
void addGs201CommonDataProviders(std::shared_ptr<PowerStats> p) {
setEnergyMeter(p);
@ -618,6 +625,7 @@ void addGs201CommonDataProviders(std::shared_ptr<PowerStats> p) {
addPowerDomains(p);
addDevfreq(p);
addTPU(p);
addCamera(p);
}
void addNFC(std::shared_ptr<PowerStats> p, const std::string& path) {

View file

@ -22,6 +22,7 @@ using aidl::android::hardware::power::stats::PowerStats;
void addAoC(std::shared_ptr<PowerStats> p);
void addCPUclusters(std::shared_ptr<PowerStats> p);
void addCamera(std::shared_ptr<PowerStats> p);
void addDevfreq(std::shared_ptr<PowerStats> p);
void addDvfsStats(std::shared_ptr<PowerStats> p);
void addGNSS(std::shared_ptr<PowerStats> p);

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- System packages to preinstall on gs201 debug devices, per user type.
Documentation at frameworks/base/data/etc/preinstalled-packages-platform.xml
-->
<config>
<!-- Battery Stats Viewer -->
<install-in-user-type package="com.android.frameworks.core.batterystatsviewer">
<install-in user-type="FULL" />
<install-in user-type="PROFILE" />
<do-not-install-in user-type="android.os.usertype.profile.CLONE" />
</install-in-user-type>
<!-- RCS (Rich Communication Services)
TODO(b/259401601): Check if this should be preinstalled for SYSTEM user -->
<install-in-user-type package="com.google.android.sample.rcsclient">
<install-in user-type="SYSTEM" />
<install-in user-type="FULL" />
<install-in user-type="PROFILE" />
<do-not-install-in user-type="android.os.usertype.profile.CLONE" />
</install-in-user-type>
</config>

Binary file not shown.

View file

@ -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
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

View file

@ -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 <math.h>
#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);

View file

@ -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/<SENSORS_HARDWARE_MODULE_ID>.<ro.hardware>.so
include $(CLEAR_VARS)
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware
LOCAL_SRC_FILES := sensors_dummy.c
LOCAL_MODULE := sensors.gs201
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

View file

@ -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 <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <log/log.h>
#include <cutils/sockets.h>
#include <hardware/sensors.h>
#include <pthread.h>
#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<<MAX_NUM_SENSORS)-1)
#define ID_BASE SENSORS_HANDLE_BASE
#define ID_ACCELERATION (ID_BASE+0)
#define ID_MAGNETIC_FIELD (ID_BASE+1)
#define ID_ORIENTATION (ID_BASE+2)
#define ID_TEMPERATURE (ID_BASE+3)
#define ID_PROXIMITY (ID_BASE+4)
#define ID_LIGHT (ID_BASE+5)
#define ID_PRESSURE (ID_BASE+6)
#define ID_HUMIDITY (ID_BASE+7)
#define SENSORS_ACCELERATION (1 << ID_ACCELERATION)
#define SENSORS_MAGNETIC_FIELD (1 << ID_MAGNETIC_FIELD)
#define SENSORS_ORIENTATION (1 << ID_ORIENTATION)
#define SENSORS_TEMPERATURE (1 << ID_TEMPERATURE)
#define SENSORS_PROXIMITY (1 << ID_PROXIMITY)
#define SENSORS_LIGHT (1 << ID_LIGHT)
#define SENSORS_PRESSURE (1 << ID_PRESSURE)
#define SENSORS_HUMIDITY (1 << ID_HUMIDITY)
#define ID_CHECK(x) ((unsigned)((x) - ID_BASE) < MAX_NUM_SENSORS)
#define SENSORS_LIST \
SENSOR_(ACCELERATION,"acceleration") \
SENSOR_(MAGNETIC_FIELD,"magnetic-field") \
SENSOR_(ORIENTATION,"orientation") \
SENSOR_(TEMPERATURE,"temperature") \
SENSOR_(PROXIMITY,"proximity") \
SENSOR_(LIGHT, "light") \
SENSOR_(PRESSURE, "pressure") \
SENSOR_(HUMIDITY, "humidity")
static const struct {
const char* name;
int id; } _sensorIds[MAX_NUM_SENSORS] =
{
#define SENSOR_(x,y) { y, ID_##x },
SENSORS_LIST
#undef SENSOR_
};
static const char*
_sensorIdToName( int id )
{
int nn;
for (nn = 0; nn < MAX_NUM_SENSORS; nn++)
if (id == _sensorIds[nn].id)
return _sensorIds[nn].name;
return "<UNKNOWN>";
}
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
};

27
storage/Android.bp Normal file
View file

@ -0,0 +1,27 @@
//
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: [
"//device/google/gs201:device_google_gs201_license",
],
}
sh_binary {
name: "ufs_firmware_update.sh",
src: "ufs_firmware_update.sh",
init_rc: ["storage.gs201.rc"],
vendor: true,
}

7
storage/storage.gs201.rc Normal file
View file

@ -0,0 +1,7 @@
on property:sys.boot_completed=1
# Copy ufs firmware to disk
start ufs_firmware_update
service ufs_firmware_update /vendor/bin/ufs_firmware_update.sh
disabled
oneshot

19
storage/ufs_firmware_update.sh Executable file
View file

@ -0,0 +1,19 @@
#!/vendor/bin/sh
#
# The script belongs to the feature of UFS FFU via OTA: go/p23-ffu-ota
# Its purpose is to copy the corresponding firmware into partition for UFS FFU.
ufs_dev="/dev/sys/block/bootdevice"
fw_dir="/vendor/firmware"
blk_dev="/dev/block/by-name/fips"
vendor=$(cat ${ufs_dev}/vendor | tr -d "[:space:]")
model=$(cat ${ufs_dev}/model | tr -d "[:space:]")
rev=$(cat ${ufs_dev}/rev | tr -d "[:space:]")
file=$(find ${fw_dir} -name "*${vendor}${model}${rev}*" | head -n 1)
if [ -n "$file" ]; then
# The first 4KB block at fips partition has been occupied, and unused space begins from 4 KB
# Refer to: go/pixel-mp-ffu-ota-1p
dd if="$file" of=$blk_dev bs=4k seek=1
fi

View file

@ -287,7 +287,7 @@
},
{
"Name": "OtaProfiles",
"Profiles": [ "OtaPerformance", "ServiceCapacityLow", "LowIoPriority", "TimerSlackHigh" ]
"Profiles": [ "OtaPerformance", "ProcessCapacityNormal", "LowIoPriority", "TimerSlackHigh" ]
}
]
}

View file

View file

View file

@ -29,19 +29,21 @@ cc_binary {
vintf_fragments: [
"android.hardware.usb.gadget-service.xml",
],
vendor: true,
srcs: ["service_gadget.cpp", "UsbGadget.cpp"],
cflags: ["-Wall", "-Werror"],
shared_libs: [
"libbase",
"libhidlbase",
"liblog",
"libutils",
"libhardware",
"android.hardware.usb.gadget@1.0",
"android.hardware.usb.gadget@1.1",
"android.hardware.usb.gadget@1.2",
"android.frameworks.stats-V1-ndk",
"android.hardware.usb.gadget-V1-ndk",
"libcutils",
"libbinder_ndk",
],
static_libs: ["libpixelusb"],
static_libs: ["libpixelusb-aidl"],
proprietary: true,
export_shared_lib_headers: [
"android.frameworks.stats-V1-ndk",
],
}

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
#define LOG_TAG "android.hardware.usb.gadget@1.2-service.gs201"
#define LOG_TAG "android.hardware.usb.gadget.aidl-service"
#include "UsbGadget.h"
#include <dirent.h>
@ -26,12 +26,18 @@
#include <sys/types.h>
#include <unistd.h>
#include <android-base/properties.h>
#include <aidl/android/frameworks/stats/IStats.h>
namespace aidl {
namespace android {
namespace hardware {
namespace usb {
namespace gadget {
namespace V1_2 {
namespace implementation {
using ::android::base::GetBoolProperty;
using ::android::hardware::google::pixel::usb::kUvcEnabled;
string enabledPath;
constexpr char kHsi2cPath[] = "/sys/devices/platform/10d60000.hsi2c";
@ -46,7 +52,7 @@ UsbGadget::UsbGadget() : mGadgetIrqPath("") {
}
}
V1_0::Status UsbGadget::getUsbGadgetIrqPath() {
Status UsbGadget::getUsbGadgetIrqPath() {
std::string irqs;
size_t read_pos = 0;
size_t found_pos = 0;
@ -93,17 +99,20 @@ void currentFunctionsAppliedCallback(bool functionsApplied, void *payload) {
gadget->mCurrentUsbFunctionsApplied = functionsApplied;
}
Return<void> UsbGadget::getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback> &callback) {
Return<void> ret = callback->getCurrentUsbFunctionsCb(
ScopedAStatus UsbGadget::getCurrentUsbFunctions(const shared_ptr<IUsbGadgetCallback> &callback,
int64_t in_transactionId) {
ScopedAStatus ret = callback->getCurrentUsbFunctionsCb(
mCurrentUsbFunctions,
mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED);
mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED,
in_transactionId);
if (!ret.isOk())
ALOGE("Call to getCurrentUsbFunctionsCb failed %s", ret.description().c_str());
ALOGE("Call to getCurrentUsbFunctionsCb failed %s", ret.getDescription().c_str());
return Void();
return ScopedAStatus::ok();
}
Return<void> UsbGadget::getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback) {
ScopedAStatus UsbGadget::getUsbSpeed(const shared_ptr<IUsbGadgetCallback> &callback,
int64_t in_transactionId) {
std::string current_speed;
if (ReadFileToString(SPEED_PATH, &current_speed)) {
current_speed = Trim(current_speed);
@ -121,25 +130,26 @@ Return<void> UsbGadget::getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback
else if (current_speed == "UNKNOWN")
mUsbSpeed = UsbSpeed::UNKNOWN;
else
mUsbSpeed = UsbSpeed::RESERVED_SPEED;
mUsbSpeed = UsbSpeed::UNKNOWN;
} else {
ALOGE("Fail to read current speed");
mUsbSpeed = UsbSpeed::UNKNOWN;
}
if (callback) {
Return<void> ret = callback->getUsbSpeedCb(mUsbSpeed);
ScopedAStatus ret = callback->getUsbSpeedCb(mUsbSpeed, in_transactionId);
if (!ret.isOk())
ALOGE("Call to getUsbSpeedCb failed %s", ret.description().c_str());
ALOGE("Call to getUsbSpeedCb failed %s", ret.getDescription().c_str());
}
return Void();
return ScopedAStatus::ok();
}
V1_0::Status UsbGadget::tearDownGadget() {
if (resetGadget() != Status::SUCCESS)
Status UsbGadget::tearDownGadget() {
if (Status(resetGadget()) != Status::SUCCESS){
return Status::ERROR;
}
if (monitorFfs.isMonitorRunning()) {
monitorFfs.reset();
@ -149,137 +159,174 @@ V1_0::Status UsbGadget::tearDownGadget() {
return Status::SUCCESS;
}
static V1_0::Status validateAndSetVidPid(uint64_t functions) {
V1_0::Status ret = Status::SUCCESS;
static Status validateAndSetVidPid(uint64_t functions) {
Status ret = Status::SUCCESS;
std::string vendorFunctions = getVendorFunctions();
switch (functions) {
case static_cast<uint64_t>(GadgetFunction::MTP):
case GadgetFunction::MTP:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee1");
ret = Status(setVidPid("0x18d1", "0x4ee1"));
}
break;
case GadgetFunction::ADB | GadgetFunction::MTP:
case GadgetFunction::ADB |
GadgetFunction::MTP:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee2");
ret = Status(setVidPid("0x18d1", "0x4ee2"));
}
break;
case static_cast<uint64_t>(GadgetFunction::RNDIS):
case GadgetFunction::RNDIS:
case GadgetFunction::RNDIS |
GadgetFunction::NCM:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee3");
ret = Status(setVidPid("0x18d1", "0x4ee3"));
}
break;
case GadgetFunction::ADB | GadgetFunction::RNDIS:
case GadgetFunction::ADB |
GadgetFunction::RNDIS:
case GadgetFunction::ADB |
GadgetFunction::RNDIS |
GadgetFunction::NCM:
if (vendorFunctions == "dm") {
ret = setVidPid("0x04e8", "0x6862");
ret = Status(setVidPid("0x04e8", "0x6862"));
} else {
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee4");
ret = Status(setVidPid("0x18d1", "0x4ee4"));
}
}
break;
case static_cast<uint64_t>(GadgetFunction::PTP):
case GadgetFunction::PTP:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee5");
ret = Status(setVidPid("0x18d1", "0x4ee5"));
}
break;
case GadgetFunction::ADB | GadgetFunction::PTP:
case GadgetFunction::ADB |
GadgetFunction::PTP:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee6");
ret = Status(setVidPid("0x18d1", "0x4ee6"));
}
break;
case static_cast<uint64_t>(GadgetFunction::ADB):
case GadgetFunction::ADB:
if (vendorFunctions == "dm") {
ret = setVidPid("0x04e8", "0x6862");
ret = Status(setVidPid("0x04e8", "0x6862"));
} else if (vendorFunctions == "etr_miu") {
ret = setVidPid("0x18d1", "0x4ee2");
} else if (vendorFunctions == "uwb_acm") {
ret = setVidPid("0x18d1", "0x4ee2");
ret = Status(setVidPid("0x18d1", "0x4ee2"));
} else if (vendorFunctions == "uwb_acm"){
ret = Status(setVidPid("0x18d1", "0x4ee2"));
} else {
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee7");
ret = Status(setVidPid("0x18d1", "0x4ee7"));
}
}
break;
case static_cast<uint64_t>(GadgetFunction::MIDI):
case GadgetFunction::MIDI:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee8");
ret = Status(setVidPid("0x18d1", "0x4ee8"));
}
break;
case GadgetFunction::ADB | GadgetFunction::MIDI:
case GadgetFunction::ADB |
GadgetFunction::MIDI:
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee9");
ret = Status(setVidPid("0x18d1", "0x4ee9"));
}
break;
case static_cast<uint64_t>(GadgetFunction::ACCESSORY):
case GadgetFunction::ACCESSORY:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x2d00");
ret = Status(setVidPid("0x18d1", "0x2d00"));
break;
case GadgetFunction::ADB | GadgetFunction::ACCESSORY:
case GadgetFunction::ADB |
GadgetFunction::ACCESSORY:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x2d01");
ret = Status(setVidPid("0x18d1", "0x2d01"));
break;
case static_cast<uint64_t>(GadgetFunction::AUDIO_SOURCE):
case GadgetFunction::AUDIO_SOURCE:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x2d02");
ret = Status(setVidPid("0x18d1", "0x2d02"));
break;
case GadgetFunction::ADB | GadgetFunction::AUDIO_SOURCE:
case GadgetFunction::ADB |
GadgetFunction::AUDIO_SOURCE:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x2d03");
ret = Status(setVidPid("0x18d1", "0x2d03"));
break;
case GadgetFunction::ACCESSORY | GadgetFunction::AUDIO_SOURCE:
case GadgetFunction::ACCESSORY |
GadgetFunction::AUDIO_SOURCE:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x2d04");
ret = Status(setVidPid("0x18d1", "0x2d04"));
break;
case GadgetFunction::ADB | GadgetFunction::ACCESSORY | GadgetFunction::AUDIO_SOURCE:
case GadgetFunction::ADB |
GadgetFunction::ACCESSORY |
GadgetFunction::AUDIO_SOURCE:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x2d05");
ret = Status(setVidPid("0x18d1", "0x2d05"));
break;
case static_cast<uint64_t>(GadgetFunction::NCM):
case GadgetFunction::NCM:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4eeb");
ret = Status(setVidPid("0x18d1", "0x4eeb"));
break;
case GadgetFunction::ADB | GadgetFunction::NCM:
case GadgetFunction::ADB |
GadgetFunction::NCM:
if (vendorFunctions == "dm") {
ret = setVidPid("0x04e8", "0x6862");
ret = Status(setVidPid("0x04e8", "0x6862"));
} else {
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4eec");
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:
@ -289,31 +336,40 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
return ret;
}
Return<Status> UsbGadget::reset() {
ScopedAStatus UsbGadget::reset(const shared_ptr<IUsbGadgetCallback> &callback,
int64_t in_transactionId) {
ALOGI("USB Gadget reset");
if (!WriteStringToFile("none", PULLUP_PATH)) {
ALOGI("Gadget cannot be pulled down");
return Status::ERROR;
if (callback)
callback->resetCb(Status::ERROR, in_transactionId);
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
-1, "Gadget cannot be pulled down");
}
usleep(kDisconnectWaitUs);
if (!WriteStringToFile(kGadgetName, PULLUP_PATH)) {
ALOGI("Gadget cannot be pulled up");
return Status::ERROR;
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 Status::SUCCESS;
return ScopedAStatus::ok();
}
V1_0::Status UsbGadget::setupFunctions(uint64_t functions,
const sp<V1_0::IUsbGadgetCallback> &callback,
uint64_t timeout) {
Status UsbGadget::setupFunctions(long functions,
const shared_ptr<IUsbGadgetCallback> &callback, uint64_t timeout,
int64_t in_transactionId) {
bool ffsEnabled = false;
int i = 0;
if (addGenericAndroidFunctions(&monitorFfs, functions, &ffsEnabled, &i) !=
if (Status(addGenericAndroidFunctions(&monitorFfs, functions, &ffsEnabled, &i)) !=
Status::SUCCESS)
return Status::ERROR;
@ -349,7 +405,7 @@ V1_0::Status UsbGadget::setupFunctions(uint64_t functions,
if ((functions & GadgetFunction::ADB) != 0) {
ffsEnabled = true;
if (addAdb(&monitorFfs, &i) != Status::SUCCESS)
if (Status(addAdb(&monitorFfs, &i)) != Status::SUCCESS)
return Status::ERROR;
}
@ -364,7 +420,7 @@ V1_0::Status UsbGadget::setupFunctions(uint64_t functions,
return Status::ERROR;
mCurrentUsbFunctionsApplied = true;
if (callback)
callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS);
callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId);
return Status::SUCCESS;
}
@ -379,12 +435,13 @@ V1_0::Status UsbGadget::setupFunctions(uint64_t functions,
if (callback) {
bool pullup = monitorFfs.waitForPullUp(timeout);
Return<void> ret = callback->setCurrentUsbFunctionsCb(
functions, pullup ? Status::SUCCESS : Status::ERROR);
if (!ret.isOk())
ALOGE("setCurrentUsbFunctionsCb error %s", ret.description().c_str());
ScopedAStatus ret = callback->setCurrentUsbFunctionsCb(
functions, pullup ? Status::SUCCESS : Status::ERROR, in_transactionId);
if (!ret.isOk()) {
ALOGE("setCurrentUsbFunctionsCb error %s", ret.getDescription().c_str());
return Status::ERROR;
}
}
return Status::SUCCESS;
}
@ -411,9 +468,10 @@ Status getI2cBusHelper(string *name) {
return Status::ERROR;
}
Return<void> UsbGadget::setCurrentUsbFunctions(uint64_t functions,
const sp<V1_0::IUsbGadgetCallback> &callback,
uint64_t timeout) {
ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions,
const shared_ptr<IUsbGadgetCallback> &callback,
int64_t timeout,
int64_t in_transactionId) {
std::unique_lock<std::mutex> lk(mLockSetCurrentFunction);
std::string current_usb_power_operation_mode, current_usb_type;
std::string usb_limit_sink_enable;
@ -432,7 +490,7 @@ Return<void> UsbGadget::setCurrentUsbFunctions(uint64_t functions,
getUsbGadgetIrqPath();
// Unlink the gadget and stop the monitor if running.
V1_0::Status status = tearDownGadget();
Status status = tearDownGadget();
if (status != Status::SUCCESS) {
goto error;
}
@ -442,13 +500,15 @@ Return<void> UsbGadget::setCurrentUsbFunctions(uint64_t functions,
// Leave the gadget pulled down to give time for the host to sense disconnect.
usleep(kDisconnectWaitUs);
if (functions == static_cast<uint64_t>(GadgetFunction::NONE)) {
if (functions == GadgetFunction::NONE) {
if (callback == NULL)
return Void();
Return<void> ret = callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS);
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
-1, "callback == NULL");
ScopedAStatus ret = callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId);
if (!ret.isOk())
ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.description().c_str());
return Void();
ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.getDescription().c_str());
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
-1, "Error while calling setCurrentUsbFunctionsCb");
}
status = validateAndSetVidPid(functions);
@ -457,7 +517,7 @@ Return<void> UsbGadget::setCurrentUsbFunctions(uint64_t functions,
goto error;
}
status = setupFunctions(functions, callback, timeout);
status = setupFunctions(functions, callback, timeout, in_transactionId);
if (status != Status::SUCCESS) {
goto error;
}
@ -497,20 +557,21 @@ Return<void> UsbGadget::setCurrentUsbFunctions(uint64_t functions,
}
ALOGI("Usb Gadget setcurrent functions called successfully");
return Void();
return ScopedAStatus::ok();
error:
ALOGI("Usb Gadget setcurrent functions failed");
if (callback == NULL)
return Void();
Return<void> ret = callback->setCurrentUsbFunctionsCb(functions, status);
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
-1, "Usb Gadget setcurrent functions failed");
ScopedAStatus ret = callback->setCurrentUsbFunctionsCb(functions, status, in_transactionId);
if (!ret.isOk())
ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.description().c_str());
return Void();
ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.getDescription().c_str());
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
-1, "Error while calling setCurrentUsbFunctionsCb");
}
} // namespace implementation
} // namespace V1_2
} // namespace gadget
} // namespace usb
} // namespace hardware
} // namespace android
} // aidl

View file

@ -21,11 +21,13 @@
#include <android-base/unique_fd.h>
#include <android-base/parseint.h>
#include <android-base/strings.h>
#include <android/hardware/usb/gadget/1.2/IUsbGadget.h>
#include <android/hardware/usb/gadget/1.2/types.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <pixelusb/UsbGadgetCommon.h>
#include <aidl/android/hardware/usb/gadget/BnUsbGadget.h>
#include <aidl/android/hardware/usb/gadget/BnUsbGadgetCallback.h>
#include <aidl/android/hardware/usb/gadget/GadgetFunction.h>
#include <aidl/android/hardware/usb/gadget/IUsbGadget.h>
#include <aidl/android/hardware/usb/gadget/IUsbGadgetCallback.h>
#include <pixelusb/UsbGadgetAidlCommon.h>
#include <sched.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <utils/Log.h>
@ -35,14 +37,17 @@
#include <string>
#include <thread>
namespace aidl {
namespace android {
namespace hardware {
namespace usb {
namespace gadget {
namespace V1_2 {
namespace implementation {
using ::android::sp;
using ::aidl::android::hardware::usb::gadget::GadgetFunction;
using ::aidl::android::hardware::usb::gadget::IUsbGadgetCallback;
using ::aidl::android::hardware::usb::gadget::IUsbGadget;
using ::aidl::android::hardware::usb::gadget::Status;
using ::aidl::android::hardware::usb::gadget::UsbSpeed;
using ::android::base::GetProperty;
using ::android::base::SetProperty;
using ::android::base::ParseUint;
@ -50,12 +55,6 @@ using ::android::base::unique_fd;
using ::android::base::ReadFileToString;
using ::android::base::Trim;
using ::android::base::WriteStringToFile;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::google::pixel::usb::addAdb;
using ::android::hardware::google::pixel::usb::addEpollFd;
using ::android::hardware::google::pixel::usb::getVendorFunctions;
@ -66,10 +65,8 @@ using ::android::hardware::google::pixel::usb::MonitorFfs;
using ::android::hardware::google::pixel::usb::resetGadget;
using ::android::hardware::google::pixel::usb::setVidPid;
using ::android::hardware::google::pixel::usb::unlinkFunctions;
using ::android::hardware::usb::gadget::V1_0::Status;
using ::android::hardware::usb::gadget::V1_0::IUsbGadgetCallback;
using ::android::hardware::usb::gadget::V1_2::IUsbGadget;
using ::android::hardware::usb::gadget::V1_2::GadgetFunction;
using ::ndk::ScopedAStatus;
using ::std::shared_ptr;
using ::std::string;
constexpr char kGadgetName[] = "11210000.dwc3";
@ -79,9 +76,7 @@ constexpr char kSmpAffinityList[] = "/smp_affinity_list";
#ifndef UDC_PATH
#define UDC_PATH "/sys/class/udc/11210000.dwc3/"
#endif
constexpr char kExtconTypecState[] = "/sys/class/extcon/extcon0/cable.0/state";
constexpr char kUsbGadgetState[] = "/sys/devices/platform/11210000.usb/dwc3_exynos_gadget_state";
static MonitorFfs monitorFfs(kGadgetName, kExtconTypecState, kUsbGadgetState);
static MonitorFfs monitorFfs(kGadgetName);
#define SPEED_PATH UDC_PATH "current_speed"
@ -95,36 +90,40 @@ static MonitorFfs monitorFfs(kGadgetName, kExtconTypecState, kUsbGadgetState);
#define CURRENT_USB_TYPE_PATH POWER_SUPPLY_PATH "usb_type"
#define CURRENT_USB_POWER_OPERATION_MODE_PATH USB_PORT0_PATH "power_operation_mode"
struct UsbGadget : public IUsbGadget {
struct UsbGadget : public BnUsbGadget {
UsbGadget();
// Makes sure that only one request is processed at a time.
std::mutex mLockSetCurrentFunction;
std::string mGadgetIrqPath;
uint64_t mCurrentUsbFunctions;
long mCurrentUsbFunctions;
bool mCurrentUsbFunctionsApplied;
UsbSpeed mUsbSpeed;
Return<void> setCurrentUsbFunctions(uint64_t functions,
const sp<V1_0::IUsbGadgetCallback> &callback,
uint64_t timeout) override;
ScopedAStatus setCurrentUsbFunctions(long functions,
const shared_ptr<IUsbGadgetCallback> &callback,
int64_t timeout, int64_t in_transactionId) override;
Return<void> getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback> &callback) override;
ScopedAStatus getCurrentUsbFunctions(const shared_ptr<IUsbGadgetCallback> &callback,
int64_t in_transactionId) override;
Return<Status> reset() override;
ScopedAStatus reset(const shared_ptr<IUsbGadgetCallback> &callback,
int64_t in_transactionId) override;
Return<void> getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback) override;
ScopedAStatus getUsbSpeed(const shared_ptr<IUsbGadgetCallback> &callback,
int64_t in_transactionId) override;
ScopedAStatus setVidPid(const char *vid,const char *pid);
private:
Status tearDownGadget();
Status getUsbGadgetIrqPath();
Status setupFunctions(uint64_t functions, const sp<V1_0::IUsbGadgetCallback> &callback,
uint64_t timeout);
Status setupFunctions(long functions, const shared_ptr<IUsbGadgetCallback> &callback,
uint64_t timeout, int64_t in_transactionId);
};
} // namespace implementation
} // namespace V1_2
} // namespace gadget
} // namespace usb
} // namespace hardware
} // namespace android
} // aidl

View file

@ -1,4 +1,4 @@
service vendor.usb-gadget-hal-1-2 /vendor/bin/hw/android.hardware.usb.gadget-service
service vendor.usb-gadget-hal /vendor/bin/hw/android.hardware.usb.gadget-service
class hal
user system
group system shell mtp
@ -10,7 +10,6 @@ on post-fs
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_otg_b_sess
chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_otg_id
chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_gadget_state
chown root system /sys/devices/platform/11210000.usb/usb_data_enabled
chmod 664 /sys/class/typec/port0/power_role
chmod 664 /sys/class/typec/port0/data_role

View file

@ -1,8 +1,7 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<hal format="aidl">
<name>android.hardware.usb.gadget</name>
<transport>hwbinder</transport>
<version>1.2</version>
<version>1</version>
<interface>
<name>IUsbGadget</name>
<instance>default</instance>

View file

@ -16,35 +16,27 @@
#define LOG_TAG "android.hardware.usb.gadget-service"
#include <hidl/HidlTransportSupport.h>
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <utils/Log.h>
#include "UsbGadget.h"
using android::sp;
// libhwbinder:
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
// Generated HIDL files
using android::hardware::usb::gadget::V1_2::IUsbGadget;
using android::hardware::usb::gadget::V1_2::implementation::UsbGadget;
using android::OK;
using android::sp;
using android::status_t;
using aidl::android::hardware::usb::gadget::UsbGadget;
int main() {
android::sp<IUsbGadget> service = new UsbGadget();
configureRpcThreadpool(2, true /*callerWillJoin*/);
status_t status = service->registerAsService();
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<UsbGadget> usbgadget = ndk::SharedRefBase::make<UsbGadget>();
if (status != OK) {
ALOGE("Cannot register USB Gadget HAL service");
return 1;
}
const std::string instance = std::string() + UsbGadget::descriptor + "/default";
binder_status_t status = AServiceManager_addService(usbgadget->asBinder().get(), instance.c_str());
CHECK(status == STATUS_OK);
ALOGI("USB gadget HAL Ready.");
joinRpcThreadpool();
// Under noraml cases, execution will not reach this line.
ALOGI("USB gadget HAL failed to join thread pool.");
return 1;
ALOGV("AIDL USB Gadget HAL about to start");
ABinderProcess_joinThreadPool();
return -1; // Should never be reached
}

View file

@ -40,21 +40,24 @@ cc_binary {
"libbinder",
"libhidlbase",
"liblog",
"libusbhost",
"libutils",
"libhardware",
"android.hardware.thermal@1.0",
"android.hardware.thermal@2.0",
"android.hardware.thermal-V1-ndk",
"android.hardware.usb.gadget@1.0",
"android.hardware.usb-V1-ndk",
"android.hardware.usb-V2-ndk",
"android.hardware.usb.gadget-V1-ndk",
"libcutils",
"android.frameworks.stats-V1-ndk",
"pixelatoms-cpp",
"libbinder_ndk",
],
static_libs: [
"libpixelusb",
"libpixelusb-aidl",
"libpixelstats",
"libthermalutils",
],
export_shared_lib_headers: [
"android.frameworks.stats-V1-ndk",

View file

@ -17,15 +17,18 @@
#define LOG_TAG "android.hardware.usb.aidl-service"
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <assert.h>
#include <cstring>
#include <dirent.h>
#include <private/android_filesystem_config.h>
#include <pthread.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <usbhost/usbhost.h>
#include <chrono>
#include <regex>
#include <thread>
@ -35,19 +38,23 @@
#include <sys/epoll.h>
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
#include <utils/Vector.h>
#include "Usb.h"
#include <aidl/android/frameworks/stats/IStats.h>
#include <pixelusb/UsbGadgetCommon.h>
#include <pixelusb/UsbGadgetAidlCommon.h>
#include <pixelstats/StatsHelper.h>
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;
using android::hardware::google::pixel::reportUsbPortOverheat;
using android::String8;
using android::Vector;
namespace aidl {
namespace android {
@ -59,6 +66,11 @@ volatile bool destroyThread;
string enabledPath;
constexpr char kHsi2cPath[] = "/sys/devices/platform/10d60000.hsi2c";
constexpr char kI2CPath[] = "/sys/devices/platform/10d60000.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";
@ -79,6 +91,15 @@ constexpr int kSamplingIntervalSec = 5;
void queryVersionHelper(android::hardware::usb::Usb *usb,
std::vector<PortStatus> *currentPortStatus);
#define CTRL_TRANSFER_TIMEOUT_MSEC 1000
#define GL852G_VENDOR_ID 0x05e3
#define GL852G_PRODUCT_ID1 0x0608
#define GL852G_PRODUCT_ID2 0x0610
#define GL852G_VENDOR_CMD_REQ 0xe3
// GL852G port 1 and port 2 JK level default settings
#define GL852G_VENDOR_CMD_VALUE_DEFAULT 0x0008
#define GL852G_VENDOR_CMD_INDEX_DEFAULT 0x0404
ScopedAStatus Usb::enableUsbData(const string& in_portName, bool in_enable,
int64_t in_transactionId) {
bool result = true;
@ -275,6 +296,49 @@ Status queryMoistureDetectionStatus(std::vector<PortStatus> *currentPortStatus)
return Status::SUCCESS;
}
Status queryNonCompliantChargerStatus(std::vector<PortStatus> *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<string> 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);
@ -393,6 +457,61 @@ bool switchMode(const string &portName, const PortRole &in_role, struct Usb *usb
return roleSwitch;
}
static int usbDeviceRemoved(const char *devname, void* client_data) {
return 0;
}
static int usbDeviceAdded(const char *devname, void* client_data) {
uint16_t vendorId, productId;
struct usb_device *device;
::aidl::android::hardware::usb::Usb *usb;
int value, index;
device = usb_device_open(devname);
if (!device) {
ALOGE("usb_device_open failed\n");
return 0;
}
usb = (::aidl::android::hardware::usb::Usb *)client_data;
value = usb->mUsbHubVendorCmdValue;
index = usb->mUsbHubVendorCmdIndex;
// The vendor cmd only applies to USB Hubs of Genesys Logic, Inc.
// The request field of vendor cmd is fixed to 0xe3.
vendorId = usb_device_get_vendor_id(device);
productId = usb_device_get_product_id(device);
if (vendorId == GL852G_VENDOR_ID &&
(productId == GL852G_PRODUCT_ID1 || productId == GL852G_PRODUCT_ID2)) {
int ret = usb_device_control_transfer(device,
USB_DIR_OUT | USB_TYPE_VENDOR, GL852G_VENDOR_CMD_REQ, value, index,
NULL, 0, CTRL_TRANSFER_TIMEOUT_MSEC);
ALOGI("USB hub vendor cmd %s (wValue 0x%x, wIndex 0x%x, return %d)\n",
ret? "failed" : "succeeded", value, index, ret);
}
usb_device_close(device);
return 0;
}
void *usbHostWork(void *param) {
struct usb_host_context *ctx;
ALOGI("creating USB host thread\n");
ctx = usb_host_init();
if (!ctx) {
ALOGE("usb_host_init failed\n");
return NULL;
}
// This will never return, it will keep monitoring USB sysfs inotify events
usb_host_run(ctx, usbDeviceAdded, usbDeviceRemoved, NULL, param);
return NULL;
}
Usb::Usb()
: mLock(PTHREAD_MUTEX_INITIALIZER),
mRoleSwitchLock(PTHREAD_MUTEX_INITIALIZER),
@ -406,7 +525,9 @@ Usb::Usb()
ThrottlingSeverity::NONE),
ZoneInfo(TemperatureType::UNKNOWN, kThermalZoneForTempReadSecondary2,
ThrottlingSeverity::NONE)}, kSamplingIntervalSec),
mUsbDataEnabled(true) {
mUsbDataEnabled(true),
mUsbHubVendorCmdValue(GL852G_VENDOR_CMD_VALUE_DEFAULT),
mUsbHubVendorCmdIndex(GL852G_VENDOR_CMD_INDEX_DEFAULT) {
pthread_condattr_t attr;
if (pthread_condattr_init(&attr)) {
ALOGE("pthread_condattr_init failed: %s", strerror(errno));
@ -424,6 +545,10 @@ Usb::Usb()
ALOGE("pthread_condattr_destroy failed: %s", strerror(errno));
abort();
}
if (pthread_create(&mUsbHost, NULL, usbHostWork, this)) {
ALOGE("pthread creation failed %d\n", errno);
abort();
}
}
ScopedAStatus Usb::switchRole(const string& in_portName, const PortRole& in_role,
@ -683,7 +808,7 @@ Status getPortStatusHelper(android::hardware::usb::Usb *usb,
PortRole currentRole;
currentRole.set<PortRole::powerRole>(PortPowerRole::NONE);
if (getCurrentRoleHelper(port.first, port.second, &currentRole) == Status::SUCCESS){
if (getCurrentRoleHelper(port.first, port.second, &currentRole) == Status::SUCCESS) {
(*currentPortStatus)[i].currentPowerRole = currentRole.get<PortRole::powerRole>();
} else {
ALOGE("Error while retrieving portNames");
@ -718,7 +843,13 @@ Status getPortStatusHelper(android::hardware::usb::Usb *usb,
string pogoUsbActive = "0";
if (ReadFileToString(string(kPogoUsbActive), &pogoUsbActive) &&
stoi(Trim(pogoUsbActive)) == 1) {
(*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::DISABLED_DOCK);
/*
* Always signal USB device mode disabled irrespective of hub enabled while docked.
* Hub gets automatically enabled as needed. Signalling DISABLED_DOCK_HOST_MODE &
* DEVICE_MODE during pogo direct can cause notifications to show for brief windows
* when the state machine is still moving to steady state.
*/
(*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::DISABLED_DOCK_DEVICE_MODE);
dataEnabled = false;
}
if (!usb->mUsbDataEnabled) {
@ -772,6 +903,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);
@ -1029,6 +1161,47 @@ ScopedAStatus Usb::setCallback(const shared_ptr<IUsbCallback>& in_callback) {
return ScopedAStatus::ok();
}
status_t Usb::handleShellCommand(int in, int out, int err, const char** argv,
uint32_t argc) {
uid_t uid = AIBinder_getCallingUid();
if (uid != AID_ROOT && uid != AID_SHELL) {
return ::android::PERMISSION_DENIED;
}
Vector<String8> utf8Args;
utf8Args.setCapacity(argc);
for (uint32_t i = 0; i < argc; i++) {
utf8Args.push(String8(argv[i]));
}
if (argc >= 1) {
if (!utf8Args[0].compare(String8("hub-vendor-cmd"))) {
if (utf8Args.size() < 3) {
dprintf(out, "Incorrect number of argument supplied\n");
return ::android::UNKNOWN_ERROR;
}
int value, index;
if (!::android::base::ParseInt(utf8Args[1].c_str(), &value) ||
!::android::base::ParseInt(utf8Args[2].c_str(), &index)) {
dprintf(out, "Fail to parse arguments\n");
return ::android::UNKNOWN_ERROR;
}
mUsbHubVendorCmdValue = value;
mUsbHubVendorCmdIndex = index;
ALOGI("USB hub vendor cmd update (wValue 0x%x, wIndex 0x%x)\n",
mUsbHubVendorCmdValue, mUsbHubVendorCmdIndex);
return ::android::NO_ERROR;
}
}
dprintf(out, "usage: adb shell cmd hub-vendor-cmd VALUE INDEX\n"
" VALUE wValue field in hex format, e.g. 0xf321\n"
" INDEX wIndex field in hex format, e.g. 0xf321\n"
" The settings take effect next time the hub is enabled\n");
return ::android::NO_ERROR;
}
} // namespace usb
} // namespace hardware
} // namespace android

View file

@ -43,6 +43,7 @@ using ::android::hardware::google::pixel::usb::ZoneInfo;
using ::android::hardware::thermal::V2_0::TemperatureType;
using ::android::hardware::thermal::V2_0::ThrottlingSeverity;
using ::android::sp;
using ::android::status_t;
using ::ndk::ScopedAStatus;
using ::std::shared_ptr;
using ::std::string;
@ -71,6 +72,9 @@ struct Usb : public BnUsb {
int64_t in_transactionId) override;
ScopedAStatus resetUsbPort(const string& in_portName, int64_t in_transactionId) override;
status_t handleShellCommand(int in, int out, int err, const char** argv,
uint32_t argc) override;
std::shared_ptr<::aidl::android::hardware::usb::IUsbCallback> mCallback;
// Protects mCallback variable
pthread_mutex_t mLock;
@ -89,8 +93,12 @@ struct Usb : public BnUsb {
float mPluggedTemperatureCelsius;
// Usb Data status
bool mUsbDataEnabled;
// Usb hub vendor command settings for JK level tuning
int mUsbHubVendorCmdValue;
int mUsbHubVendorCmdIndex;
private:
pthread_t mPoll;
pthread_t mUsbHost;
};
} // namespace usb

View file

@ -1,49 +1,133 @@
service vendor.usb /vendor/bin/hw/android.hardware.usb-service
class hal
user system
group system shell wakelock
group system shell wakelock usb
capabilities WAKE_ALARM BLOCK_SUSPEND
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/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_current
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_source_enable
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/class/typec/port0/power_role
chmod 664 /sys/class/typec/port0/data_role
chmod 664 /sys/class/typec/port0/port_type
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/contaminant_detection
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_current
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_source_enable
chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_source_enable

View file

@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.usb</name>
<version>1</version>
<version>2</version>
<interface>
<name>IUsb</name>
<instance>default</instance>

View file

@ -1,4 +1 @@
PRODUCT_PACKAGES += \
android.hardware.drm-service.clearkey \
android.hardware.drm-service.widevine
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs201-sepolicy/widevine