diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..361ce945 --- /dev/null +++ b/.clang-format @@ -0,0 +1,13 @@ +BasedOnStyle: Google +AccessModifierOffset: -2 +AllowShortFunctionsOnASingleLine: Inline +ColumnLimit: 100 +CommentPragmas: NOLINT:.* +DerivePointerAlignment: false +IndentWidth: 4 +ContinuationIndentWidth: 8 +PointerAlignment: Right +TabWidth: 4 +UseTab: Never +AllowShortIfStatementsOnASingleLine: false +SpacesBeforeTrailingComments: 2 diff --git a/Android.bp b/Android.bp new file mode 100644 index 00000000..57ebe85b --- /dev/null +++ b/Android.bp @@ -0,0 +1,36 @@ +soong_namespace { + imports: [ + "hardware/google/interfaces", + "hardware/google/pixel", + ], +} + +package { + default_applicable_licenses: ["device_google_gs101_license"], +} + +// Added automatically by a large-scale-change that took the approach of +// 'apply every license found to every target'. While this makes sure we respect +// every license restriction, it may not be entirely correct. +// +// e.g. GPL in an MIT project might only apply to the contrib/ directory. +// +// Please consider splitting the single license below into multiple licenses, +// taking care not to lose any license_kind information, and overriding the +// default license using the 'licenses: [...]' property on targets as needed. +// +// For unused files, consider creating a 'fileGroup' with "//visibility:private" +// to attach the license to, and including a comment whether the files may be +// used in the current project. +// See: http://go/android-license-faq +license { + name: "device_google_gs101_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-Apache-2.0", + "SPDX-license-identifier-BSD", + ], + license_text: [ + "NOTICE", + ], +} diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..e6a9462e --- /dev/null +++ b/Android.mk @@ -0,0 +1,30 @@ +# +# Copyright (C) 2011 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. +# + +# WARNING: Everything listed here will be built on ALL platforms, +# including x86, the universal, and the SDK. Modules must be uniquely +# named (liblights.panda), and must build everywhere, or limit themselves +# to only building on ARM if they include assembly. Individual makefiles +# are responsible for having their own logic, for fine-grained control. + +LOCAL_PATH := $(call my-dir) + +# if some modules are built directly from this directory (not subdirectories), +# their rules should be written here. + +ifeq ($(USES_DEVICE_GOOGLE_GS101),true) + include $(call first-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk new file mode 100644 index 00000000..4909b618 --- /dev/null +++ b/BoardConfig-common.mk @@ -0,0 +1,395 @@ +# +# Copyright (C) 2019 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 build/make/target/board/BoardConfigMainlineCommon.mk + +# Should be uncommented after fixing vndk-sp violation is fixed. +PRODUCT_FULL_TREBLE_OVERRIDE := true + +# HACK : To fix up after bring up multimedia devices. +TARGET_SOC := gs101 + +TARGET_SOC_NAME := google + +USES_DEVICE_GOOGLE_GS101 := true + +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := arm64-v8a +TARGET_CPU_VARIANT := generic +TARGET_CPU_VARIANT_RUNTIME := cortex-a53 + +ifeq (,$(filter %_64,$(TARGET_PRODUCT))) +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv8-a +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := generic +TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53 +endif + +BOARD_KERNEL_CMDLINE += earlycon=exynos4210,0x10A00000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on +BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive +BOARD_KERNEL_CMDLINE += androidboot.boot_devices=14700000.ufs + +TARGET_NO_BOOTLOADER := true +TARGET_NO_KERNEL := false +TARGET_NO_RADIOIMAGE := true +BOARD_USES_GENERIC_KERNEL_IMAGE := true +BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true +BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true +TARGET_RECOVERY_WIPE := device/google/gs101/conf/recovery.wipe +TARGET_RECOVERY_FSTAB := device/google/gs101/conf/fstab.gs101 +TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888 +TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165 +TARGET_RECOVERY_UI_LIB := \ + librecovery_ui_pixel \ + libfstab + +AB_OTA_UPDATER := true + +AB_OTA_PARTITIONS += \ + system \ + system_ext \ + product \ + vbmeta_system + +ifneq ($(PRODUCT_BUILD_BOOT_IMAGE),false) +AB_OTA_PARTITIONS += boot +endif +ifneq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE),false) +AB_OTA_PARTITIONS += vendor_boot +AB_OTA_PARTITIONS += dtbo +endif +ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE),false) +AB_OTA_PARTITIONS += vbmeta +endif + +# EMULATOR common modules +BOARD_EMULATOR_COMMON_MODULES := liblight + +OVERRIDE_RS_DRIVER := libRSDriverArm.so +BOARD_EGL_CFG := device/google/gs101/conf/egl.cfg +#BOARD_USES_HGL := true +USE_OPENGL_RENDERER := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 +BOARD_USES_EXYNOS5_COMMON_GRALLOC := true +BOARD_USES_EXYNOS_GRALLOC_VERSION := $(DEVICE_USES_EXYNOS_GRALLOC_VERSION) +BOARD_USES_ALIGN_RESTRICTION := false + +# This should be the same value as USE_SWIFTSHADER in device.mk +BOARD_USES_SWIFTSHADER := false + +# Gralloc4 +ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4) +SOONG_CONFIG_NAMESPACES += arm_gralloc +SOONG_CONFIG_arm_gralloc := \ + gralloc_arm_no_external_afbc \ + mali_gpu_support_afbc_basic \ + mali_gpu_support_afbc_wideblk \ + gralloc_init_afbc \ + gralloc_ion_sync_on_lock \ + dpu_support_1010102_afbc + +ifeq ($(BOARD_USES_SWIFTSHADER),true) +SOONG_CONFIG_arm_gralloc_gralloc_arm_no_external_afbc := true +SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_basic := false +SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_wideblk := false +SOONG_CONFIG_arm_gralloc_gralloc_init_afbc := false +SOONG_CONFIG_arm_gralloc_dpu_support_1010102_afbc := false +else +SOONG_CONFIG_arm_gralloc_gralloc_arm_no_external_afbc := false +SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_basic := true +SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_wideblk := true +SOONG_CONFIG_arm_gralloc_gralloc_init_afbc := true +SOONG_CONFIG_arm_gralloc_dpu_support_1010102_afbc := true +endif # ifeq ($(BOARD_USES_SWIFTSHADER),true) +SOONG_CONFIG_arm_gralloc_gralloc_ion_sync_on_lock := $(BOARD_USES_GRALLOC_ION_SYNC) +endif # ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4) + +# libVendorGraphicbuffer +SOONG_CONFIG_NAMESPACES += vendorgraphicbuffer +SOONG_CONFIG_vendorgraphicbuffer := \ + gralloc_version + +ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4) +SOONG_CONFIG_vendorgraphicbuffer_gralloc_version := four +else +SOONG_CONFIG_vendorgraphicbuffer_gralloc_version := three +endif + +# Graphics +#BOARD_USES_EXYNOS_DATASPACE_FEATURE := true + +# Storage options +BOARD_USES_VENDORIMAGE := true +TARGET_COPY_OUT_VENDOR := vendor + +# Enable chain partition for system. +BOARD_AVB_VBMETA_SYSTEM := system system_ext product +BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem +BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048 +BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) +BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1 + +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +BOARD_USERDATAIMAGE_PARTITION_SIZE := 11796480000 +BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs +PRODUCT_FS_COMPRESSION := 1 +BOARD_FLASH_BLOCK_SIZE := 4096 +BOARD_MOUNT_SDCARD_RW := true + +# product.img +BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 +TARGET_COPY_OUT_PRODUCT := product + +# system_ext.img +BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 +TARGET_COPY_OUT_SYSTEM_EXT := system_ext + +######################## +# Video Codec +######################## +# 1. Exynos C2 +BOARD_USE_CSC_FILTER := false +BOARD_USE_DEC_SW_CSC := true +BOARD_USE_ENC_SW_CSC := true +BOARD_SUPPORT_MFC_ENC_RGB := true +BOARD_USE_BLOB_ALLOCATOR := false +######################## + +BOARD_SUPER_PARTITION_SIZE := 8531214336 +BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions +BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 8531214336 +BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \ + system \ + system_ext \ + product \ + vendor + +# Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB +BOARD_SUPER_PARTITION_ERROR_LIMIT := 8006926336 + +# +# AUDIO & VOICE +# +BOARD_USES_GENERIC_AUDIO := true + +SOONG_CONFIG_NAMESPACES += aoc_audio_func + +SOONG_CONFIG_aoc_audio_func += \ + ext_hidl + +SOONG_CONFIG_aoc_audio_func_ext_hidl := true + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +SOONG_CONFIG_aoc_audio_func += \ + dump_usecase_data \ + hal_socket_control \ + record_tunning_keys + +SOONG_CONFIG_aoc_audio_func_dump_usecase_data := true +SOONG_CONFIG_aoc_audio_func_hal_socket_control := true +SOONG_CONFIG_aoc_audio_func_record_tunning_keys := true +endif + +# Primary AudioHAL Configuration +#BOARD_USE_COMMON_AUDIOHAL := true +#BOARD_USE_CALLIOPE_AUDIOHAL := false +#BOARD_USE_AUDIOHAL := true + +# Compress Offload Configuration +#BOARD_USE_OFFLOAD_AUDIO := true +#BOARD_USE_OFFLOAD_EFFECT := false + +# SoundTriggerHAL Configuration +#BOARD_USE_SOUNDTRIGGER_HAL := false + +# HWComposer +BOARD_HWC_VERSION := libhwc2.1 +TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := false +BOARD_HDMI_INCAPABLE := true +TARGET_USES_HWC2 := true +HWC_SKIP_VALIDATE := true +HWC_SUPPORT_RENDER_INTENT := true +HWC_SUPPORT_COLOR_TRANSFORM := true +#BOARD_USES_DISPLAYPORT := true +# if AFBC is enabled, must set ro.vendor.ddk.set.afbc=1 +BOARD_USES_EXYNOS_AFBC_FEATURE := true +#BOARD_USES_HDRUI_GLES_CONVERSION := true + +BOARD_LIBACRYL_DEFAULT_COMPOSITOR := fimg2d_gs101 +BOARD_LIBACRYL_G2D_HDR_PLUGIN := libacryl_hdr_plugin + +# HWCServices +BOARD_USES_HWC_SERVICES := true + +# WiFiDisplay +# BOARD_USES_VIRTUAL_DISPLAY := true +# BOARD_USES_VDS_EXYNOS_HWC := true +# BOARD_USES_WIFI_DISPLAY:= true +# BOARD_USES_EGL_SURFACE_FOR_COMPOSITION_MIXED := true +# BOARD_USES_VDS_YUV420SPM := true +# BOARD_USES_VDS_OTHERFORMAT := true +# BOARD_USES_VDS_DEBUG_FLAG := true +# BOARD_USES_DISABLE_COMPOSITIONTYPE_GLES := true +# BOARD_USES_SECURE_ENCODER_ONLY := true +# BOARD_USES_TSMUX := true + +# SCALER +BOARD_USES_DEFAULT_CSC_HW_SCALER := true +BOARD_DEFAULT_CSC_HW_SCALER := 4 +BOARD_USES_SCALER_M2M1SHOT := true + +# Device Tree +BOARD_USES_DT := true +BOARD_INCLUDE_DTB_IN_BOOTIMG := true +BOARD_PREBUILT_DTBIMAGE_DIR := $(TARGET_KERNEL_DIR) +BOARD_PREBUILT_DTBOIMAGE := $(BOARD_PREBUILT_DTBIMAGE_DIR)/dtbo.img + +# PLATFORM LOG +TARGET_USES_LOGD := true + +# LIBHWJPEG +#TARGET_USES_UNIVERSAL_LIBHWJPEG := true +#LIBHWJPEG_HWSCALER_ID := 0 + +#Keymaster +#BOARD_USES_KEYMASTER_VER1 := true + +#FMP +#BOARD_USES_FMP_DM_CRYPT := true +#BOARD_USES_FMP_FSCRYPTO := true +BOARD_USES_METADATA_PARTITION := true + +# SELinux Platform Private policy for gs101 +SYSTEM_EXT_PRIVATE_SEPOLICY_DIR := device/google/sepolicy/private + +# SKIA +#BOARD_USES_SKIA_MULTITHREADING := true +#BOARD_USES_FIMGAPI_V5X := true + +# SECCOMP Policy +BOARD_SECCOMP_POLICY = device/google/gs101/seccomp_policy + +#CURL +BOARD_USES_CURL := true + +# Sensor HAL +BOARD_USES_EXYNOS_SENSORS_DUMMY := true + +# VISION +# Exynos vision framework (EVF) +#TARGET_USES_EVF := true +# HW acceleration +#TARGET_USES_VPU_KERNEL := true +#TARGET_USES_SCORE_KERNEL := true +#TARGET_USES_CL_KERNEL := false + +# exynos RIL +TARGET_EXYNOS_RIL_SOURCE := true +ENABLE_VENDOR_RIL_SERVICE := true + +# GNSS +# BOARD_USES_EXYNOS_GNSS_DUMMY := true + +# Bluetooth defines +# TODO(b/123695868): Remove the need for this +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := \ + build/make/target/board/mainline_arm64/bluetooth + +TARGET_BOARD_KERNEL_HEADERS := $(TARGET_KERNEL_DIR)/kernel-headers + +#VNDK +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true +BOARD_VNDK_VERSION := current + +# H/W align restriction of MM IPs +BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64 + +# WiFi +BOARD_WLAN_DEVICE := bcmdhd +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd +WPA_SUPPLICANT_VERSION := VER_0_8_X +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +BOARD_HOSTAPD_DRIVER := NL80211 +# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {2 STA + 1 of (P2P or NAN)} +WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}} +WIFI_FEATURE_WIFI_EXT_HAL := true +WIFI_FEATURE_IMU_DETECTION := true +# Avoid Wifi reset on MAC Address change +WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true +WIFI_FEATURE_HOSTAPD_11AX := true + +# NeuralNetworks +GPU_SOURCE_PRESENT := $(wildcard vendor/arm/mali/valhall) +GPU_PREBUILD_PRESENT := $(wildcard vendor/google_devices/zebu/prebuilts/libs) +ifneq "$(or $(GPU_SOURCE_PRESENT),$(GPU_PREBUILD_PRESENT))" "" +ARMNN_COMPUTE_CL_ENABLE := 1 +else +ARMNN_COMPUTE_CL_ENABLE := 0 +endif +ARMNN_COMPUTE_NEON_ENABLE := 1 + +# Boot.img +BOARD_RAMDISK_USE_LZ4 := true +#BOARD_KERNEL_BASE := 0x80000000 +#BOARD_KERNEL_PAGESIZE := 2048 +#BOARD_KERNEL_OFFSET := 0x80000 +#BOARD_RAMDISK_OFFSET := 0x4000000 +BOARD_BOOT_HEADER_VERSION := 3 +BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) + +# Enable AVB2.0 +BOARD_AVB_ENABLE := true +BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000 +BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x04000000 +BOARD_DTBOIMG_PARTITION_SIZE := 0x01000000 + +# System As Root +BOARD_BUILD_SYSTEM_ROOT_IMAGE := false + +# Kernel modules +BOARD_VENDOR_KERNEL_MODULES += \ + $(wildcard $(TARGET_KERNEL_DIR)/*.ko) + +BOARD_VENDOR_RAMDISK_KERNEL_MODULES_FILTER += \ + $(TARGET_KERNEL_DIR)/bcmdhd43752.ko \ + $(TARGET_KERNEL_DIR)/bcmdhd4389.ko \ + $(TARGET_KERNEL_DIR)/lwis.ko \ + $(TARGET_KERNEL_DIR)/pinctrl-slg51000.ko \ + $(TARGET_KERNEL_DIR)/pktgen.ko \ + $(TARGET_KERNEL_DIR)/slg51000-core.ko \ + $(TARGET_KERNEL_DIR)/slg51000-regulator.ko \ + $(TARGET_KERNEL_DIR)/stmvl53l1.ko \ + $(TARGET_KERNEL_DIR)/ftm5.ko \ + $(TARGET_KERNEL_DIR)/haptics-cs40l2x.ko \ + $(TARGET_KERNEL_DIR)/sec_touch.ko + +BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ + $(filter-out $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_FILTER), $(foreach module, $(notdir \ + $(shell cat $(TARGET_KERNEL_DIR)/modules.load)), \ + $(TARGET_KERNEL_DIR)/$(module))) + +# Using BUILD_COPY_HEADERS +BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true + +include device/google/gs101-sepolicy/gs101-sepolicy.mk +-include device/google/gs101/soong/pixel_soong_config.mk + +# Battery options +BOARD_KERNEL_CMDLINE += at24.write_timeout=100 diff --git a/CleanSpec.mk b/CleanSpec.mk new file mode 100644 index 00000000..10cf0fb5 --- /dev/null +++ b/CleanSpec.mk @@ -0,0 +1,74 @@ +# Copyright (C) 2012 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. +# + +# If you don't need to do a full clean build but would like to touch +# a file or delete some intermediate files, add a clean step to the end +# of the list. These steps will only be run once, if they haven't been +# run before. +# +# E.g.: +# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) +# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) +# +# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with +# files that are missing or have been moved. +# +# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. +# Use $(OUT_DIR) to refer to the "out" directory. +# +# If you need to re-do something that's already mentioned, just copy +# the command and add it to the bottom of the list. E.g., if a change +# that you made last week required touching a file and a change you +# made today requires touching the same file, just copy the old +# touch step and add it to the end of the list. +# +# ************************************************ +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST +# ************************************************ + +# For example: +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) +#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) +#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) +$(call add-clean-step, find $(PRODUCT_OUT) -name "*.apk" | xargs rm) + +# ************************************************ +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST +# ************************************************ +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libui_intermediates) +$(call add-clean-step, rm -f $(PRODUCT_OUT)/root/default.prop) +$(call add-clean-step, rm -f $(TARGET_OUT)/build.prop) +$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/etc/mixer_paths_lb.xml) +$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/etc/permissions/android.hardware.camera.xml) + +$(call add-clean-step, rm -f $(PRODUCT_OUT)/root/*) +# Power HAL 1.0 +$(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/init/android.hardware.power@1.0-service.rc) +$(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.power@1.0-service) +# Power HAL HIDL +$(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/init/android.hardware.power@1.3-service.pixel-libperfmgr.rc) + +# Health storage HAL +$(call add-clean-step, find $(PRODUCT_OUT) -type f -name "*android.hardware.health.storage@1.0*" -print0 | xargs -0 rm -f) + +# Update to USB HAL 1.3 +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.usb@1.2-service.slider) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.usb@1.2-service.slider.rc) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.usb@1.2-service.slider.xml) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.usb@1.3-service.slider) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.usb@1.3-service.slider.rc) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.usb@1.3-service.slider.xml) diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000..316b4eb5 --- /dev/null +++ b/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2014, 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. + + 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. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/aosp_common.mk b/aosp_common.mk new file mode 100644 index 00000000..1ad6eb71 --- /dev/null +++ b/aosp_common.mk @@ -0,0 +1,52 @@ +# +# Copyright 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. +# + +# +# All components inherited here go to system image +# +ifeq (,$(filter %_64,$(TARGET_PRODUCT))) +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +else +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) +endif +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) + +# Enable CSI checking +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk) + +# +# All components inherited here go to product image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk) + +# +# All components inherited here go to vendor image +# +# TODO(b/136525499): move *_vendor.mk into the vendor makefile later +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk) + +#$(call inherit-product, device/google/gs101/device.mk) +#$(call inherit-product-if-exists, vendor/google_devices/gs101/proprietary/device-vendor.mk) + +# TODO: fix +# PRODUCT_RESTRICT_VENDOR_FILES := all diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml new file mode 100644 index 00000000..19384423 --- /dev/null +++ b/compatibility_matrix.xml @@ -0,0 +1,92 @@ + + + + android.frameworks.displayservice + 1.0 + + IDisplayService + default + + + + android.frameworks.schedulerservice + 1.0 + + ISchedulingPolicyService + default + + + + android.frameworks.sensorservice + 1.0 + + ISensorManager + default + + + + android.hardware.graphics.composer + 2.1 + + IComposer + vr + + + + android.hidl.allocator + 1.0 + + IAllocator + ashmem + + + + android.hidl.manager + 1.0 + + IServiceManager + default + + + + android.hidl.memory + 1.0 + + IMapper + ashmem + + + + android.hidl.token + 1.0 + + ITokenManager + default + + + + android.system.wifi.keystore + 1.0 + + IKeystore + default + + + + vendor.google.wireless_charger + 1.2 + + IWirelessCharger + default + + + + 0.0.0 + + diff --git a/component-overrides.xml b/component-overrides.xml new file mode 100644 index 00000000..f9c8987c --- /dev/null +++ b/component-overrides.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/conf/egl.cfg b/conf/egl.cfg new file mode 100644 index 00000000..4515dfd6 --- /dev/null +++ b/conf/egl.cfg @@ -0,0 +1 @@ +0 1 mali diff --git a/conf/fstab.gs101 b/conf/fstab.gs101 new file mode 100644 index 00000000..8bfd58cd --- /dev/null +++ b/conf/fstab.gs101 @@ -0,0 +1,20 @@ +# Android fstab file. +# +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK +# +# +system /system ext4 ro,barrier=1 wait,slotselect,avb=vbmeta_system,logical,first_stage_mount +system_ext /system_ext ext4 ro,barrier=1 wait,slotselect,avb=vbmeta_system,logical,first_stage_mount +product /product ext4 ro,barrier=1 wait,slotselect,avb=vbmeta_system,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1 wait,slotselect,avb=vbmeta,logical,first_stage_mount +/dev/block/platform/14700000.ufs/by-name/efs /mnt/vendor/efs ext4 defaults,noatime,rw wait,check,formattable +/dev/block/platform/14700000.ufs/by-name/efs_backup /mnt/vendor/efs_backup ext4 defaults,noatime,rw wait,check,formattable +/dev/block/platform/14700000.ufs/by-name/modem_userdata /mnt/vendor/modem_userdata ext4 defaults,noatime,rw wait,check,formattable +/dev/block/platform/14700000.ufs/by-name/modem /mnt/vendor/modem_img ext4 ro,defaults wait,slotselect +/dev/block/platform/14700000.ufs/by-name/misc /misc emmc defaults wait +/dev/block/platform/14700000.ufs/by-name/metadata /metadata ext4 noatime,nosuid,nodev,data=journal,commit=1 wait,check,formattable,first_stage_mount,metadata_csum +/dev/block/platform/14700000.ufs/by-name/pvmfw /pvmfw emmc defaults wait,slotselect,avb=pvmfw,first_stage_mount +/dev/block/platform/14700000.ufs/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt,compress_extension=apk,compress_extension=apex,compress_extension=so,atgc latemount,wait,check,quota,formattable,sysfs_path=/dev/sys/block/bootdevice,checkpoint=fs,reservedsize=128M,fileencryption=aes-256-xts:aes-256-cts:v2,keydirectory=/metadata/vold/metadata_encryption,fscompress +/dev/block/zram0 none swap defaults zramsize=2147483648,max_comp_streams=8,zram_backingdev_size=512M +/devices/platform/11110000.usb* auto vfat defaults voldmanaged=usb:auto diff --git a/conf/fstab.gs101.emmc b/conf/fstab.gs101.emmc new file mode 100644 index 00000000..076978d1 --- /dev/null +++ b/conf/fstab.gs101.emmc @@ -0,0 +1,12 @@ +# Android fstab file. +# +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + + +#/dev/block/mmcblk0p2 /system ext4 ro wait +/dev/block/mmcblk0p3 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait +/dev/block/mmcblk0p4 /data ext4 noatime,nosuid,nodev,nomblk_io_submit,noauto_da_alloc,errors=panic wait + +# VOLD +/devices/13d00000.dwmmc2/mmc_host/mmc1 /storage/sdcard vfat default voldmanaged=sdcard:auto diff --git a/conf/fstab.gs101.sdboot b/conf/fstab.gs101.sdboot new file mode 100644 index 00000000..dd879551 --- /dev/null +++ b/conf/fstab.gs101.sdboot @@ -0,0 +1,14 @@ +# Android fstab file. +# +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + + +#/dev/block/mmcblk1p2 /system ext4 ro wait +/dev/block/mmcblk1p4 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait +/dev/block/mmcblk1p3 /data ext4 noatime,nosuid,nodev,nomblk_io_submit,noauto_da_alloc,errors=panic wait +/dev/block/mmcblk1p8 /efs ext4 defaults,rw wait + +# VOLD +/devices/10c00000.usb auto vfat default voldmanaged=usb1:auto +/devices/10c00000.usb/10c00000.dwc3/xhci-hcd auto vfat default voldmanaged=usb2:auto diff --git a/conf/fstab.persist b/conf/fstab.persist new file mode 100644 index 00000000..779a05d5 --- /dev/null +++ b/conf/fstab.persist @@ -0,0 +1,4 @@ +# Android fstab file. +# +# Keep persist in an fstab file, since we need to run fsck on it after abnormal shutdown. +/dev/block/platform/14700000.ufs/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,data=journal,commit=1 wait,check,formattable,metadata_csum diff --git a/conf/fstab.postinstall b/conf/fstab.postinstall new file mode 100644 index 00000000..955fba71 --- /dev/null +++ b/conf/fstab.postinstall @@ -0,0 +1,4 @@ +# Android fstab file. +# +# +system /postinstall ext4 ro,nosuid,nodev,noexec slotselect_other,logical,avb_keys=/product/etc/security/avb/system_other.avbpubkey diff --git a/conf/init.aoc.daemon.rc b/conf/init.aoc.daemon.rc new file mode 100644 index 00000000..1cf204e1 --- /dev/null +++ b/conf/init.aoc.daemon.rc @@ -0,0 +1 @@ +# AoC firmware will be loaded by Daemon \ No newline at end of file diff --git a/conf/init.aoc.nodaemon.rc b/conf/init.aoc.nodaemon.rc new file mode 100644 index 00000000..329d7d34 --- /dev/null +++ b/conf/init.aoc.nodaemon.rc @@ -0,0 +1,3 @@ +# Load AoC firmware and boot +on property:vendor.all.modules.ready=1 + write /sys/devices/platform/19000000.aoc/firmware aoc.bin \ No newline at end of file diff --git a/conf/init.debug.rc b/conf/init.debug.rc new file mode 100644 index 00000000..480cb3c3 --- /dev/null +++ b/conf/init.debug.rc @@ -0,0 +1,3 @@ +on property:vendor.debug.ramdump.force_crash=true + write /sys/kernel/pixel_debug/trigger "null" + diff --git a/conf/init.exynos.nanohub.rc b/conf/init.exynos.nanohub.rc new file mode 100644 index 00000000..9a582298 --- /dev/null +++ b/conf/init.exynos.nanohub.rc @@ -0,0 +1,20 @@ +on post-fs +## ensure correct calibration file permissions + chown root system /mnt/vendor/persist/sensorcal.json + chmod 0640 /mnt/vendor/persist/sensorcal.json + start vendor.flash-nanohub-fw + +on post-fs-data + mkdir /data/vendor/sensor + chown root system /data/vendor/sensor + chmod 0770 /data/vendor/sensor + +service vendor.flash-nanohub-fw /vendor/bin/nanoapp_cmd download + oneshot + disabled + user root + group system + +on post-fs-data + mkdir /data/system/nanohub_lock/ + restorecon /data/system/nanohub_lock diff --git a/conf/init.factory.rc b/conf/init.factory.rc new file mode 100644 index 00000000..60481051 --- /dev/null +++ b/conf/init.factory.rc @@ -0,0 +1,19 @@ +# Factory specific init.rc + +on init + export PATH /product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin:/vendor/bin/factory + +on post-fs-data + # HBM mode for UDFPS factory apk + chmod 666 /d/dri/0/DSI-1/panel/reg/payload + chmod 666 /d/dri/0/DSI-1/panel/hbm_mode + chmod 666 /sys/class/backlight/panel0-backlight/local_hbm_max_timeout + chmod 666 /sys/class/backlight/panel0-backlight/local_hbm_mode + chmod 666 /sys/class/backlight/panel0-backlight/hbm_mode + +on boot + # FTM log folder + mkdir /data/ftmlog 0775 system system + + # Audio test folder + mkdir /data/AudioTest 0775 system system diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc new file mode 100644 index 00000000..eb367397 --- /dev/null +++ b/conf/init.gs101.rc @@ -0,0 +1,685 @@ +import init.gs101.usb.rc +import android.hardware.drm@1.2-service.widevine.rc +import init.exynos.sensorhub.rc +import /vendor/etc/init/hw/init.aoc.rc + +service vendor.charger /system/bin/charger + class charger + seclabel u:r:charger:s0 + user system + group system wakelock input + capabilities SYS_BOOT + file /dev/kmsg w + file /sys/fs/pstore/console-ramoops-0 r + file /sys/fs/pstore/console-ramoops r + file /proc/last_kmsg r + +on early-init + mkdir /mnt/vendor/efs 0771 radio system + mkdir /mnt/vendor/efs_backup 0771 radio system + mkdir /mnt/vendor/modem_img 0771 radio system + mkdir /mnt/vendor/modem_userdata 0771 radio system + mkdir /mnt/vendor/persist 0771 system system + mount debugfs /sys/kernel/debug /sys/kernel/debug + mount_all /vendor/etc/fstab.persist --early + +on init + # CPU0 cannot be offline + chmod 0444 /sys/devices/system/cpu/cpu0/online + + # Boot time fs tuning + write /sys/block/sda/queue/iostats 0 + write /sys/block/sda/queue/scheduler bfq + write /sys/block/sda/queue/iosched/slice_idle 8 + write /sys/block/sda/queue/nr_requests 256 + write /dev/sys/fs/by-name/userdata/data_io_flag 56 + write /dev/sys/fs/by-name/userdata/node_io_flag 56 + + chown system system /sys/kernel/vendor_sched/clear_prefer_high_cap + chown system system /sys/kernel/vendor_sched/set_prefer_high_cap + chmod 0220 /sys/kernel/vendor_sched/clear_prefer_high_cap + chmod 0220 /sys/kernel/vendor_sched/set_prefer_high_cap + + wait /dev/block/platform/${ro.boot.boot_devices} + symlink /dev/block/platform/${ro.boot.boot_devices} /dev/block/bootdevice + + # to access UFS/eMMC sysfs directly + symlink /sys/devices/platform/${ro.boot.boot_devices} /dev/sys/block/bootdevice + + # Disable UFS powersaving + write /dev/sys/block/bootdevice/clkgate_enable 0 + + start vendor.keymaster-3-0 + + # ZRAM setup + write /sys/block/zram0/comp_algorithm lz77eh + write /proc/sys/vm/page-cluster 0 + + # Some user code relies on ro.boot.hardware.revision + setprop ro.boot.hardware.revision ${ro.revision} + + # Allow PAI targeting per hardware SKU + setprop ro.oem.key1 ${ro.boot.hardware.sku} + + # Property used by vintf for sku specific manifests + # Property used by NFC for sku specific configurations + setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku} + + # NFC streset tool name + setprop persist.vendor.nfc.streset libstreset21 + setprop persist.vendor.se.streset libstreset21 + + # Support legacy paths + 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_max 8388608 + write /proc/sys/net/core/wmem_default 327680 + write /proc/sys/net/core/wmem_max 8388608 + write /proc/sys/net/core/optmem_max 20480 + write /proc/sys/net/core/netdev_max_backlog 10000 + write /proc/sys/net/ipv4/tcp_rmem "2097152 4194304 8388608" + write /proc/sys/net/ipv4/tcp_wmem "262144 524288 1048576" + write /proc/sys/net/ipv4/tcp_mem "44259 59012 88518" + write /proc/sys/net/ipv4/udp_mem "88518 118025 177036" + + write /sys/class/net/rmnet0/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet1/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet2/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet3/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet4/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet5/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet6/queues/rx-0/rps_cpus fe + write /sys/class/net/rmnet7/queues/rx-0/rps_cpus fe + + # Create UDS structure for base VR services. + mkdir /dev/socket/pdx 0775 system system + mkdir /dev/socket/pdx/system 0775 system system + mkdir /dev/socket/pdx/system/buffer_hub 0775 system system + mkdir /dev/socket/pdx/system/performance 0775 system system + mkdir /dev/socket/pdx/system/vr 0775 system system + mkdir /dev/socket/pdx/system/vr/display 0775 system system + mkdir /dev/socket/pdx/system/vr/pose 0775 system system + mkdir /dev/socket/pdx/system/vr/sensors 0775 system system + + # EAS utilclamp boosting interfaces + chown system system /dev/cpuctl/top-app/cpu.uclamp.min + chown system system /dev/cpuctl/top-app/cpu.uclamp.max + chown system system /dev/cpuctl/top-app/cpu.uclamp.latency_sensitive + chown system system /dev/cpuctl/top-app/cgroup.procs + + chown system system /dev/cpuctl/foreground/cpu.uclamp.min + chown system system /dev/cpuctl/foreground/cpu.uclamp.max + chown system system /dev/cpuctl/foreground/cpu.uclamp.latency_sensitive + chown system system /dev/cpuctl/foreground/cgroup.procs + + chown system system /dev/cpuctl/background/cpu.uclamp.min + chown system system /dev/cpuctl/background/cpu.uclamp.max + chown system system /dev/cpuctl/background/cpu.uclamp.latency_sensitive + chown system system /dev/cpuctl/background/cgroup.procs + + chown system system /dev/cpuctl/rt/cpu.uclamp.min + chown system system /dev/cpuctl/rt/cpu.uclamp.max + chown system system /dev/cpuctl/rt/cpu.uclamp.latency_sensitive + chown system system /dev/cpuctl/rt/cgroup.procs + + write /dev/cpuctl/top-app/cpu.uclamp.min 30 + write /dev/cpuctl/top-app/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/foreground/cpu.uclamp.min 30 + write /dev/cpuctl/foreground/cpu.uclamp.latency_sensitive 1 + + # governor setting + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor sched_pixel + write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/up_rate_limit_us 500 + write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us 500 + write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor sched_pixel + write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/up_rate_limit_us 500 + write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/down_rate_limit_us 20000 + write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor sched_pixel + 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 + + # RT uclamp setting + write /proc/sys/kernel/sched_util_clamp_min_rt_default 0 + + # change permissions and default values for camera-daemon cpu controller + chown system system /dev/cpuctl/camera-daemon/cpu.uclamp.min + chown system system /dev/cpuctl/camera-daemon/cpu.uclamp.max + chown system system /dev/cpuctl/camera-daemon/cpu.uclamp.latency_sensitive + chown system system /dev/cpuctl/camera-daemon/cgroup.procs + write /dev/cpuctl/camera-daemon/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/camera-daemon/cpu.uclamp.min 0 + + chown system system /dev/cpuset/cgroup.procs + + # nanohub sensor + chmod 0664 /dev/nanohub + chmod 0664 /dev/nanohub_comms + chown system system /dev/nanohub + chown system system /dev/nanohub_comms + + # logbuffer + chown system system /dev/logbuffer_batt_ce + chown system system /dev/logbuffer_maxq + chown system system /dev/logbuffer_google,cpm + chown system system /dev/logbuffer_rtx + chown system system /dev/logbuffer_ssoc + chown system system /dev/logbuffer_ttf + chown system system /dev/logbuffer_usbpd + chown system system /dev/logbuffer_wireless + + # Dump maxfg + chown system system /sys/class/power_supply/maxfg/m5_model_state + chown system system /d/maxfg/fg_model + + # pca9468 : slider+77729: 6-0057; slider+MW A1: 5-0057 + chown system system /d/regmap/5-0057-pca9468-mains/registers + chown system system /d/regmap/6-0057-pca9468-mains/registers + + # Modem temperature driver + chown radio system /sys/devices/platform/cp-tm1/cp_temp + + # Loading common kernel modules in background + start insmod_sh_common + + # start watchdogd + start watchdogd + +# For GKI kernel, no device specific modules +on init + setprop vendor.device.modules.ready 1 + +on init && property:ro.boot.hw.soc.rev=0 + setprop vendor.powerhal.config powerhint_a0.json + +on init && property:ro.boot.hw.soc.rev=1 + setprop vendor.powerhal.config powerhint_a1.json + +on init && property:ro.boot.hw.soc.rev=0 + # STOPSHIP b/177967147 disable SICD + write /sys/devices/platform/cpupm/cpupm/sicd 0 + +on init && property:ro.boot.hw.soc.rev=1 + # STOPSHIP b/177967147 disable SICD + write /sys/devices/platform/cpupm/cpupm/sicd 0 + +on late-fs + # Wait for keymaster HALs + exec_start wait_for_keymaster + + # Start bootanimation class before mount + class_start animation + + # Mount RW partitions which need run fsck + mount_all /vendor/etc/fstab.gs101 --late + +on post-fs-data + # Log data folder + mkdir /data/log 0771 radio system + mkdir /data/log/abox 0771 audioserver system + mkdir /data/vendor 0771 radio system + mkdir /data/vendor/log 0771 radio system + mkdir /data/vendor/log/cbd 0771 radio system + mkdir /data/vendor/log/rfsd 0771 radio system + + mkdir /data/exynos/log 0771 radio system + mkdir /data/vendor/rild 0771 radio system + mkdir /data/vendor/dump 0771 radio system + mkdir /data/vendor/slog 0771 system system + + # PixelLogger log paths. + mkdir /data/vendor/radio 773 system radio + mkdir /data/vendor/radio/logs 773 system radio + mkdir /data/vendor/radio/logs/always-on 773 system radio + + # Modem extended log folder + mkdir /data/vendor/radio/extended_logs 0770 radio system + + # Modem MDS log folder + mkdir /data/vendor/radio/mds 0771 radio system + + # Unzipped modem images folder + mkdir /data/vendor/radio/image 0771 radio system + + # Modem stat folder + mkdir /data/vendor/modem_stat 0771 radio system + write /data/vendor/modem_stat/debug.txt "" + chown radio system /data/vendor/modem_stat/debug.txt + chmod 0664 /data/vendor/modem_stat/debug.txt + + # Modem replay folder + mkdir /mnt/vendor/modem_userdata/replay 0775 radio system + + setprop vold.post_fs_data_done 1 + setprop wifi.direct.interface p2p-dev-wlan0 + setprop wifi.aware.interface aware_nmi0 + +# IPSEC PIDDIR for VoWiFi + mkdir /data/vendor/misc 0771 root system + mkdir /data/vendor/misc/vpn 0771 root system + +# Permissions Camera + mkdir /data/camera 0777 root root + mkdir /data/vendor/camera 0770 system camera + chmod 0755 /sys/kernel/debug/tracing + restorecon /sys/kernel/debug/tracing/trace_marker + + # ranging sensor + chown system system /dev/stmvl53l1_ranging + chmod 0660 /dev/stmvl53l1_ranging + +# Audio dump and debug + mkdir /data/vendor/audio 0770 audio audio + + # Create the directories for Darwinn HAL. + mkdir /data/vendor/hal_neuralnetworks_darwinn 0770 system system + mkdir /data/vendor/hal_neuralnetworks_darwinn/checksum_cache 0770 system system + +on post-fs-data + # Create the directories used by the Wireless subsystem + mkdir /data/vendor/wifi 0771 wifi wifi + mkdir /data/vendor/wifi/wpa 0770 wifi wifi + mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi + +# Gatekeeper data + mkdir /data/vendor/gk 0771 system system + +# HWC data + mkdir /data/vendor/log/hwc 0771 system graphics + +# Video data + mkdir /data/vendor/media 0700 mediacodec mediacodec + +on post-fs-data + # GPS + mkdir /data/vendor/gps 0771 system system + chown system system /data/vendor/gps + rm /data/vendor/gps/gps_started + rm /data/vendor/gps/glonass_started + rm /data/vendor/gps/beidou_started + rm /data/vendor/gps/smd_started + rm /data/vendor/gps/sv_cno.info + + chown gps system /sys/devices/platform/10940000.spi/spi_master/spi5/spi5.0/nstandby + chmod 0664 /dev/ttyBCM + chown gps system /dev/ttyBCM + chmod 0664 /dev/bbd_control + chown gps system /dev/bbd_control + chmod 0664 /dev/bbd_patch + chown gps system /dev/bbd_patch + chmod 0664 /dev/bbd_sensor + chown gps system /dev/bbd_sensor + +on early-boot + # Wait for insmod_sh to finish all common modules + wait_for_prop vendor.common.modules.ready 1 + + # Wait for insmod_sh to finish all device specific modules + wait_for_prop vendor.device.modules.ready 1 + + # Other services depend on the properties + setprop vendor.all.modules.ready 1 + setprop vendor.all.devices.ready 1 + + # Update dm-verity state and set partition.*.verified properties + verity_update_state + + # Permission for Health Storage HAL + chown system system /dev/sys/block/bootdevice/manual_gc + + # Permission for Pixelstats + chown system system /dev/sys/block/bootdevice/slowio_read_cnt + chown system system /dev/sys/block/bootdevice/slowio_write_cnt + chown system system /dev/sys/block/bootdevice/slowio_unmap_cnt + chown system system /dev/sys/block/bootdevice/slowio_sync_cnt + + # Permission to allow system processes to access gpu clocks + chown system system /sys/devices/platform/1c500000.mali/dvfs_min_lock + chmod 0660 /sys/devices/platform/1c500000.mali/dvfs_min_lock + chown system system /sys/devices/platform/1c500000.mali/scaling_min_freq + chmod 0660 /sys/devices/platform/1c500000.mali/scaling_min_freq + +on boot + + # Allow to access debugfs for system:system + chmod 0755 /sys/kernel/debug + chown system system /sys/kernel/debug + + #setprop ro.radio.noril no + + # default country code + setprop ro.boot.wificountrycode 00 + + # Set up kernel tracing, but disable it by default + chmod 0222 /sys/kernel/debug/tracing/trace_marker + write /sys/kernel/debug/tracing/tracing_on 0 + + # Change permission for A-Box firmware logs file & GPR dump + chown audioserver system /sys/devices/platform/17c50000.abox/reset + chown audioserver system /sys/devices/platform/17c50000.abox/service + chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/gpr + chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/calliope_sram + chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/calliope_dram + chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/calliope_iva + chown audioserver system /sys/kernel/debug/abox/log-00 + +# Permission for USB SELECT + chown system system /sys/class/android_usb/android0/enable + chmod 0660 /sys/class/android_usb/android0/enable + chown system system /sys/class/android_usb/android0/idVendor + chmod 0660 /sys/class/android_usb/android0/idVendor + chown system system /sys/class/android_usb/android0/idProduct + chmod 0660 /sys/class/android_usb/android0/idProduct + chown system system /sys/class/android_usb/android0/f_diag/clients + chmod 0660 /sys/class/android_usb/android0/f_diag/clients + chown system system /sys/class/android_usb/android0/functions + chmod 0660 /sys/class/android_usb/android0/functions + chown system system /sys/class/android_usb/android0/bDeviceClass + chmod 0660 /sys/class/android_usb/android0/bDeviceClass + +# Permission for UART SWITCH + chmod 0660 /sys/class/sec/switch/uart_sel + chown system system /sys/class/sec/switch/uart_sel + +# VTS sysfs file permission + chown audioserver system /sys/devices/platform/13810000.vts/vts_svoice_model + chown audioserver system /sys/devices/platform/13810000.vts/vts_google_model + chmod 0660 /sys/devices/platform/13810000.vts/vts_svoice_model + chmod 0660 /sys/devices/platform/13810000.vts/vts_google_model + +# WLAN firmware/driver path + chown wifi wifi /sys/module/bcmdhd/parameters/nvram_path + chown wifi wifi /sys/module/bcmdhd/parameters/firmware_path + +on nonencrypted + mkdir /data/misc/mcRegistry 0775 system drmrpc + +on property:vold.decrypt=trigger_restart_framework + mkdir /data/misc/mcRegistry 0775 system drmrpc + +on property:persist.vendor.radio.no_modem_board=1 + setprop ro.radio.noril yes + +on fs + mount_all /vendor/etc/fstab.gs101 --early + chown radio system /mnt/vendor/efs + restorecon_recursive /mnt/vendor/efs + chown radio system /mnt/vendor/efs_backup + restorecon_recursive /mnt/vendor/efs_backup + chown radio system /mnt/vendor/modem_userdata + restorecon_recursive /mnt/vendor/modem_userdata + + # Configure multi-bin radio + chown radio system /mnt/vendor/modem_img + restorecon_recursive /mnt/vendor/modem_img + + restorecon_recursive /mnt/vendor/persist + restorecon_recursive /mnt/vendor/persist/audio + restorecon_recursive /mnt/vendor/persist/sensors + restorecon_recursive /mnt/vendor/persist/battery + # Set up display-related directories and permissions + # Add restorecon_recursive command to make sure the restorecon label is persist_display_file. + restorecon_recursive /mnt/vendor/persist/display + mkdir /mnt/vendor/persist/data/sfs 0700 system system + mkdir /mnt/vendor/persist/data/tz 0700 system system + mkdir /mnt/vendor/persist/touch 0770 system system + + # Enable rmnet data and aggregation + setprop persist.rmnet.mux enabled + setprop persist.rmnet.data.enable true + setprop persist.data.wda.enable true + setprop persist.data.df.agg.dl_pkt 10 + setprop persist.data.df.agg.dl_size 4096 + +# Permissions for ION + chmod 0660 /sys/class/ion_cma/ion_video_ext/isolated + chown system system /sys/class/ion_cma/ion_video_ext/isolated + +# Permissions for hwcomposer + chown system system /sys/class/backlight/panel0-backlight/als_table + chown system system /sys/class/backlight/panel0-backlight/brightness + chown system system /sys/class/backlight/panel0-backlight/hbm_mode + chown system system /sys/devices/platform/exynos-drm/primary-panel/gamma + chown system system /sys/module/drm/parameters/vblankoffdelay + +# Copy DRM Key +# copy /system/app/wv.keys /factory/wv.keys + +# Permission for DRM Key +# chmod 0644 /factory/wv.keys + +# Permission for flashlight control for HAL3.3 +# The Istor espresso board does not have the flash led h/w, So the below permission line are blocked. +# If you want to test the flashlight in board which have the flash led h/w, Enable the below blocked lines. + chmod 0660 /sys/class/camera/flash/rear_torch_flash + chown system camera /sys/class/camera/flash/rear_torch_flash +#load ecd firmware + write /proc/ecd/load_firmware 1 + +service abox /vendor/bin/main_abox 17c50000.abox + class late_start + user audioserver + group audioserver + seclabel u:r:abox:s0 + +service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ + -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1p2p_device=1 \ + -m/vendor/etc/wifi/p2p_supplicant.conf \ + -g@android:wpa_wlan0 -dd + interface android.hardware.wifi.supplicant@1.0::ISupplicant default + interface android.hardware.wifi.supplicant@1.1::ISupplicant default + interface android.hardware.wifi.supplicant@1.2::ISupplicant default + socket wpa_wlan0 dgram 660 wifi wifi + class main + disabled + oneshot + + +# 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 + +# 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 + write /sys/module/fiq_debugger/parameters/kgdb_enable 1 + +# Touch +on property:vendor.device.modules.ready=1 + chown system system /sys/class/spi_master/spi11/spi11.0/stm_fts_cmd + chown system system /sys/class/spi_master/spi11/spi11.0/glove_mode + chown system system /sys/class/spi_master/spi6/spi6.0/stm_fts_cmd + chown system system /sys/class/spi_master/spi6/spi6.0/glove_mode + chown system system /sys/devices/virtual/sec/tsp/fw_version + 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 + +on property:init.svc.vendor.charger=running + stop keymaster-4-0 + + setprop sys.usb.configfs 1 + setprop vendor.setup.power 1 + + # keep one little and one big + write /sys/devices/system/cpu/cpu1/online 0 + write /sys/devices/system/cpu/cpu2/online 0 + write /sys/devices/system/cpu/cpu3/online 0 + write /sys/devices/system/cpu/cpu4/online 0 + write /sys/devices/system/cpu/cpu5/online 0 + write /sys/devices/system/cpu/cpu7/online 0 + +on property:sys.boot_completed=1 + + # Runtime fs tuning + write /sys/block/sda/queue/nr_requests 128 + write /sys/block/sda/queue/iostats 1 + write /dev/sys/fs/by-name/userdata/data_io_flag 8 + write /dev/sys/fs/by-name/userdata/node_io_flag 8 + + # Block layer tuning: discard chunk size up to 128MB + # Otherwise, contiguous discards can be merged + write /sys/block/sda/queue/discard_max_bytes 134217728 + + # Enable ZRAM on boot_complete + swapon_all /vendor/etc/fstab.${ro.board.platform} + write /proc/sys/vm/swappiness 100 + + # Back to default VM settings + write /proc/sys/vm/dirty_expire_centisecs 3000 + write /proc/sys/vm/dirty_background_ratio 10 + + # Enable UFS powersaving + write /dev/sys/block/bootdevice/clkgate_enable 1 + + # Setup final cpuset + write /dev/cpuset/top-app/cpus 0-7 + write /dev/cpuset/foreground/cpus 0-3,4-5 + write /dev/cpuset/background/cpus 0-1 + write /dev/cpuset/system-background/cpus 0-3 + write /dev/cpuset/restricted/cpus 0-3 + write /dev/cpuset/camera-daemon/cpus 0-7 + setprop vendor.powerhal.init 1 + + # Setup final cpu.uclamp + write /dev/cpuctl/top-app/cpu.uclamp.min 10 + write /dev/cpuctl/foreground/cpu.uclamp.min 0 + + # gvotables for dumpstate + chown system system /sys/kernel/debug/gvotables + + # Permission for wireless charging + chown system system /sys/class/power_supply/wireless/capacity + chown system system /sys/class/power_supply/wireless/device/rtx + chown system system /sys/class/power_supply/wireless/device/rxdata + chown system system /sys/class/power_supply/wireless/device/txdata + chown system system /sys/class/power_supply/wireless/device/rxlen + chown system system /sys/class/power_supply/wireless/device/txlen + chown system system /sys/class/power_supply/wireless/device/ccreset + chown system system /sys/class/power_supply/wireless/device/status + chown system system /sys/class/power_supply/wireless/device/version + +# IMS WiFi Calling + service charonservice /system/vendor/bin/charon + class main + user root + disabled + seclabel u:r:charonservice:s0 + +on property:vendor.charon.exec=1 + rm /data/vendor/misc/vpn/charon.pid + chmod 0666 /dev/tun + start charonservice + +on property:vendor.charon.exec=0 + stop charonservice + rm /data/vendor/misc/vpn/charon.pid + +# IMS packet router daemon +service pktrouter /system/vendor/bin/wfc-pkt-router + class main + user root + disabled + seclabel u:r:pktrouter:s0 + +on property:vendor.pktrouter=1 + start pktrouter + +on property:vendor.pktrouter=0 + stop pktrouter + +# charger driver exposes now finer grain control, map demo mode to those properties +# NOTE: demo mode can only be exit wiping data (which reset the persist properties) +on property:sys.retaildemo.enabled=1 + setprop persist.vendor.charge.stop.level 35 + setprop persist.vendor.charge.start.level 30 + +on property:persist.vendor.charge.stop.level=* + write /sys/devices/platform/google,charger/charge_stop_level ${persist.vendor.charge.stop.level} + +on property:persist.vendor.charge.start.level=* + write /sys/devices/platform/google,charger/charge_start_level ${persist.vendor.charge.start.level} + +service insmod_sh_common /vendor/bin/init.insmod.sh /vendor/etc/init.insmod.gs101.cfg + 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 + disabled + oneshot + keycodes 114 115 116 + +# Proxy for Secure Storage +on post-fs-data + mkdir /data/vendor/rebootescrow 0770 hsm hsm + start vendor.rebootescrow-citadel + mkdir /data/vendor/ss 0770 root system + mkdir /mnt/vendor/persist/ss 0770 root system + 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 /dev/sg1 + + start storageproxyd + +service storageproxyd /vendor/bin/storageproxyd -d /dev/trusty-ipc-dev0 \ + -r /dev/sg1 -p /data/vendor/ss -t ufs + class main + disabled + user root + +# Write build info to kdebuginfo +on property:ro.build.fingerprint=* + write /sys/module/debug_kinfo/parameters/build_info ${ro.build.fingerprint} + +# Bluetooth +on post-fs-data + chown bluetooth system /sys/devices/platform/175b0000.serial/serial0/serial0-0/bluetooth/hci0/rfkill0/state + chown bluetooth system /sys/devices/platform/odm/odm:btbcm/rfkill/rfkill0/state + chown bluetooth system /sys/devices/platform/odm/odm:btbcm/rfkill/rfkill2/state + chown bluetooth system /proc/bluetooth/sleep/btwake + chown bluetooth system /proc/bluetooth/sleep/lpm + chown bluetooth system /proc/bluetooth/sleep/btwrite + +# ODPM +on fs + chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-7/7-001f/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails + chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-8/8-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails diff --git a/conf/init.gs101.usb.rc b/conf/init.gs101.usb.rc new file mode 100644 index 00000000..597b25b5 --- /dev/null +++ b/conf/init.gs101.usb.rc @@ -0,0 +1,250 @@ +on early-boot + mkdir /config/usb_gadget/g1 + mkdir /config/usb_gadget/g1/strings/0x409 + mkdir /config/usb_gadget/g1/configs/b.1 + write /config/usb_gadget/g1/idVendor 0x18d1 + write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} + write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} + write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} + write /config/usb_gadget/g1/configs/b.1/MaxPower 0x384 + write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 + write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" + + # ffs function + mkdir /config/usb_gadget/g1/functions/ffs.adb 0770 shell shell + mkdir /config/usb_gadget/g1/functions/ffs.mtp + mkdir /config/usb_gadget/g1/functions/ffs.ptp + mkdir /dev/usb-ffs 0775 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mkdir /dev/usb-ffs/mtp 0770 mtp mtp + mkdir /dev/usb-ffs/ptp 0770 mtp mtp + mount functionfs adb /dev/usb-ffs/adb rmode=0770,fmode=0660,uid=2000,gid=2000,no_disconnect=1 + mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 + mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 + setprop sys.usb.mtp.device_type 3 + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 + + # mtp function + mkdir /config/usb_gadget/g1/functions/mtp.gs0 + + # ptp function + mkdir /config/usb_gadget/g1/functions/ptp.gs1 + + # accessory function + mkdir /config/usb_gadget/g1/functions/accessory.gs2 + + # audio_source function + mkdir /config/usb_gadget/g1/functions/audio_source.gs3 + + # rndis function + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + # Modify class/subclass/protocol for rndis.gs4 + # Remote NDIS: Class: Wireless Controller (0xe0), Subclass: 0x1, Protocol: 0x3 + write /config/usb_gadget/g1/functions/rndis.gs4/class e0 + write /config/usb_gadget/g1/functions/rndis.gs4/subclass 01 + write /config/usb_gadget/g1/functions/rndis.gs4/protocol 03 + write /config/usb_gadget/g1/functions/rndis.gs4/ifname rndis%d + setprop vendor.usb.rndis.config ncm.gs9 + + # midi function + mkdir /config/usb_gadget/g1/functions/midi.gs5 + + # acm function + mkdir /config/usb_gadget/g1/functions/acm.gs6 + + # dm function + mkdir /config/usb_gadget/g1/functions/dm.gs7 + + # uts function + mkdir /config/usb_gadget/g1/functions/uts.gs8 + + # ncm function + mkdir /config/usb_gadget/g1/functions/ncm.gs9 + write /config/usb_gadget/g1/functions/ncm.gs9/os_desc/interface.ncm/compatible_id WINNCM + + # etr_miu function + mkdir /config/usb_gadget/g1/functions/etr_miu.gs11 + + setprop vendor.usb.functions.ready 1 + +on boot + write /config/usb_gadget/g1/bcdDevice 0x0510 + # Use USB Gadget HAL + setprop sys.usb.configfs 2 + +on property:sys.usb.config=accessory && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2D00 + write /config/usb_gadget/g1/idVendor 0x18D1 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2D01 + write /config/usb_gadget/g1/idVendor 0x18D1 + +on property:sys.usb.config=none && property:sys.usb.configfs=1 + rm /config/usb_gadget/g1/configs/b.1/f4 + +on property:sys.usb.config=mtp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6860 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.config=ptp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6860 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6860 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6860 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.config=rndis && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6863 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6864 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.config=ptp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6865 + write /config/usb_gadget/g1/idVendor 0x04E8 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x6866 + write /config/usb_gadget/g1/idVendor 0x04E8 + +# Enable dm,acm,adb functions once in factory build +on property:ro.vendor.factory=1 && property:sys.usb.configfs=1 && property:sys.boot_completed=1 + setprop sys.usb.config dm,acm,adb + +# We introduce lsi mode to call sys.usb.config none +on property:sys.usb.config=rndis,acm,dm,adb && property:sys.usb.configfs=1 + setprop sys.usb.config "none" + setprop sys.usb.config "lsi-rndis,acm,dm,adb" + +on property:sys.usb.config=lsi-rndis,acm,dm,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=lsi-rndis,acm,dm,adb && property:sys.usb.configfs=1 + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + write /config/usb_gadget/g1/idProduct 0x6862 + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_acm_dm_adb" + symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/acm.gs6 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/dm.gs7 /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=dm,acm,adb && property:sys.usb.configfs=1 + setprop sys.usb.config "none" + setprop sys.usb.config "lsi-dm,acm,adb" + +on property:sys.usb.config=lsi-dm,acm,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=lsi-dm,acm,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x685D + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "dm_acm_adb" + symlink /config/usb_gadget/g1/functions/dm.gs7 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/acm.gs6 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=dm,acm,uts,adb && property:sys.usb.configfs=1 + setprop sys.usb.config "none" + setprop sys.usb.config "lsi-dm,acm,uts,adb" + +on property:sys.usb.config=lsi-dm,acm,uts,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=lsi-dm,acm,uts,adb && property:sys.usb.configfs=1 + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + write /config/usb_gadget/g1/idProduct 0x6862 + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "dm_acm_uts_adb" + symlink /config/usb_gadget/g1/functions/dm.gs7 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/acm.gs6 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/uts.gs8 /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x685B + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage" + symlink /config/usb_gadget/g1/functions/mass_storage.gs9 /config/usb_gadget/g1/configs/b.1/f1 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x685E + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage_adb" + symlink /config/usb_gadget/g1/functions/mass_storage.gs9 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,acm && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x685E + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage_acm" + symlink /config/usb_gadget/g1/functions/mass_storage.gs9 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/acm.gs6 /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6862 + write /sys/class/android_usb/android0/f_diag/clients diag_mdm + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1 + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + write /config/usb_gadget/g1/idProduct 0x6862 + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag" + symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.gs10 /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x685d + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_acm" + symlink /config/usb_gadget/g1/functions/diag.gs10 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/acm.gs6 /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,acm,diag && property:sys.usb.configfs=1 + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + write /config/usb_gadget/g1/idProduct 0x6864 + write /config/usb_gadget/g1/idVendor 0x04E8 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_acm_diag" + symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/acm.gs6 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/diag.gs10 /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:vendor.usb.config=* + start usbd + +on property:persist.vendor.usb.usbradio.config=* + start usbd diff --git a/conf/init.recovery.device.rc b/conf/init.recovery.device.rc new file mode 100644 index 00000000..9f926507 --- /dev/null +++ b/conf/init.recovery.device.rc @@ -0,0 +1,14 @@ +on init + setprop sys.usb.configfs 1 + +on init && property:ro.debuggable=1 && property:ro.boot.mode=recovery + start recovery-console + +service recovery-console /system/bin/sh + class core + console + disabled + user root + group root shell log readproc + seclabel u:r:su:s0 + setenv HOSTNAME console diff --git a/conf/init.system_ext.rc b/conf/init.system_ext.rc new file mode 100644 index 00000000..4fb47b32 --- /dev/null +++ b/conf/init.system_ext.rc @@ -0,0 +1,4 @@ +on post-fs-data + # EdgeTPU data directory + mkdir /data/edgetpu 0770 system system encryption=Require + mkdir /data/edgetpu/cache 0770 system system diff --git a/conf/recovery.wipe b/conf/recovery.wipe new file mode 100644 index 00000000..9ee7a1e3 --- /dev/null +++ b/conf/recovery.wipe @@ -0,0 +1,3 @@ +# All the partitions to be wiped (in order) under recovery. +/dev/block/by-name/userdata +/dev/block/by-name/metadata diff --git a/conf/soundtrigger_conf.h b/conf/soundtrigger_conf.h new file mode 100644 index 00000000..1263c60b --- /dev/null +++ b/conf/soundtrigger_conf.h @@ -0,0 +1,109 @@ +/* + * 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. + */ +#ifndef __EXYNOS_SOUNDTRIGGERCONF_H__ +#define __EXYNOS_SOUNDTRIGGERCONF_H__ + +/********************************************************************/ +/** ALSA Framework Sound Card & Sound Device Information */ +/** */ +/** You can find Sound Device Name from /dev/snd. */ +/** Sound Device Name consist of Card Number & Device Number. */ +/** */ +/********************************************************************/ + +/* Sound Card and Mixer card Numbers based on Target Device */ +/* You have to match this number with real kernel information */ +#define VTS_SOUND_CARD 0 +#define VTS_MIXER_CARD 0 + +/* PCM Nodes number for seamless and normal recording*/ +#define VTS_TRICAP_DEVICE_NODE 13 +#define VTS_RECORD_DEVICE_NODE 14 + +/* sysfs file paths for loading model binaries into VTS kernel driver */ +#define VTS_HOTWORD_MODEL "/sys/devices/platform/13810000.vts/vts_google_model" +#define VTS_SVOICE_MODEL "/sys/devices/platform/13810000.vts/vts_svoice_model" + +#define AUDIO_PRIMARY_HAL_LIBRARY_PATH "/vendor/lib/libaudioproxy.so" + +// VTS Capture(Input) PCM Configuration +#define DEFAULT_VTS_CHANNELS 1 // Mono +#define DEFAULT_VTS_SAMPLING_RATE 16000 // 16KHz + +#define PRIMARY_VTS_PERIOD_SIZE 160 // 160 frames, 10ms in case of 16KHz Stream +#define PRIMARY_VTS_PERIOD_COUNT 1024 // Buffer count => Total 327680 Bytes = 160 * 1(Mono) * 2(16bit PCM) * 1024(Buffer count) + +/* VTS mixer controls */ +#define VTS_ACTIVE_KEYPHRASE_CTL_NAME "VTS Active Keyphrase" /* default: 0-"SVOICE", 1-"GOOGLE", 2-"SENSORY" */ +#define VTS_EXECUTION_MODE_CTL_NAME "VTS Execution Mode" /* 0-"OFF-MODE", 1-"VOICE-TRIG-MODE", 2-"SOUND-DECTECT-MODE", 3-"VT-ALWAYS-MODE" 4-"GOOGLE-TRI-MODE */ +#define VTS_VOICERECOGNIZE_START_CTL_NAME "VTS VoiceRecognize Start" /* 0-"Off", 1-On" */ +#define VTS_VOICETRIGGER_VALUE_CTL_NAME "VTS VoiceTrigger Value" /* 0 ~ 2000 ms*/ + +#define MAIN_MIC_CONTROL_COUNT 8 +#define HEADSET_MIC_CONTROL_COUNT 8 +#define MODEL_RECOGNIZE_CONTROL_COUNT 4 + +/* MIC Mixer controls for VTS */ +char *main_mic_ctlname[] = { + "VTS DMIC SEL", + "VTS DMIC IF RCH EN", + "VTS DMIC IF LCH EN", + "VTS SYS SEL", + "VTS HPF EN", + "VTS HPF SEL", + "DMIC1 Switch", + "VTS Virtual Output Mux", +}; + +char *headset_mic_ctlname[] = { + "AUXPDM1 Rate", + "AUXPDM1 Input", + "AUXPDM1 Output Switch", + "AUXPDM Switch", + "VTS DMIC SEL", + "VTS DMIC IF RCH EN", + "VTS DMIC IF LCH EN", + "VTS SYS SEL", + "VTS HPF EN", + "VTS HPF SEL", +}; + +/* MIC Mixer control values */ +/* FIXME : Double check this values */ +int main_mic_ctlvalue[] = { + 0, //"VTS DMIC SEL", + 1, //"VTS DMIC IF RCH EN", + 1, //"VTS DMIC IF LCH EN", + 1, //"VTS SYS SEL", + 1, //"VTS HPF EN", + 1, //"VTS HPF SEL", + 1, //"DMIC1 Switch", + 1, //"VTS Virtual Output Mux", +}; + +int headset_mic_ctlvalue[] = { + 3, //"AUXPDM1 Rate", + 0, //"AUXPDM1 Input", + 1, //"AUXPDM1 Output Switch", + 1, //"AUXPDM Switch", + 1, //"VTS DMIC SEL", + 1, //"VTS DMIC IF RCH EN", + 1, //"VTS DMIC IF LCH EN", + 1, //"VTS SYS SEL", + 1, //"VTS HPF EN", + 1, //"VTS HPF SEL", +}; +#endif // __EXYNOS_SOUNDTRIGGERCONF_H__ diff --git a/conf/ueventd.gs101.rc b/conf/ueventd.gs101.rc new file mode 100644 index 00000000..f85b24b6 --- /dev/null +++ b/conf/ueventd.gs101.rc @@ -0,0 +1,198 @@ +/dev/mali0 0666 system system +/dev/ion 0666 system system +/dev/ump 0666 system graphics +/dev/exynos-mem 0660 system graphics +/dev/video0 0660 system camera +/dev/video1 0660 system camera +/dev/video2 0660 system camera +/dev/video3 0660 system camera +/dev/video20 0660 system system +# media0 is used for GSC, DECON, etc +/dev/media0 0660 system camera +# media1 is used for DECON Ext WB +/dev/media1 0660 system graphics +# Various devices use the v4l-subdev interface +# We declare all such nodes simultaneously here +/dev/v4l-subdev0 0660 system camera +/dev/v4l-subdev1 0660 system camera +/dev/v4l-subdev2 0660 system camera +/dev/v4l-subdev3 0660 system camera +/dev/v4l-subdev4 0660 system camera +/dev/v4l-subdev5 0660 system camera +/dev/v4l-subdev6 0660 system camera +/dev/v4l-subdev7 0660 system camera +/dev/v4l-subdev8 0660 system camera +/dev/v4l-subdev9 0660 system camera +/dev/v4l-subdev10 0660 system camera +/dev/v4l-subdev11 0660 system camera +/dev/v4l-subdev12 0660 system camera +/dev/v4l-subdev13 0660 system camera +/dev/v4l-subdev14 0660 system camera +/dev/v4l-subdev15 0660 system camera +/dev/v4l-subdev16 0660 system camera +/dev/v4l-subdev17 0660 system camera +/dev/v4l-subdev18 0660 system camera +/dev/v4l-subdev19 0660 system camera +# v4l-subdev20 is used for DECON Ext WB +/dev/v4l-subdev20 0660 system graphics +/dev/v4l-subdev21 0660 system graphics +/dev/v4l-subdev32 0660 system graphics + +# gscalers +/dev/video23 0660 media graphics +/dev/video26 0660 media graphics +/dev/video24 0660 media graphics +/dev/video27 0660 media graphics +/dev/video29 0660 media graphics +/dev/video30 0660 media graphics +# video31 is used for DECON Ext WB +/dev/video31 0660 media graphics + +# mscalers +/dev/video50 0660 mediacodec drmrpc +/dev/m2m1shot_scaler0 0660 mediacodec drmrpc + +/dev/video55 0666 system graphics +/dev/g2d 0660 system graphics +/dev/fimg2d 0666 system graphics +/dev/i2c-2 0660 system system +/dev/HPD 0660 system system + +# wfd +/dev/tsmux 0660 media graphics +/dev/repeater 0660 media graphics + +# mfc +/dev/video6 0660 mediacodec mediadrm +/dev/video7 0660 mediacodec mediadrm +/dev/video8 0660 mediacodec mediadrm +/dev/video9 0660 mediacodec mediadrm +/dev/video10 0660 mediacodec mediadrm +/dev/video11 0660 mediacodec mediadrm + +# camera +/dev/media2 0660 media media +/dev/hdcp2 0660 media media + +# jpeg +/dev/m2m1shot_jpeg 0660 media media +/dev/video12 0660 cameraserver media + +# audio +/dev/seiren 0660 system audio +/dev/acd-audio_output_tuning 0660 system audio +/dev/acd-audio_bulk_tx 0660 system audio +/dev/acd-audio_bulk_rx 0660 system audio +/dev/acd-audio_input_tuning 0660 system audio +/dev/acd-audio_input_bulk_tx 0660 system audio +/dev/acd-audio_input_bulk_rx 0660 system audio +/dev/acd-sound_trigger 0660 system audio +/dev/acd-hotword_notification 0660 system audio +/dev/acd-hotword_pcm 0660 system audio +/dev/acd-ambient_pcm 0660 system audio +/dev/acd-model_data 0660 system audio +/dev/acd-debug 0660 system audio +/dev/acd-audio_tap* 0660 system audio + +# Secure MEM driver +/dev/s5p-smem 0660 drm drmrpc + +# cbd +/dev/block/by-name/modem 0440 radio radio +/dev/block/by-name/modem_a 0440 radio radio +/dev/block/by-name/modem_b 0440 radio radio + +# DM tools +/dev/umts_dm0 0660 system system +/dev/umts_router 0660 system system +/dev/ttyGS0 0660 system system +/dev/ttyGS1 0660 system system +/dev/ttyGS2 0660 system system + +# IPC RIL +/dev/umts_boot0 0660 radio system +/dev/umts_ipc0 0660 radio radio +/dev/umts_ipc1 0660 radio radio +/dev/umts_rfs0 0660 radio radio + +# IPC OEM +/dev/oem_ipc* 0660 radio radio + +# interactive governor parameters +/sys/devices/system/cpu/cpu* cpufreq/interactive/timer_rate 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/timer_slack 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/min_sample_time 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/hispeed_freq 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/target_loads 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/go_hispeed_load 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/above_hispeed_delay 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/boost 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/boostpulse 0200 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/input_boost 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/boostpulse_duration 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/io_is_busy 0660 system system + +# Vision (VPU, SCORE) +/dev/vertex0 0660 media media +/dev/vertex1 0660 media media + +# AoC +/dev/aoc 0660 system system + +# Sensors (USF) +/dev/acd-com.google.usf 0660 system system + +# LWIS +/dev/lwis* 0660 system system + +# NFC +/dev/st21nfc 0660 nfc nfc + +# SecureElement +/dev/st54j_se 0660 secure_element secure_element +/dev/st54spi 0660 secure_element secure_element +/dev/st33spi 0660 secure_element secure_element + +#bigocean +/dev/bigocean 0660 mediacodec mediadrm + +# Trusty +/dev/trusty-ipc-dev0 0660 system drmrpc + +# Citadel +/dev/gsc0 0660 hsm hsm + +# Storage: for factory reset protection feature +/dev/block/by-name/frp 0660 system system + +# TPU +/dev/abrolhos 0660 system system + +# TOE +/dev/dit2 0660 radio radio + +# Bluetooth +/dev/ttySAC16 0660 bluetooth system + +# BT Wifi Coexistence +/dev/wbrc 0660 system system + +# TUI +/dev/tui-driver 0660 system system + +# DMA-BUF heaps +/dev/dma_heap/crypto 0444 system graphics +/dev/dma_heap/crypto-uncached 0444 system graphics +/dev/dma_heap/faceauth_tpu-secure 0444 system graphics +/dev/dma_heap/faimg-secure 0444 system graphics +/dev/dma_heap/famodel-secure 0444 system graphics +/dev/dma_heap/faprev-secure 0444 system graphics +/dev/dma_heap/farawimg-secure 0444 system graphics +/dev/dma_heap/tui 0444 system graphics +/dev/dma_heap/tui-uncached 0444 system graphics +/dev/dma_heap/vframe-secure 0444 system drmrpc +/dev/dma_heap/video_system 0444 system drmrpc +/dev/dma_heap/video_system-uncached 0444 system drmrpc +/dev/dma_heap/vscaler-secure 0444 system graphics +/dev/dma_heap/vstream-secure 0444 system drmrpc +/dev/dma_heap/sensor_direct_heap 0444 system graphics diff --git a/default-permissions.xml b/default-permissions.xml new file mode 100644 index 00000000..4524ddb7 --- /dev/null +++ b/default-permissions.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device-common.mk b/device-common.mk new file mode 100644 index 00000000..d0e4ca16 --- /dev/null +++ b/device-common.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2020 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include device/google/gs101/device.mk + +# Telephony +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.telephony.carrierlock.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.carrierlock.xml + diff --git a/device-shipping-common.mk b/device-shipping-common.mk new file mode 100644 index 00000000..7cd033bd --- /dev/null +++ b/device-shipping-common.mk @@ -0,0 +1,31 @@ +# +# Copyright (C) 2020 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +include device/google/gs101/device-common.mk +include device/google/gs101/fingerprint/udfps.mk + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.bluetooth.a2dp_offload.supported=true \ + persist.bluetooth.a2dp_offload.disabled=false \ + persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac + +# SecureElement +PRODUCT_PACKAGES += \ + android.hardware.secure_element@1.2-service-gto \ + android.hardware.secure_element@1.2-service-gto-ese2 + +PRODUCT_COPY_FILES += \ + device/google/gs101/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf \ + device/google/gs101/nfc/libse-gto-hal2.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal2.conf diff --git a/device.mk b/device.mk new file mode 100644 index 00000000..617797ba --- /dev/null +++ b/device.mk @@ -0,0 +1,1144 @@ +# +# Copyright (C) 2011 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. +# + +TARGET_BOARD_PLATFORM := gs101 + +ifneq (,$(filter %_64,$(TARGET_PRODUCT))) +LOCAL_64ONLY := _64 +endif + +AB_OTA_POSTINSTALL_CONFIG += \ + RUN_POSTINSTALL_system=true \ + POSTINSTALL_PATH_system=system/bin/otapreopt_script \ + FILESYSTEM_TYPE_system=ext4 \ +POSTINSTALL_OPTIONAL_system=true + +# Set Vendor SPL to match platform +VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) + +PRODUCT_SOONG_NAMESPACES += \ + hardware/google/av \ + hardware/google/gchips \ + hardware/google/graphics/common \ + hardware/google/graphics/gs101 \ + hardware/google/interfaces \ + hardware/google/pixel \ + device/google/gs101 \ + vendor/google/whitechapel/tools \ + vendor/arm/mali/valhall \ + vendor/arm/mali/valhall/cl \ + vendor/arm/mali/valhall/libmali \ + vendor/arm/mali/valhall/cinstr/production/gpu-hwc-reader \ + vendor/broadcom/bluetooth \ + vendor/google/camera \ + vendor/google/interfaces \ + vendor/google_devices/common/proprietary/confirmatioui_hal \ + vendor/google_nos/host/android \ + vendor/google_nos/test/system-test-harness + +DEVICE_USES_EXYNOS_GRALLOC_VERSION := 3 + +ifeq ($(TARGET_PREBUILT_KERNEL),) +LOCAL_KERNEL := $(TARGET_KERNEL_DIR)/Image.lz4 +else +LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) +endif + +LOCAL_USES_SDMMC_BOOT := false +LOCAL_USES_UFS_BOOT := true +LOCAL_USES_EMMC_BOOT := false + +# Metadata Encryption +# Because the kernel interface to dm-default-key changed in Android R, +# you also need to ensure that you have set the correct value for +# PRODUCT_SHIPPING_API_LEVEL in device.mk. For example, if your device +# launches with Android R (API level 30), device.mk should contain: +# PRODUCT_SHIPPING_API_LEVEL := 30 +# You can also set the following system property to force the use of +# the new dm-default-key API regardless of shipping API level: +PRODUCT_PROPERTY_OVERRIDES += \ + ro.crypto.dm_default_key.options_format.version=2 + +# OEM Unlock reporting +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ + ro.oem_unlock_supported=1 + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +#Set IKE logs to verbose for WFC +PRODUCT_PROPERTY_OVERRIDES += log.tag.IKE=VERBOSE +endif + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +# b/36703476: Set default log size to 1M +PRODUCT_PROPERTY_OVERRIDES += \ + ro.logd.size=1M +# b/114766334: persist all logs by default rotating on 30 files of 1MiB +PRODUCT_PROPERTY_OVERRIDES += \ + logd.logpersistd=logcatd \ + logd.logpersistd.size=30 +endif + +# From system.property +PRODUCT_PROPERTY_OVERRIDES += \ + ro.arch=gs101 \ + persist.demo.hdmirotationlock=false \ + dev.usbsetting.embedded=on \ + ro.debug_level=0x494d \ + ro.telephony.default_network=27 \ + persist.vendor.ril.use.iccid_to_plmn=1 \ + persist.vendor.ril.emergencynumber.mode=5 + #rild.libpath=/system/lib64/libsec-ril.so \ + #rild.libargs=-d /dev/umts_ipc0 + +# SIT-RIL Logging setting +PRODUCT_PROPERTY_OVERRIDES += \ + persist.vendor.ril.log_mask=3 \ + persist.vendor.ril.log.base_dir=/data/vendor/radio/sit-ril \ + persist.vendor.ril.log.chunk_size=5242880 \ + persist.vendor.ril.log.num_file=3 + +# Enable reboot free DSDS +PRODUCT_PRODUCT_PROPERTIES += \ + persist.radio.reboot_on_modem_change=false + +# Carrier configuration default location +PRODUCT_PROPERTY_OVERRIDES += \ + persist.vendor.radio.config.carrier_config_dir=/mnt/vendor/modem_img/images/default/confpack + +# GPU profiling +PRODUCT_PRODUCT_PROPERTIES += graphics.gpu.profiler.support=true +PRODUCT_PACKAGES += \ + android.hardware.neuralnetworks@1.2-service-armnn + +PRODUCT_PROPERTY_OVERRIDES += \ + telephony.active_modems.max_count=2 + +USE_LASSEN_OEMHOOK := true + +# Use for GRIL +USES_LASSEN_MODEM := true + +ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) +# Audio client implementation for RIL +USES_GAUDIO := true +endif + +# This should be the same value as BOARD_USES_SWIFTSHADER in BoardConfig.mk +USE_SWIFTSHADER := false + +ifeq ($(USE_SWIFTSHADER),true) +PRODUCT_PROPERTY_OVERRIDES += \ + ro.hardware.egl = swiftshader +else +PRODUCT_PROPERTY_OVERRIDES += \ + ro.hardware.egl = mali +endif + +# Device Manifest, Device Compatibility Matrix for Treble +ifeq ($(DEVICE_USES_EXYNOS_GRALLOC_VERSION), 4) + DEVICE_MANIFEST_FILE := \ + device/google/gs101/manifest$(LOCAL_64ONLY).xml +else + DEVICE_MANIFEST_FILE := \ + device/google/gs101/manifest$(LOCAL_64ONLY)-gralloc3.xml +endif + +ifneq (,$(filter aosp_%,$(TARGET_PRODUCT))) +DEVICE_MANIFEST_FILE += \ + device/google/gs101/manifest_media_aosp.xml + +PRODUCT_COPY_FILES += \ + device/google/gs101/media_codecs_aosp_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_c2.xml +else +DEVICE_MANIFEST_FILE += \ + device/google/gs101/manifest_media.xml + +PRODUCT_COPY_FILES += \ + device/google/gs101/media_codecs_bo_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_c2.xml \ + device/google/gs101/media_codecs_aosp_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_aosp_c2.xml +endif + +DEVICE_MATRIX_FILE := \ + device/google/gs101/compatibility_matrix.xml + +DEVICE_PACKAGE_OVERLAYS += device/google/gs101/overlay + +# This will be updated to 31 (Android S) for shipping +PRODUCT_SHIPPING_API_LEVEL := 30 + +# Do not enforce the kernel requirement temporarily since it is not ready +# Eventually this configuration should be removed +PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false + +# Enforce the Product interface +PRODUCT_PRODUCT_VNDK_VERSION := current +PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE := true + +# Init files +PRODUCT_COPY_FILES += \ + $(LOCAL_KERNEL):kernel \ + device/google/gs101/conf/init.gs101.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.gs101.usb.rc \ + device/google/gs101/conf/ueventd.gs101.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc + +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.gs101.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.gs101.rc + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.debug.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.debug.rc +endif + +# Init files for /system_ext +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.system_ext.rc:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/init/init.system_ext.rc + +# Native libraries needed for applications under /system_ext +PRODUCT_COPY_FILES += \ + device/google/gs101/public.libraries-google.txt:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/public.libraries-google.txt + +# If AoC Daemon is not present on this build, load firmware at boot via rc +ifeq ($(wildcard vendor/google/whitechapel/aoc/aocd),) +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.aoc.nodaemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.aoc.rc +else +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.aoc.daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.aoc.rc +endif + +# Recovery files +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.gs101.rc +ifeq ($(LOCAL_USES_SDMMC_BOOT),true) +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/fstab.gs101.sdboot:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.gs101 \ + device/google/gs101/conf/fstab.gs101.sdboot:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.gs101 +else +ifeq ($(LOCAL_USES_UFS_BOOT),true) +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/fstab.gs101:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.gs101 \ + device/google/gs101/conf/fstab.gs101:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.gs101 \ + device/google/gs101/conf/fstab.persist:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.persist \ + device/google/gs101/conf/fstab.gs101:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.gs101 +else +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/fstab.gs101.emmc:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.gs101 \ + device/google/gs101/conf/fstab.gs101.emmc:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.gs101 +endif +endif + +# Shell scripts +PRODUCT_COPY_FILES += \ + device/google/gs101/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \ + device/google/gs101/init.ramoops.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ramoops.sh + +# insmod files +PRODUCT_COPY_FILES += \ + device/google/gs101/init.insmod.gs101.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/init.insmod.gs101.cfg + +# For creating dtbo image +PRODUCT_HOST_PACKAGES += \ + mkdtimg + +PRODUCT_PACKAGES += \ + messaging + +# Contexthub HAL +PRODUCT_PACKAGES += \ + android.hardware.contexthub@1.2-service.small_fragments + +# CHRE tools +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PACKAGES += \ + chre_power_test_client \ + chre_test_client +endif + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.context_hub.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.context_hub.xml + +# Enable the CHRE Daemon +CHRE_USF_DAEMON_ENABLED := true +PRODUCT_PACKAGES += \ + chre \ + preloaded_nanoapps.json + +# Filesystem management tools +PRODUCT_PACKAGES += \ + linker.vendor_ramdisk \ + tune2fs.vendor_ramdisk \ + resize2fs.vendor_ramdisk + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.crypto.volume.filenames_mode=aes-256-cts + +# Userdata Checkpointing OTA GC +PRODUCT_PACKAGES += \ + checkpoint_gc + +# CP Logging properties +PRODUCT_PROPERTY_OVERRIDES += \ + ro.vendor.sys.modem.logging.loc = /data/vendor/slog \ + persist.vendor.sys.silentlog.tcp = "On" \ + ro.vendor.cbd.modem_removable = "1" \ + ro.vendor.cbd.modem_type = "s5100sit" \ + persist.vendor.sys.modem.logging.br_num=5 + +# Enable silent CP crash handling +PRODUCT_PROPERTY_OVERRIDES += \ + persist.vendor.ril.crash_handling_mode=1 + +# Add support dual SIM mode +PRODUCT_PROPERTY_OVERRIDES += \ + persist.vendor.radio.multisim_switch_support=true + +# RPMB TA +PRODUCT_PACKAGES += \ + tlrpmb + +# Touch firmware +#PRODUCT_COPY_FILES += \ + device/google/gs101/firmware/touch/s6sy761.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/s6sy761.fw + +# Sensors +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml\ + frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml + +# Sensor HAL +#TARGET_USES_NANOHUB_SENSORHAL := true +#NANOHUB_SENSORHAL_SENSORLIST := device/google/gs101/sensorhal/sensorlist.cpp + +#PRODUCT_PACKAGES += \ + context_hub.default \ + android.hardware.sensors@1.0-impl \ + android.hardware.sensors@1.0-service \ + sensors.gs101 \ + +# sensor utilities +#PRODUCT_PACKAGES += \ + nanoapp_cmd + +# sensor utilities (only for userdebug and eng builds) +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +#PRODUCT_PACKAGES += \ + nanotool \ + sensortest +endif #filter TARGET_BUILD_VARIANT + +# Cannot reference variables defined in BoardConfig.mk +#ifeq ($(BOARD_USES_EXYNOS_SENSORS_DUMMY), true) +# Set USF sensor HAL to 2.0. +USF_SENSOR_HAL_2_0 := true + +ifeq ($(USF_SENSOR_HAL_2_0),true) + # Add sensor HAL 2.0 product packages + PRODUCT_PACKAGES += android.hardware.sensors@2.0-service.multihal +else + # Add sensor HAL 1.0 product packages. + PRODUCT_PACKAGES += \ + android.hardware.sensors@1.0-impl \ + android.hardware.sensors@1.0-service \ + sensors.gs101 +endif +#endif + +# USB HAL +PRODUCT_PACKAGES += \ + android.hardware.usb@1.3-service.gs101 + +OLDER_GADGET := false + +# MIDI feature +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml + +# default usb debug functions +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PROPERTY_OVERRIDES += \ + persist.vendor.usb.usbradio.config=dm +endif + +# Power HAL +PRODUCT_COPY_FILES += \ + device/google/gs101/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json + +PRODUCT_COPY_FILES += \ + device/google/gs101/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json + +PRODUCT_COPY_FILES += \ + device/google/gs101/powerhint_a0.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint_a0.json + +PRODUCT_COPY_FILES += \ + device/google/gs101/powerhint_a1.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint_a1.json +-include hardware/google/pixel/power-libperfmgr/aidl/device.mk + +# PowerStats HAL +PRODUCT_PACKAGES += \ + android.hardware.power.stats@1.0-service.gs101 + +# PowerStats AIDL HAL +PRODUCT_PACKAGES += \ + android.hardware.power.stats-service.pixel + +# dumpstate HAL +PRODUCT_PACKAGES += \ + android.hardware.dumpstate@1.0-service.gs101 + +# AoC support +PRODUCT_PACKAGES += \ + aocd \ + aocutil \ + aoc_audio_cfg \ + vp_util + +# AoC debug support +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PACKAGES += \ + aocdump +endif + +# +# Audio HALs +# + +# Audio Configurations +USE_LEGACY_LOCAL_AUDIO_HAL := false +USE_XML_AUDIO_POLICY_CONF := 1 + +# Enable AAudio MMAP/NOIRQ data path. +PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_policy=2 +PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_exclusive_policy=2 +PRODUCT_PROPERTY_OVERRIDES += aaudio.hw_burst_min_usec=2000 + +# Calliope firmware overwrite +#PRODUCT_COPY_FILES += \ + device/google/gs101/firmware/calliope_dram.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/calliope_dram.bin \ + device/google/gs101/firmware/calliope_sram.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/calliope_sram.bin \ + device/google/gs101/firmware/calliope_dram_2.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/calliope_dram_2.bin \ + device/google/gs101/firmware/calliope_sram_2.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/calliope_sram_2.bin \ + device/google/gs101/firmware/calliope2.dt:$(TARGET_COPY_OUT_VENDOR)/firmware/calliope2.dt \ + +# Cannot reference variables defined in BoardConfig.mk, uncomment this if +# BOARD_USE_OFFLOAD_AUDIO and BOARD_USE_OFFLOAD_EFFECT are true +## AudioEffectHAL library +#PRODUCT_PACKAGES += \ +# libexynospostprocbundle + +# Cannot reference variables defined in BoardConfig.mk, uncomment this if +# BOARD_USE_SOUNDTRIGGER_HAL is true +#PRODUCT_PACKAGES += \ +# sound_trigger.primary.maran9820 + +# A-Box Service Daemon +#PRODUCT_PACKAGES += main_abox + +# Libs +PRODUCT_PACKAGES += \ + com.android.future.usb.accessory + +# for now include gralloc here. should come from hardware/google_devices/exynos5 +ifeq ($(DEVICE_USES_EXYNOS_GRALLOC_VERSION), 4) + PRODUCT_PACKAGES += \ + android.hardware.graphics.mapper@4.0-impl \ + android.hardware.graphics.allocator@4.0-service \ + android.hardware.graphics.allocator@4.0-impl +else + PRODUCT_PACKAGES += \ + android.hardware.graphics.mapper@2.0-impl \ + android.hardware.graphics.allocator@2.0-service \ + android.hardware.graphics.allocator@2.0-impl \ + gralloc.$(TARGET_BOARD_PLATFORM) +endif + +# HIDL memtrack +PRODUCT_PACKAGES += \ + android.hardware.memtrack@1.0-impl \ + android.hardware.memtrack@1.0-service + +PRODUCT_PACKAGES += \ + memtrack.$(TARGET_BOARD_PLATFORM) \ + libion_exynos \ + libion + +PRODUCT_PACKAGES += \ + libhwjpeg + +# Video Editor +PRODUCT_PACKAGES += \ + VideoEditorGoogle + +# WideVine modules +PRODUCT_PACKAGES += \ + android.hardware.drm@1.0-impl \ + android.hardware.drm@1.0-service \ + android.hardware.drm@1.3-service.clearkey \ + android.hardware.drm@1.4-service.widevine \ + liboemcrypto \ + +SOONG_CONFIG_NAMESPACES += lyric +SOONG_CONFIG_lyric += \ + soc \ + feature \ + +SOONG_CONFIG_lyric_soc := gs101 +SOONG_CONFIG_lyric_feature := true + +SOONG_CONFIG_NAMESPACES += google3a_config +SOONG_CONFIG_google3a_config += \ + soc \ + gcam_awb \ + ghawb_truetone \ + +SOONG_CONFIG_google3a_config_soc := gs101 +SOONG_CONFIG_google3a_config_gcam_awb := true +SOONG_CONFIG_google3a_config_ghawb_truetone := true + +SOONG_CONFIG_NAMESPACES += gch +SOONG_CONFIG_gch += \ + feature \ +# Disable Legacy common hal modules for whi +SOONG_CONFIG_gch_feature := use_lyric_hal + +# WiFi +PRODUCT_PACKAGES += \ + android.hardware.wifi@1.0-service \ + wificond \ + libwpa_client \ + PixelWifiOverlayGs101 \ + WifiOverlay \ + +PRODUCT_PACKAGES_DEBUG += \ + sg_write_buffer \ + f2fs_io \ + check_f2fs \ + f2fsstat \ + f2fs.fibmap \ + dump.f2fs + +# Storage health HAL +PRODUCT_PACKAGES += \ + android.hardware.health.storage-service.default + +# storage pixelstats +-include hardware/google/pixel/pixelstats/device.mk + +# Enable project quotas and casefolding for emulated storage without sdcardfs +$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) + +$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk) +# Enforce generic ramdisk allow list +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk) + +# Titan-M +ifeq (,$(filter true, $(BOARD_WITHOUT_DTLS))) +include hardware/google/pixel/dauntless/dauntless.mk +endif + +PRODUCT_PACKAGES_DEBUG += \ + WvInstallKeybox + +# Copy Camera HFD Setfiles +#PRODUCT_COPY_FILES += \ + device/google/gs101/firmware/camera/libhfd/default_configuration.hfd.cfg.json:$(TARGET_COPY_OUT_VENDOR)/firmware/default_configuration.hfd.cfg.json \ + device/google/gs101/firmware/camera/libhfd/pp_cfg.json:$(TARGET_COPY_OUT_VENDOR)/firmware/pp_cfg.json \ + device/google/gs101/firmware/camera/libhfd/tracker_cfg.json:$(TARGET_COPY_OUT_VENDOR)/firmware/tracker_cfg.json \ + device/google/gs101/firmware/camera/libhfd/WithLightFixNoBN.SDNNmodel:$(TARGET_COPY_OUT_VENDOR)/firmware/WithLightFixNoBN.SDNNmodel + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml \ + frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \ + frameworks/native/data/etc/android.hardware.wifi.rtt.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.rtt.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ + frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ + +#PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \ + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \ + frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \ + frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \ + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \ + frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \ + frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \ + frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \ + frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \ + frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \ + frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \ + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.opengles.version=196610 \ + debug.slsi_platform=1 \ + debug.hwc.winupdate=1 + +# HWUI +TARGET_USES_VULKAN = true + +# hw composer HAL +PRODUCT_PACKAGES += \ + displaycolor_service \ + libdisplaycolor \ + hwcomposer.$(TARGET_BOARD_PLATFORM) + +PRODUCT_PROPERTY_OVERRIDES += \ + debug.sf.disable_backpressure=0 \ + debug.sf.enable_gl_backpressure=1 + +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.use_phase_offsets_as_durations=1 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.late.sf.duration=10500000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.late.app.duration=20500000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.early.sf.duration=16000000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.early.app.duration=16500000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.sf.duration=13500000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.app.duration=21000000 + +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=80 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_touch_timer_ms=200 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_display_power_timer_ms=1000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_content_detection_for_refresh_rate=true + +# Must align with HAL types Dataspace +# The data space of wide color gamut composition preference is Dataspace::DISPLAY_P3 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.wcg_composition_dataspace=143261696 + +# Display +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.has_wide_color_display=true +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.has_HDR_display=true +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_color_management=true +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.protected_contents=true +# force to blend in P3 mode +PRODUCT_PROPERTY_OVERRIDES += \ + persist.sys.sf.native_mode=2 \ + persist.sys.sf.color_mode=9 +PRODUCT_COPY_FILES += \ + device/google/gs101/display/display_adaptive_cal0.pb:$(TARGET_COPY_OUT_VENDOR)/etc/display_adaptive_cal0.pb + +PRODUCT_PROPERTY_OVERRIDES += debug.renderengine.backend=skiaglthreaded + +# limit DPP downscale ratio +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.hwc.dpp.downscale=2 + +# Cannot reference variables defined in BoardConfig.mk, uncomment this if +# BOARD_USES_EXYNOS_DSS_FEATURE is true +## set the dss enable status setup +#PRODUCT_PROPERTY_OVERRIDES += \ +# ro.exynos.dss=1 + +# Cannot reference variables defined in BoardConfig.mk, uncomment this if +# BOARD_USES_EXYNOS_AFBC_FEATURE is true +# set the dss enable status setup +PRODUCT_PROPERTY_OVERRIDES += \ + ro.vendor.ddk.set.afbc=1 + +PRODUCT_CHARACTERISTICS := nosdcard + +# WPA SUPPLICANT +PRODUCT_COPY_FILES += \ + device/google/gs101/wifi/p2p_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant.conf \ + device/google/gs101/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf + +HOSTAPD := hostapd +HOSTAPD += hostapd_cli +PRODUCT_PACKAGES += $(HOSTAPD) + +PRODUCT_PACKAGES += wpa_supplicant +PRODUCT_PACKAGES += wpa_supplicant.conf + +WIFI_PRIV_CMD_UPDATE_MBO_CELL_STATUS := enabled + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PACKAGES += wpa_cli +endif + +#################################### +## VIDEO +#################################### + +SOONG_CONFIG_NAMESPACES += bigo +SOONG_CONFIG_bigo += soc +SOONG_CONFIG_bigo_soc := gs101 + +# MFC firmware +PRODUCT_COPY_FILES += \ + device/google/gs101/firmware/mfc_fw_v14.2.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/mfc_fw.bin + +# 1. Codec 2.0 +# exynos service +PRODUCT_SOONG_NAMESPACES += vendor/samsung_slsi/codec2 + +PRODUCT_COPY_FILES += \ + device/google/gs101/media_codecs_performance_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_c2.xml \ + +PRODUCT_PACKAGES += \ + samsung.hardware.media.c2@1.0-service \ + codec2.vendor.base.policy \ + codec2.vendor.ext.policy \ + libExynosC2ComponentStore \ + libExynosC2H264Dec \ + libExynosC2H264Enc \ + libExynosC2HevcDec \ + libExynosC2HevcEnc \ + libExynosC2Mpeg4Dec \ + libExynosC2Mpeg4Enc \ + libExynosC2H263Dec \ + libExynosC2H263Enc \ + libExynosC2Vp8Dec \ + libExynosC2Vp8Enc \ + libExynosC2Vp9Dec \ + libExynosC2Vp9Enc + +PRODUCT_PROPERTY_OVERRIDES += \ + debug.c2.use_dmabufheaps=1 + +# 2. OpenMAX IL +PRODUCT_COPY_FILES += \ + device/google/gs101/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ + device/google/gs101/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml +#################################### + +# Telephony +#PRODUCT_COPY_FILES += \ + frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml + +# CBD (CP booting deamon) +CBD_USE_V2 := true +CBD_PROTOCOL_SIT := true + +# setup dalvik vm configs. +$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) + +PRODUCT_TAGS += dalvik.gc.type-precise + +# Exynos OpenVX framework +PRODUCT_PACKAGES += \ + libexynosvision + +ifeq ($(TARGET_USES_CL_KERNEL),true) +PRODUCT_PACKAGES += \ + libopenvx-opencl +endif + +GPS_CHIPSET := 47765 + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \ + device/google/gs101/gnss/${GPS_CHIPSET}/config/gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml \ + device/google/gs101/gnss/${GPS_CHIPSET}/config/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ + device/google/gs101/gnss/${GPS_CHIPSET}/config/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf \ + device/google/gs101/gnss/${GPS_CHIPSET}/config/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer \ + device/google/gs101/gnss/${GPS_CHIPSET}/firmware/SensorHub.patch:$(TARGET_COPY_OUT_VENDOR)/firmware/SensorHub.patch + +PRODUCT_SOONG_NAMESPACES += \ + device/google/gs101/gnss/$(GPS_CHIPSET) + +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 + +# Trusty (KM, GK, Storage) +$(call inherit-product, system/core/trusty/trusty-storage.mk) +$(call inherit-product, system/core/trusty/trusty-base.mk) + +# Trusty unit test tool +PRODUCT_PACKAGES_DEBUG += trusty-ut-ctrl + +# Trusty ConfirmationUI HAL +PRODUCT_PACKAGES += \ + android.hardware.confirmationui@1.0-service.trusty.vendor + +# Trusty Secure DPU Daemon +PRODUCT_PACKAGES += \ + securedpud.slider + +PRODUCT_PACKAGES += \ + android.hardware.graphics.composer@2.4-impl \ + android.hardware.graphics.composer@2.4-service + +PRODUCT_PACKAGES += \ + android.hardware.renderscript@1.0-impl + +# Storage: for factory reset protection feature +PRODUCT_PROPERTY_OVERRIDES += \ + ro.frp.pst=/dev/block/by-name/frp + +# RenderScript HAL +PRODUCT_PACKAGES += \ + android.hardware.renderscript@1.0-impl + +# Bluetooth HAL +PRODUCT_PACKAGES += \ + android.hardware.bluetooth@1.1-service.bcmbtlinux \ + bt_vendor.conf +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 += \ + persist.bluetooth.bqr.event_mask=262174 \ + persist.bluetooth.bqr.min_interval_ms=500 +else +PRODUCT_PRODUCT_PROPERTIES += \ + persist.bluetooth.bqr.event_mask=30 \ + persist.bluetooth.bqr.min_interval_ms=500 +endif + +#VNDK +PRODUCT_PACKAGES += \ + vndk-libs + +PRODUCT_ENFORCE_RRO_TARGETS := \ + framework-res + +# Dynamic Partitions +PRODUCT_USE_DYNAMIC_PARTITIONS := true + +# Use /product/etc/fstab.postinstall to mount system_other +PRODUCT_PRODUCT_PROPERTIES += \ + ro.postinstall.fstab.prefix=/product + +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall + +# fastbootd +PRODUCT_PACKAGES += \ + android.hardware.fastboot@1.1-impl.pixel \ + fastbootd + +#google iwlan +PRODUCT_PACKAGES += \ + Iwlan + +#Iwlan test app for userdebug/eng builds +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PACKAGES += \ + IwlanTestApp +endif + +#vendor directory packages +ifeq (,$(filter %_64,$(TARGET_PRODUCT))) +PRODUCT_PACKAGES += \ + libGLES_mali32 \ + libgpudataproducer32 \ + libRSDriverArm32 \ + libbccArm32 \ + libmalicore32 \ + libOpenCL32 +endif + +PRODUCT_PACKAGES += \ + libGLES_mali \ + libgpudataproducer \ + libRSDriverArm \ + libbccArm \ + libmalicore \ + libOpenCL \ + whitelist \ + libstagefright_hdcp \ + libskia_opt + +ifneq (,$(realpath $(TOPDIR)vendor/arm/mali/valhall/Android.bp)) +# TODO: fix the prebuilts to properly define and install this target +# rather than simply making a symlink +PRODUCT_PACKAGES += \ + vulkan.gs101 +endif + +ifeq ($(USE_SWIFTSHADER),true) +PRODUCT_PACKAGES += \ + libGLESv1_CM_swiftshader \ + libEGL_swiftshader \ + libGLESv2_swiftshader +endif + +#PRODUCT_PACKAGES += \ + mfc_fw.bin \ + calliope_sram.bin \ + calliope_dram.bin \ + calliope_iva.bin \ + vts.bin + +# This will be called only if IMSService is building with source code for dev branches. +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-ims/device-vendor.mk) + +PRODUCT_PACKAGES += ShannonIms + +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-iwlan/device-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/packetrouter/device-vendor.mk) + +#RCS Test Messaging App +PRODUCT_PACKAGES_DEBUG += \ + TestRcsApp + +PRODUCT_PACKAGES += ShannonRcs + +# Boot Control HAL +PRODUCT_PACKAGES += \ + android.hardware.boot@1.2-impl-gs101 \ + android.hardware.boot@1.2-service-gs101 + +# Exynos RIL and telephony +# Multi SIM(DSDS) +SIM_COUNT := 2 +SUPPORT_MULTI_SIM := true +# Support NR +SUPPORT_NR := true +# Using IRadio 1.6 +USE_RADIO_HAL_1_6 := true + +#$(call inherit-product, vendor/google_devices/telephony/common/device-vendor.mk) +#$(call inherit-product, vendor/google_devices/gs101/proprietary/device-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/common/device-vendor.mk) +ifeq (,$(filter %_64,$(TARGET_PRODUCT))) +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +else +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) +endif +#$(call inherit-product, hardware/google_devices/exynos5/exynos5.mk) +#$(call inherit-product-if-exists, hardware/google_devices/gs101/gs101.mk) +#$(call inherit-product-if-exists, vendor/google_devices/common/exynos-vendor.mk) +#$(call inherit-product-if-exists, hardware/broadcom/wlan/bcmdhd/firmware/bcm4375/device-bcm.mk) +$(call inherit-product-if-exists, vendor/google/sensors/usf/android/usf_efw_product.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) + +PRODUCT_COPY_FILES += \ + device/google/gs101/default-permissions.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/default-permissions/default-permissions.xml \ + device/google/gs101/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml \ + frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \ + +# modem_svc_sit daemon +PRODUCT_PACKAGES += modem_svc_sit + +# modem logging binary/configs +PRODUCT_PACKAGES += modem_logging_control + +PRODUCT_COPY_FILES += \ + device/google/gs101/radio/gnss_blanking.csv:$(TARGET_COPY_OUT_VENDOR)/etc/modem/gnss_blanking.csv + +# ARM NN files +ARM_COMPUTE_CL_ENABLE := 1 + +# Vibrator Diag +PRODUCT_PACKAGES_DEBUG += \ + diag-vibrator \ + diag-vibrator-cs40l25a \ + diag-vibrator-drv2624 \ + $(NULL) + +# NFC +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \ + frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \ + frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hcef.xml \ + frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml \ + frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.uicc.xml \ + frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.ese.xml + +PRODUCT_PACKAGES += \ + NfcNci \ + Tag \ + android.hardware.nfc@1.2-service.st + +PRODUCT_COPY_FILES += \ + device/google/gs101/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_PRODUCT)/etc/libnfc-nci.conf + +# SecureElement +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.ese.xml \ + frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml + +PRODUCT_PACKAGES += \ + android.hardware.health@2.1-impl-gs101 \ + android.hardware.health@2.1-service + +# Audio +# Audio HAL Server & Default Implementations +PRODUCT_PACKAGES += \ + android.hardware.audio@2.0-service \ + android.hardware.audio@6.0-impl \ + android.hardware.audio.effect@6.0-impl \ + android.hardware.bluetooth.audio@2.0-impl \ + android.hardware.soundtrigger@2.3-impl \ + vendor.google.whitechapel.audio.audioext@2.0-impl + +#Audio HAL libraries +PRODUCT_PACKAGES += \ + audio.primary.$(TARGET_BOARD_PLATFORM) \ + audio.platform.aoc \ + sound_trigger.primary.$(TARGET_BOARD_PLATFORM) \ + audio_bt_aoc \ + audio_tunnel_aoc \ + aoc_aud_ext \ + libaoctuningdecoder \ + libaoc_waves \ + liboffloadeffect \ + libdsp_aecns \ + audio_waves_aoc \ + audio_fortemedia_aoc \ + audio_usb_aoc \ + audio_spk_35l41 \ + audio.usb.default \ + audio.a2dp.default \ + audio.bluetooth.default \ + audio.r_submix.default + +#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.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ + +#Audio soong +PRODUCT_SOONG_NAMESPACES += \ + vendor/google/whitechapel/audio/hal \ + vendor/google/whitechapel/audio/interfaces + +SOONG_CONFIG_NAMESPACES += aoc_audio_board +SOONG_CONFIG_aoc_audio_board += \ + platform + +SOONG_CONFIG_aoc_audio_board_platform := $(TARGET_BOARD_PLATFORM) + +# Audio properties +PRODUCT_PROPERTY_OVERRIDES += \ + ro.config.vc_call_vol_steps=7 \ + ro.config.media_vol_steps=25 \ + ro.audio.monitorRotation = true + +# vndservicemanager and vndservice no longer included in API 30+, however needed by vendor code. +# See b/148807371 for reference +PRODUCT_PACKAGES += vndservicemanager +PRODUCT_PACKAGES += vndservice + +# TinyTools, debug tool and cs35l41 speaker calibration tool for Audio +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PACKAGES += \ + tinyplay \ + tinycap \ + tinymix \ + tinypcminfo \ + tinyhostless \ + cplay \ + aoc_hal \ + aoc_tuning_inft \ + crus_sp_cal \ + mahal_test \ + ma_aoc_tuning_test +endif + +PRODUCT_PACKAGES += \ + google.hardware.media.c2@1.0-service \ + libgc2_store \ + libgc2_base \ + libgc2_av1_dec \ + libbo_av1 \ + libgc2_cwl \ + libgc2_utils + +# Start packet router +PRODUCT_PROPERTY_OVERRIDES += vendor.pktrouter=1 + +# Thermal HAL +include hardware/google/pixel/thermal/device.mk +PRODUCT_PROPERTY_OVERRIDES += persist.vendor.enable.thermal.genl=true + +# TPU NN HAL +PRODUCT_PACKAGES += \ + android.hardware.neuralnetworks@1.3-service-darwinn + +# TPU logging service +PRODUCT_PACKAGES += \ + android.hardware.edgetpu.logging@service-edgetpu-logging + +# TPU HAL service +PRODUCT_PACKAGES += \ + vendor.google.edgetpu@1.0-service + +# TPU HAL client library +PRODUCT_PACKAGES += \ + libedgetpu_client.google + +# TPU HAL client library vendor variant +PRODUCT_PACKAGES += \ + libedgetpu_client.google.vendor + +# Connectivity Thermal Power Manager +PRODUCT_PACKAGES += \ + ConnectivityThermalPowerManager + +# A/B support +PRODUCT_PACKAGES += \ + otapreopt_script \ + cppreopts.sh \ + update_engine \ + update_engine_sideload \ + update_verifier + +# tetheroffload HAL +PRODUCT_PACKAGES += \ + vendor.samsung_slsi.hardware.tetheroffload@1.0-service + +# pKVM +ifeq ($(TARGET_PKVM_ENABLED),true) + $(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk) +endif + +# Enable watchdog timeout loop breaker. +PRODUCT_PROPERTY_OVERRIDES += \ + framework_watchdog.fatal_window.second=600 \ + framework_watchdog.fatal_count=3 + +# Enable zygote critical window. +PRODUCT_PROPERTY_OVERRIDES += \ + zygote.critical_window.minute=10 + +# Project +include hardware/google/pixel/common/pixel-common-device.mk diff --git a/display/display_adaptive_cal0.pb b/display/display_adaptive_cal0.pb new file mode 100644 index 00000000..f29b38b5 Binary files /dev/null and b/display/display_adaptive_cal0.pb differ diff --git a/dumpstate/Android.mk b/dumpstate/Android.mk new file mode 100644 index 00000000..983b2509 --- /dev/null +++ b/dumpstate/Android.mk @@ -0,0 +1,46 @@ +# +# Copyright 2016 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.dumpstate@1.0-service.gs101 +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE +LOCAL_INIT_RC := android.hardware.dumpstate@1.0-service.gs101.rc +LOCAL_MODULE_RELATIVE_PATH := hw + +LOCAL_SRC_FILES := \ + DumpstateDevice.cpp \ + service.cpp + +LOCAL_SHARED_LIBRARIES := \ + android.hardware.dumpstate@1.0 \ + libbase \ + libcutils \ + libdumpstateutil \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + liblog \ + libutils + +LOCAL_CFLAGS := -Werror -Wall + +LOCAL_MODULE_TAGS := optional +LOCAL_PROPRIETARY_MODULE := true + +include $(BUILD_EXECUTABLE) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp new file mode 100644 index 00000000..cd5aa6d4 --- /dev/null +++ b/dumpstate/DumpstateDevice.cpp @@ -0,0 +1,892 @@ +/* + * Copyright 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "dumpstate_device" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "DumpstateDevice.h" + +#include "DumpstateUtil.h" + +#define MODEM_LOG_DIRECTORY "/data/vendor/radio/logs/always-on" +#define MODEM_EXTENDED_LOG_DIRECTORY "/data/vendor/radio/extended_logs" +#define RIL_LOG_DIRECTORY "/data/vendor/radio" +#define RIL_LOG_DIRECTORY_PROPERTY "persist.vendor.ril.log.base_dir" +#define RIL_LOG_NUMBER_PROPERTY "persist.vendor.ril.log.num_file" +#define MODEM_LOGGING_PERSIST_PROPERTY "persist.vendor.sys.modem.logging.enable" +#define MODEM_LOGGING_PROPERTY "vendor.sys.modem.logging.enable" +#define MODEM_LOGGING_STATUS_PROPERTY "vendor.sys.modem.logging.status" +#define MODEM_LOGGING_NUMBER_BUGREPORT_PROPERTY "persist.vendor.sys.modem.logging.br_num" +#define GPS_LOG_DIRECTORY "/data/vendor/gps/logs" +#define GPS_LOG_NUMBER_PROPERTY "persist.vendor.gps.aol.log_num" +#define GPS_LOGGING_STATUS_PROPERTY "vendor.gps.aol.enabled" + +#define UFS_BOOTDEVICE "ro.boot.bootdevice" + +using android::os::dumpstate::CommandOptions; +using android::os::dumpstate::DumpFileToFd; +using android::os::dumpstate::PropertiesHelper; +using android::os::dumpstate::RunCommandToFd; + +namespace android { +namespace hardware { +namespace dumpstate { +namespace V1_0 { +namespace implementation { + +#define GPS_LOG_PREFIX "gl-" +#define MODEM_LOG_PREFIX "sbuff_" +#define EXTENDED_LOG_PREFIX "extended_log_" +#define RIL_LOG_PREFIX "rild.log." +#define BUFSIZE 65536 + +typedef std::chrono::time_point timepoint_t; + +void DumpstateDevice::dumpLogs(int fd, std::string srcDir, std::string destDir, int maxFileNum, + const char *logPrefix) { + struct dirent **dirent_list = NULL; + int num_entries = scandir(srcDir.c_str(), + &dirent_list, + 0, + (int (*)(const struct dirent **, const struct dirent **)) alphasort); + if (!dirent_list) { + return; + } else if (num_entries <= 0) { + return; + } + + int copiedFiles = 0; + + for (int i = num_entries - 1; i >= 0; i--) { + ALOGD("Found %s\n", dirent_list[i]->d_name); + + if (0 != strncmp(dirent_list[i]->d_name, logPrefix, strlen(logPrefix))) { + continue; + } + + if ((copiedFiles >= maxFileNum) && (maxFileNum != -1)) { + ALOGD("Skipped %s\n", dirent_list[i]->d_name); + continue; + } + + copiedFiles++; + + CommandOptions options = CommandOptions::WithTimeout(120).Build(); + std::string srcLogFile = srcDir + "/" + dirent_list[i]->d_name; + std::string destLogFile = destDir + "/" + dirent_list[i]->d_name; + + std::string copyCmd = "/vendor/bin/cp " + srcLogFile + " " + destLogFile; + + ALOGD("Copying %s to %s\n", srcLogFile.c_str(), destLogFile.c_str()); + RunCommandToFd(fd, "CP DIAG LOGS", { "/vendor/bin/sh", "-c", copyCmd.c_str() }, options); + } + + while (num_entries--) { + free(dirent_list[num_entries]); + } + + free(dirent_list); +} + +void DumpstateDevice::dumpRilLogs(int fd, std::string destDir) { + std::string rilLogDir = + android::base::GetProperty(RIL_LOG_DIRECTORY_PROPERTY, RIL_LOG_DIRECTORY); + + int maxFileNum = android::base::GetIntProperty(RIL_LOG_NUMBER_PROPERTY, 50); + + const std::string currentLogDir = rilLogDir + "/cur"; + const std::string previousLogDir = rilLogDir + "/prev"; + const std::string currentDestDir = destDir + "/cur"; + const std::string previousDestDir = destDir + "/prev"; + + RunCommandToFd(fd, "MKDIR RIL CUR LOG", {"/vendor/bin/mkdir", "-p", currentDestDir.c_str()}, + CommandOptions::WithTimeout(2).Build()); + RunCommandToFd(fd, "MKDIR RIL PREV LOG", {"/vendor/bin/mkdir", "-p", previousDestDir.c_str()}, + CommandOptions::WithTimeout(2).Build()); + + dumpLogs(fd, currentLogDir, currentDestDir, maxFileNum, RIL_LOG_PREFIX); + dumpLogs(fd, previousLogDir, previousDestDir, maxFileNum, RIL_LOG_PREFIX); +} + +void copyFile(std::string srcFile, std::string destFile) { + uint8_t buffer[BUFSIZE]; + ssize_t size; + + int fdSrc = open(srcFile.c_str(), O_RDONLY); + if (fdSrc < 0) { + ALOGD("Failed to open source file %s\n", srcFile.c_str()); + return; + } + + int fdDest = open(destFile.c_str(), O_WRONLY | O_CREAT, 0666); + if (fdDest < 0) { + ALOGD("Failed to open destination file %s\n", destFile.c_str()); + close(fdSrc); + return; + } + + ALOGD("Copying %s to %s\n", srcFile.c_str(), destFile.c_str()); + while ((size = TEMP_FAILURE_RETRY(read(fdSrc, buffer, BUFSIZE))) > 0) { + TEMP_FAILURE_RETRY(write(fdDest, buffer, size)); + } + + close(fdDest); + close(fdSrc); +} + +void dumpNetmgrLogs(std::string destDir) { + const std::vector netmgrLogs + { + "/data/vendor/radio/metrics_data", + "/data/vendor/radio/omadm_logs.txt", + "/data/vendor/radio/power_anomaly_data.txt", + }; + for (const auto& logFile : netmgrLogs) { + copyFile(logFile, destDir + "/" + basename(logFile.c_str())); + } +} + +/** Dumps last synced NV data into bugreports */ +void dumpModemEFS(std::string destDir) { + const std::string EFS_DIRECTORY = "/mnt/vendor/efs/"; + const std::vector nv_files + { + EFS_DIRECTORY+"nv_normal.bin", + EFS_DIRECTORY+"nv_protected.bin", + }; + for (const auto& logFile : nv_files) { + copyFile(logFile, destDir + "/" + basename(logFile.c_str())); + } +} + +void DumpstateDevice::dumpGpsLogs(int fd, std::string destDir) { + const std::string gpsLogDir = GPS_LOG_DIRECTORY; + const std::string gpsTmpLogDir = gpsLogDir + "/.tmp"; + int maxFileNum = android::base::GetIntProperty(GPS_LOG_NUMBER_PROPERTY, 30); + + dumpLogs(fd, gpsTmpLogDir, destDir, 1, GPS_LOG_PREFIX); + dumpLogs(fd, gpsLogDir, destDir, maxFileNum, GPS_LOG_PREFIX); +} + +timepoint_t startSection(int fd, const std::string §ionName) { + android::base::WriteStringToFd( + "\n" + "------ Section start: " + sectionName + " ------\n" + "\n", fd); + return std::chrono::steady_clock::now(); +} + +void endSection(int fd, const std::string §ionName, timepoint_t startTime) { + auto endTime = std::chrono::steady_clock::now(); + auto elapsedMsec = std::chrono::duration_cast + (endTime - startTime).count(); + + android::base::WriteStringToFd( + "\n" + "------ Section end: " + sectionName + " ------\n" + "Elapsed msec: " + std::to_string(elapsedMsec) + "\n" + "\n", fd); +} + +// If you are adding a single RunCommandToFd() or DumpFileToFd() call, please +// add it to dumpMiscSection(). But if you are adding multiple items that are +// related to each other - for instance, for a Foo peripheral - please add them +// to a new dump function and include it in this table so it can be accessed from the +// command line, e.g.: +// lshal debug android.hardware.dumpstate@1.0::IDumpstateDevice/default foo +// +// However, if your addition generates attachments and/or binary data for the +// bugreport (i.e. if it requires two file descriptors to execute), it must not be +// added to this table and should instead be added to dumpstateBoard() below. + +DumpstateDevice::DumpstateDevice() + : mTextSections{ + { "wlan", [this](int fd) { dumpWlanSection(fd); } }, + { "soc", [this](int fd) { dumpSocSection(fd); } }, + { "storage", [this](int fd) { dumpStorageSection(fd); } }, + { "memory", [this](int fd) { dumpMemorySection(fd); } }, + { "Devfreq", [this](int fd) { dumpDevfreqSection(fd); } }, + { "cpu", [this](int fd) { dumpCpuSection(fd); } }, + { "power", [this](int fd) { dumpPowerSection(fd); } }, + { "thermal", [this](int fd) { dumpThermalSection(fd); } }, + { "touch", [this](int fd) { dumpTouchSection(fd); } }, + { "display", [this](int fd) { dumpDisplaySection(fd); } }, + { "sensors-usf", [this](int fd) { dumpSensorsUSFSection(fd); } }, + { "ramdump", [this](int fd) { dumpRamdumpSection(fd); } }, + { "misc", [this](int fd) { dumpMiscSection(fd); } }, + } { +} + +// Dump data requested by an argument to the "debug" HAL interface, or help info +// if the specified section is not supported. +void DumpstateDevice::dumpTextSection(int fd, const std::string §ionName) { + bool dumpAll = (sectionName == kAllSections); + + for (const auto §ion : mTextSections) { + if (dumpAll || sectionName == section.first) { + auto startTime = startSection(fd, section.first); + section.second(fd); + endSection(fd, section.first, startTime); + + if (!dumpAll) { + return; + } + } + } + + if (dumpAll) { + return; + } + + // An unsupported section was requested on the command line + android::base::WriteStringToFd("Unrecognized text section: " + sectionName + "\n", fd); + android::base::WriteStringToFd("Try \"" + kAllSections + "\" or one of the following:", fd); + for (const auto §ion : mTextSections) { + android::base::WriteStringToFd(" " + section.first, fd); + } + android::base::WriteStringToFd("\nNote: sections with attachments (e.g. modem) are" + "not avalable from the command line.\n", fd); +} + +// Dump items related to wlan +void DumpstateDevice::dumpWlanSection(int fd) { + RunCommandToFd(fd, "WLAN Debug Dump", {"/vendor/bin/sh", "-c", + "cat /sys/wifi/dump_start"}); +} + +// Dump items related to power and battery +void DumpstateDevice::dumpPowerSection(int fd) { + struct stat buffer; + + RunCommandToFd(fd, "Power Stats Times", {"/vendor/bin/sh", "-c", + "echo -n \"Boot: \" && /vendor/bin/uptime -s && " + "echo -n \"Now: \" && date"}); + + RunCommandToFd(fd, "ACPM stats", {"/vendor/bin/sh", "-c", + "for f in /sys/devices/platform/1742048c.acpm_stats/*_stats ; do " + "echo \"\\n\\n$f\" ; cat $f ; " + "done"}); + + DumpFileToFd(fd, "CPU PM stats", "/sys/devices/system/cpu/cpupm/cpupm/time_in_state"); + + DumpFileToFd(fd, "GENPD summary", "/d/pm_genpd/pm_genpd_summary"); + + DumpFileToFd(fd, "Power supply property battery", "/sys/class/power_supply/battery/uevent"); + DumpFileToFd(fd, "Power supply property dc", "/sys/class/power_supply/dc/uevent"); + DumpFileToFd(fd, "Power supply property gcpm", "/sys/class/power_supply/gcpm/uevent"); + DumpFileToFd(fd, "Power supply property gcpm_pps", "/sys/class/power_supply/gcpm_pps/uevent"); + DumpFileToFd(fd, "Power supply property main-charger", "/sys/class/power_supply/main-charger/uevent"); + DumpFileToFd(fd, "Power supply property maxfg", "/sys/class/power_supply/maxfg/uevent"); + DumpFileToFd(fd, "Power supply property pca9486-mains", "/sys/class/power_supply/pca9468-mains/uevent"); + DumpFileToFd(fd, "Power supply property tcpm", "/sys/class/power_supply/tcpm-source-psy-5-0025/uevent"); + DumpFileToFd(fd, "Power supply property usb", "/sys/class/power_supply/usb/uevent"); + DumpFileToFd(fd, "Power supply property wireless", "/sys/class/power_supply/wireless/uevent"); + + if (!stat("/sys/kernel/debug/tcpm", &buffer)) { + RunCommandToFd(fd, "TCPM logs", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/tcpm/*"}); + } else { + RunCommandToFd(fd, "TCPM logs", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/usb/tcpm*"}); + } + + DumpFileToFd(fd, "PD Engine", "/dev/logbuffer_usbpd"); + DumpFileToFd(fd, "PPS-google_cpm", "/dev/logbuffer_google,cpm"); + RunCommandToFd(fd, "PPS-dc", {"/vendor/bin/sh", "-c", "cat /dev/logbuffer_*-0057"}); + + DumpFileToFd(fd, "BMS", "/dev/logbuffer_ssoc"); + DumpFileToFd(fd, "TTF", "/dev/logbuffer_ttf"); + DumpFileToFd(fd, "TTF details", "/sys/class/power_supply/battery/ttf_details"); + DumpFileToFd(fd, "TTF stats", "/sys/class/power_supply/battery/ttf_stats"); + DumpFileToFd(fd, "batt_ce", "/dev/logbuffer_batt_ce"); + DumpFileToFd(fd, "maxq", "/dev/logbuffer_maxq"); + + RunCommandToFd(fd, "DC_registers dump", {"/vendor/bin/sh", "-c", "cat /d/regmap/*-0057-pca9468-mains/registers"}); + + DumpFileToFd(fd, "m5_state", "/sys/class/power_supply/maxfg/m5_model_state"); + RunCommandToFd(fd, "fg_model", {"/vendor/bin/sh", "-c", + "for f in /d/maxfg* ; do " + "regs=`cat $f/fg_model`; echo $f: ;" + "echo \"$regs\"; done"}); + + RunCommandToFd(fd, "fg_alo_ver", {"/vendor/bin/sh", "-c", + "for f in /d/maxfg* ; do " + "regs=`cat $f/algo_ver`; echo $f: ;" + "echo \"$regs\"; done"}); + + RunCommandToFd(fd, "fg_model_ok", {"/vendor/bin/sh", "-c", + "for f in /d/maxfg* ; do " + "regs=`cat $f/model_ok`; echo $f: ;" + "echo \"$regs\"; done"}); + + + /* FG Registers */ + RunCommandToFd(fd, "fg registers", {"/vendor/bin/sh", "-c", + "for f in /d/regmap/*-0036 ; do " + "regs=`cat $f/registers`; echo $f: ;" + "echo \"$regs\"; done"}); + + /* Nvmem State */ + RunCommandToFd(fd, "nvmem dump", {"/vendor/bin/sh", "-c", "xxd /sys/bus/nvmem/devices/4-00500/nvmem"}); + + DumpFileToFd(fd, "Charger Stats", "/sys/class/power_supply/battery/charge_details"); + RunCommandToFd(fd, "Google Charger", {"/vendor/bin/sh", "-c", "cd /sys/kernel/debug/google_charger/; " + "for f in `ls pps_*` ; do echo \"$f: `cat $f`\" ; done"}); + RunCommandToFd(fd, "Google Battery", {"/vendor/bin/sh", "-c", "cd /sys/kernel/debug/google_battery/; " + "for f in `ls ssoc_*` ; do echo \"$f: `cat $f`\" ; done"}); + + DumpFileToFd(fd, "WLC logs", "/dev/logbuffer_wireless"); + DumpFileToFd(fd, "WLC VER", "/sys/class/power_supply/wireless/device/version"); + DumpFileToFd(fd, "WLC STATUS", "/sys/class/power_supply/wireless/device/status"); + DumpFileToFd(fd, "RTX", "/dev/logbuffer_rtx"); + + RunCommandToFd(fd, "gvotables", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/gvotables/*/status"}); +} + +// Dump items related to thermal +void DumpstateDevice::dumpThermalSection(int fd) { + RunCommandToFd(fd, "Temperatures", {"/vendor/bin/sh", "-c", + "for f in /sys/class/thermal/thermal* ; do " + "type=`cat $f/type` ; temp=`cat $f/temp` ; echo \"$type: $temp\" ; " + "done"}); + RunCommandToFd(fd, "Cooling Device Current State", {"/vendor/bin/sh", "-c", + "for f in /sys/class/thermal/cooling* ; do " + "type=`cat $f/type` ; temp=`cat $f/cur_state` ; echo \"$type: $temp\" ; " + "done"}); +} + +// Dump items related to touch +void DumpstateDevice::dumpTouchSection(int fd) { + const char c2_spi_path[] = "/sys/class/spi_master/spi11/spi11.0"; + const char r3_spi_path[] = "/sys/devices/virtual/sec/tsp"; + char cmd[256]; + + snprintf(cmd, sizeof(cmd), "%s/appid", c2_spi_path); + if (!access(cmd, R_OK)) { + // Touch firmware version + DumpFileToFd(fd, "STM touch firmware version", cmd); + + // Touch controller status + snprintf(cmd, sizeof(cmd), "%s/status", c2_spi_path); + DumpFileToFd(fd, "STM touch status", cmd); + + // Mutual raw data + snprintf(cmd, sizeof(cmd), + "echo 13 00 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", + c2_spi_path, c2_spi_path); + RunCommandToFd(fd, "Mutual Raw", {"/vendor/bin/sh", "-c", cmd}); + + // Mutual strength data + snprintf(cmd, sizeof(cmd), + "echo 17 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", + c2_spi_path, c2_spi_path); + RunCommandToFd(fd, "Mutual Strength", {"/vendor/bin/sh", "-c", cmd}); + + // Self raw data + snprintf(cmd, sizeof(cmd), + "echo 15 00 > %s/stm_fts_cmd && cat %s/stm_fts_cmd", + c2_spi_path, c2_spi_path); + RunCommandToFd(fd, "Self Raw", {"/vendor/bin/sh", "-c", cmd}); + } + + if (!access("/proc/fts/driver_test", R_OK)) { + RunCommandToFd(fd, "Mutual Raw Data", + {"/vendor/bin/sh", "-c", + "echo 23 00 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Mutual Baseline Data", + {"/vendor/bin/sh", "-c", + "echo 23 03 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Mutual Strength Data", + {"/vendor/bin/sh", "-c", + "echo 23 02 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Self Raw Data", + {"/vendor/bin/sh", "-c", + "echo 24 00 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Self Baseline Data", + {"/vendor/bin/sh", "-c", + "echo 24 03 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Self Strength Data", + {"/vendor/bin/sh", "-c", + "echo 24 02 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Mutual Compensation", + {"/vendor/bin/sh", "-c", + "echo 32 10 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Self Compensation", + {"/vendor/bin/sh", "-c", + "echo 33 12 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + RunCommandToFd(fd, "Golden Mutual Raw Data", + {"/vendor/bin/sh", "-c", + "echo 34 > /proc/fts/driver_test && " + "cat /proc/fts/driver_test"}); + } + if (!access(r3_spi_path, R_OK)) { + // Enable: force touch active + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "force_touch_active,1", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); + + // Firmware info + snprintf(cmd, sizeof(cmd), "%s/fw_version", r3_spi_path); + DumpFileToFd(fd, "LSI firmware version", cmd); + + // Touch status + snprintf(cmd, sizeof(cmd), "%s/status", r3_spi_path); + DumpFileToFd(fd, "LSI touch status", cmd); + + // Calibration info + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "get_mis_cal_info", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Calibration info", {"/vendor/bin/sh", "-c", cmd}); + + // Mutual strength + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_delta_read_all", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Mutual Strength", {"/vendor/bin/sh", "-c", cmd}); + + // Self strength + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_self_delta_read_all", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Self Strength", {"/vendor/bin/sh", "-c", cmd}); + + // Raw cap + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawcap_read_all", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Mutual Raw Cap", {"/vendor/bin/sh", "-c", cmd}); + + // Self raw cap + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_self_rawcap_read_all", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Self Raw Cap", {"/vendor/bin/sh", "-c", cmd}); + + // TYPE_AMBIENT_DATA + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawdata_read_type,3", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "TYPE_AMBIENT_DATA", {"/vendor/bin/sh", "-c", cmd}); + + // TYPE_DECODED_DATA + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawdata_read_type,5", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "TYPE_DECODED_DATA", {"/vendor/bin/sh", "-c", cmd}); + + // TYPE_NOI_P2P_MIN + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawdata_read_type,30", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "TYPE_NOI_P2P_MIN", {"/vendor/bin/sh", "-c", cmd}); + + // TYPE_NOI_P2P_MAX + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "run_rawdata_read_type,31", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "TYPE_NOI_P2P_MAX", {"/vendor/bin/sh", "-c", cmd}); + + // Disable: force touch active + snprintf(cmd, sizeof(cmd), + "echo %s > %s/cmd && cat %s/cmd_result", + "force_touch_active,0", + r3_spi_path, r3_spi_path); + RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); + } +} + +// Dump items related to SoC +void DumpstateDevice::dumpSocSection(int fd) { + DumpFileToFd(fd, "AP HW TUNE", "/sys/devices/system/chip-id/ap_hw_tune_str"); + DumpFileToFd(fd, "EVT VERSION", "/sys/devices/system/chip-id/evt_ver"); + DumpFileToFd(fd, "LOT ID", "/sys/devices/system/chip-id/lot_id"); + DumpFileToFd(fd, "PRODUCT ID", "/sys/devices/system/chip-id/product_id"); + DumpFileToFd(fd, "REVISION", "/sys/devices/system/chip-id/revision"); + DumpFileToFd(fd, "RAW STR", "/sys/devices/system/chip-id/raw_str"); +} + +// Dump items related to CPUs +void DumpstateDevice::dumpCpuSection(int fd) { + DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present"); + DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online"); + RunCommandToFd(fd, "CPU time-in-state", {"/vendor/bin/sh", "-c", + "for cpu in /sys/devices/system/cpu/cpu*; do " + "f=$cpu/cpufreq/stats/time_in_state; " + "if [ ! -f $f ]; then continue; fi; " + "echo $f:; cat $f; " + "done"}); + RunCommandToFd(fd, "CPU cpuidle", {"/vendor/bin/sh", "-c", + "for cpu in /sys/devices/system/cpu/cpu*; do " + "for d in $cpu/cpuidle/state*; do " + "if [ ! -d $d ]; then continue; fi; " + "echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; " + "done; " + "done"}); + DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts"); +} + +// Dump items related to Devfreq & BTS +void DumpstateDevice::dumpDevfreqSection(int fd) { + DumpFileToFd(fd, "MIF DVFS", + "/sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/time_in_state"); + DumpFileToFd(fd, "INT DVFS", + "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/time_in_state"); + DumpFileToFd(fd, "INTCAM DVFS", + "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/time_in_state"); + DumpFileToFd(fd, "DISP DVFS", + "/sys/devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp/time_in_state"); + DumpFileToFd(fd, "CAM DVFS", + "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam/time_in_state"); + DumpFileToFd(fd, "TNR DVFS", + "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr/time_in_state"); + DumpFileToFd(fd, "MFC DVFS", + "/sys/devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc/time_in_state"); + DumpFileToFd(fd, "BO DVFS", + "/sys/devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo/time_in_state"); + DumpFileToFd(fd, "BTS stats", "/sys/devices/platform/exynos-bts/bts_stats"); +} + +// Dump items related to memory +void DumpstateDevice::dumpMemorySection(int fd) { + RunCommandToFd(fd, "ION HEAPS", {"/vendor/bin/sh", "-c", + "for d in $(ls -d /d/ion/*); do " + "if [ -f $d ]; then " + "echo --- $d; cat $d; " + "else " + "for f in $(ls $d); do " + "echo --- $d/$f; cat $d/$f; " + "done; " + "fi; " + "done"}); + DumpFileToFd(fd, "dmabuf info", "/d/dma_buf/bufinfo"); +} + +static void DumpF2FS(int fd) { + DumpFileToFd(fd, "F2FS", "/sys/kernel/debug/f2fs/status"); + RunCommandToFd(fd, "F2FS - fragmentation", {"/vendor/bin/sh", "-c", + "for d in $(ls /proc/fs/f2fs/); do " + "echo $d: /dev/block/mapper/`ls -l /dev/block/mapper | grep $d | awk '{print $8,$9,$10}'`; " + "cat /proc/fs/f2fs/$d/segment_info; done"}); + RunCommandToFd(fd, "F2FS - fsck time (ms)", {"/vendor/bin/sh", "-c", "getprop ro.boottime.init.fsck.data"}); + RunCommandToFd(fd, "F2FS - checkpoint=disable time (ms)", {"/vendor/bin/sh", "-c", "getprop ro.boottime.init.mount.data"}); +} + +static void DumpUFS(int fd) { + DumpFileToFd(fd, "UFS model", "/sys/block/sda/device/model"); + DumpFileToFd(fd, "UFS rev", "/sys/block/sda/device/rev"); + DumpFileToFd(fd, "UFS size", "/sys/block/sda/size"); + + DumpFileToFd(fd, "UFS Slow IO Read", "/dev/sys/block/bootdevice/slowio_read_cnt"); + DumpFileToFd(fd, "UFS Slow IO Write", "/dev/sys/block/bootdevice/slowio_write_cnt"); + DumpFileToFd(fd, "UFS Slow IO Unmap", "/dev/sys/block/bootdevice/slowio_unmap_cnt"); + DumpFileToFd(fd, "UFS Slow IO Sync", "/dev/sys/block/bootdevice/slowio_sync_cnt"); + + RunCommandToFd(fd, "UFS err_stats", {"/vendor/bin/sh", "-c", + "path=\"/dev/sys/block/bootdevice/err_stats\"; " + "for node in `ls $path/* | grep -v reset_err_status`; do " + "printf \"%s:%d\\n\" $(basename $node) $(cat $node); done;"}); + + + RunCommandToFd(fd, "UFS io_stats", {"/vendor/bin/sh", "-c", + "path=\"/dev/sys/block/bootdevice/io_stats\"; " + "printf \"\\t\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "ReadCnt ReadBytes WriteCnt WriteBytes RWCnt RWBytes; " + "str=$(cat $path/*_start); arr=($str); " + "printf \"Started: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; " + "str=$(cat $path/*_complete); arr=($str); " + "printf \"Completed: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; " + "str=$(cat $path/*_maxdiff); arr=($str); " + "printf \"MaxDiff: \\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\\n\" " + "${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}; "}); + + RunCommandToFd(fd, "UFS req_stats", {"/vendor/bin/sh", "-c", + "path=\"/dev/sys/block/bootdevice/req_stats\"; " + "printf \"\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "All Write Read Security Flush Discard; " + "str=$(cat $path/*_min); arr=($str); " + "printf \"Min:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " + "str=$(cat $path/*_max); arr=($str); " + "printf \"Max:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " + "str=$(cat $path/*_avg); arr=($str); " + "printf \"Avg.:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" " + "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}; " + "str=$(cat $path/*_sum); arr=($str); " + "printf \"Count:\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\\n\" " + "${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]};"}); + + std::string ufs_health = "for f in $(find /dev/sys/block/bootdevice/health_descriptor -type f); do if [[ -r $f && -f $f ]]; then echo --- $f; cat $f; echo ''; fi; done"; + RunCommandToFd(fd, "UFS health", {"/vendor/bin/sh", "-c", ufs_health.c_str()}); +} + +// Dump items related to storage +void DumpstateDevice::dumpStorageSection(int fd) { + DumpF2FS(fd); + DumpUFS(fd); +} + +// Dump items related to display +void DumpstateDevice::dumpDisplaySection(int fd) { + DumpFileToFd(fd, "CRTC-0 underrun count", "/sys/kernel/debug/dri/0/crtc-0/underrun_cnt"); + DumpFileToFd(fd, "CRTC-0 crc count", "/sys/kernel/debug/dri/0/crtc-0/crc_cnt"); + DumpFileToFd(fd, "CRTC-0 ecc count", "/sys/kernel/debug/dri/0/crtc-0/ecc_cnt"); + DumpFileToFd(fd, "CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event"); + DumpFileToFd(fd, "CRTC-1 underrun count", "/sys/kernel/debug/dri/0/crtc-1/underrun_cnt"); + DumpFileToFd(fd, "CRTC-1 crc count", "/sys/kernel/debug/dri/0/crtc-1/crc_cnt"); + DumpFileToFd(fd, "CRTC-1 ecc count", "/sys/kernel/debug/dri/0/crtc-1/ecc_cnt"); + DumpFileToFd(fd, "CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event"); + RunCommandToFd(fd, "libdisplaycolor", {"/vendor/bin/dumpsys", "displaycolor", "-v"}, + CommandOptions::WithTimeout(2).Build()); +} + +// Dump items related to sensors usf. +void DumpstateDevice::dumpSensorsUSFSection(int fd) { + CommandOptions options = CommandOptions::WithTimeout(2).Build(); + RunCommandToFd(fd, "USF statistics", + {"/vendor/bin/sh", "-c", "usf_stats get --all"}, + options); +} + +struct abl_log_header { + uint64_t i; + uint64_t size; + char buf[]; +} __attribute__((packed)); + +// Dump items related to ramdump. +void DumpstateDevice::dumpRamdumpSection(int fd) { + std::string abl_log; + if (android::base::ReadFileToString("/mnt/vendor/ramdump/abl.log", &abl_log)) { + const struct abl_log_header *header = (const struct abl_log_header*) abl_log.c_str(); + android::base::WriteStringToFd(android::base::StringPrintf( + "------ Ramdump misc file: abl.log (i:0x%" PRIx64 " size:0x%" PRIx64 ") ------\n%s\n", + header->i, header->size, std::string(header->buf, header->i).c_str()), fd); + } else { + android::base::WriteStringToFd("*** Ramdump misc file: abl.log: File not found\n", fd); + } + RunCommandToFd(fd, "Ramdump misc file: acpm.lst", + {"/vendor/bin/base64", "/mnt/vendor/ramdump/acpm.lst"}, + CommandOptions::WithTimeout(2).Build()); +} + +// Dump items that don't fit well into any other section +void DumpstateDevice::dumpMiscSection(int fd) { + RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); +} + +void DumpstateDevice::dumpModem(int fd, int fdModem) +{ + std::string modemLogDir = MODEM_LOG_DIRECTORY; + std::string extendedLogDir = MODEM_EXTENDED_LOG_DIRECTORY; + static const std::string sectionName = "modem"; + auto startTime = startSection(fd, sectionName); + + const std::string modemLogCombined = modemLogDir + "/modem_log_all.tar"; + const std::string modemLogAllDir = modemLogDir + "/modem_log"; + + DumpFileToFd(fd, "Modem Stat", "/data/vendor/modem_stat/debug.txt"); + RunCommandToFd(fd, "Modem SSR history", {"/vendor/bin/sh", "-c", + "for f in $(ls /data/vendor/ssrdump/crashinfo_modem*); do " + "echo $f ; cat $f ; done"}, + CommandOptions::WithTimeout(2).Build()); + RunCommandToFd(fd, "RFSD error log", {"/vendor/bin/sh", "-c", + "for f in $(ls /data/vendor/log/rfsd/rfslog_*); do " + "echo $f ; cat $f ; done"}, + CommandOptions::WithTimeout(2).Build()); + RunCommandToFd(fd, "MKDIR MODEM LOG", {"/vendor/bin/mkdir", "-p", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); + + if (!PropertiesHelper::IsUserBuild()) { + bool modemLogEnabled = android::base::GetBoolProperty(MODEM_LOGGING_PERSIST_PROPERTY, false); + bool gpsLogEnabled = android::base::GetBoolProperty(GPS_LOGGING_STATUS_PROPERTY, false); + int maxFileNum = android::base::GetIntProperty(MODEM_LOGGING_NUMBER_BUGREPORT_PROPERTY, 100); + + if (modemLogEnabled) { + bool modemLogStarted = android::base::GetBoolProperty(MODEM_LOGGING_STATUS_PROPERTY, false); + + if (modemLogStarted) { + android::base::SetProperty(MODEM_LOGGING_PROPERTY, "false"); + ALOGD("Stopping modem logging...\n"); + } else { + ALOGD("modem logging is not running\n"); + } + + for (int i = 0; i < 30; i++) { + if (!android::base::GetBoolProperty(MODEM_LOGGING_STATUS_PROPERTY, false)) { + ALOGD("modem logging stopped\n"); + sleep(1); + break; + } + sleep(1); + } + + dumpLogs(fd, modemLogDir, modemLogAllDir, maxFileNum, MODEM_LOG_PREFIX); + + if (modemLogStarted) { + ALOGD("Restarting modem logging...\n"); + android::base::SetProperty(MODEM_LOGGING_PROPERTY, "true"); + } + } + + if (gpsLogEnabled) { + dumpGpsLogs(fd, modemLogAllDir); + } else { + ALOGD("gps logging is not running\n"); + } + + dumpLogs(fd, extendedLogDir, modemLogAllDir, maxFileNum, EXTENDED_LOG_PREFIX); + dumpRilLogs(fd, modemLogAllDir); + dumpNetmgrLogs(modemLogAllDir); + dumpModemEFS(modemLogAllDir); + } + + RunCommandToFd(fd, "TAR LOG", {"/vendor/bin/tar", "cvf", modemLogCombined.c_str(), "-C", modemLogAllDir.c_str(), "."}, CommandOptions::WithTimeout(120).Build()); + RunCommandToFd(fd, "CHG PERM", {"/vendor/bin/chmod", "a+w", modemLogCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); + + std::vector buffer(65536); + android::base::unique_fd fdLog(TEMP_FAILURE_RETRY(open(modemLogCombined.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK))); + + if (fdLog >= 0) { + while (1) { + ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fdLog, buffer.data(), buffer.size())); + + if (bytes_read == 0) { + break; + } else if (bytes_read < 0) { + ALOGD("read(%s): %s\n", modemLogCombined.c_str(), strerror(errno)); + break; + } + + ssize_t result = TEMP_FAILURE_RETRY(write(fdModem, buffer.data(), bytes_read)); + + if (result != bytes_read) { + ALOGD("Failed to write %ld bytes, actually written: %ld", bytes_read, result); + break; + } + } + } + + RunCommandToFd(fd, "RM MODEM DIR", { "/vendor/bin/rm", "-r", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); + RunCommandToFd(fd, "RM LOG", { "/vendor/bin/rm", modemLogCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); + + endSection(fd, sectionName, startTime); +} + +// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow. +Return DumpstateDevice::dumpstateBoard(const hidl_handle &handle) { + if (handle == nullptr || handle->numFds < 1) { + ALOGE("no FDs\n"); + return Void(); + } + + int fd = handle->data[0]; + if (fd < 0) { + ALOGE("invalid FD: %d\n", handle->data[0]); + return Void(); + } + + dumpTextSection(fd, kAllSections); + + if (handle->numFds < 2) { + ALOGE("no FD for modem\n"); + } else { + int fdModem = handle->data[1]; + dumpModem(fd, fdModem); + } + + // Keep this at the end as very long on not for humans + + static const char* kBcmdhd43752Path = + "/sys/module/bcmdhd43752/parameters/info_string"; + static const char* kBcmdhd4389Path = + "/sys/module/bcmdhd4389/parameters/info_string"; + + std::string chip_info; + if (android::base::ReadFileToString(kBcmdhd43752Path, &chip_info) && + (chip_info.find("Chip: aae8") != std::string::npos)) { + RunCommandToFd(fd, "WLAN FW Log Symbol Table", + {"/vendor/bin/base64", + "/vendor/etc/wifi/logstrs_43752.bin"}); + } else if (android::base::ReadFileToString(kBcmdhd4389Path, &chip_info) && + (chip_info.find("Chip: 4389") != std::string::npos)) { + RunCommandToFd(fd, "WLAN FW Log Symbol Table", + {"/vendor/bin/base64", + "/vendor/firmware/logstrs.bin"}); + } + + return Void(); +} + +// Since HALs that support the debug() interface are automatically invoked during +// bugreport generation and we don't want to generate a second copy of the same +// data that will go into dumpstate_board.txt, this function will only do +// something if it is called with an option, e.g. +// lshal debug android.hardware.dumpstate@1.0::IDumpstateDevice/default all +// +// Also, note that sections which generate attachments and/or binary data when +// included in a bugreport are not available through the debug() interface. +Return DumpstateDevice::debug(const hidl_handle &handle, const hidl_vec &args) { + // Exit when dump is completed since this is a lazy HAL. + addPostCommandTask([]() { + exit(0); + }); + + if (handle == nullptr || handle->numFds < 1 || args.size() != 1) { + return Void(); + } + + int fd = handle->data[0]; + dumpTextSection(fd, static_cast(args[0])); + + fsync(fd); + return Void(); +} + + +} // namespace implementation +} // namespace V1_0 +} // namespace dumpstate +} // namespace hardware +} // namespace android diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h new file mode 100644 index 00000000..331b2b65 --- /dev/null +++ b/dumpstate/DumpstateDevice.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H +#define ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H + +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace dumpstate { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::dumpstate::V1_0::IDumpstateDevice; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_handle; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +struct DumpstateDevice : public IDumpstateDevice { + public: + DumpstateDevice(); + + // Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow. + Return dumpstateBoard(const hidl_handle& h) override; + + // Methods from ::android::hidl::base::V1_0::IBase follow. + Return debug(const hidl_handle &fd, const hidl_vec &args) override; + + private: + const std::string kAllSections = "all"; + + std::vector>> mTextSections; + + void 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 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 dumpRamdumpSection(int fd); + void dumpMiscSection(int fd); + + // Hybrid and binary sections that require an additional file descriptor + void dumpModem(int fd, int fdModem); + void dumpRilLogs(int fd, std::string destDir); + void dumpGpsLogs(int fd, std::string destDir); +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace dumpstate +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H diff --git a/dumpstate/android.hardware.dumpstate@1.0-service.gs101.rc b/dumpstate/android.hardware.dumpstate@1.0-service.gs101.rc new file mode 100644 index 00000000..6fdd9380 --- /dev/null +++ b/dumpstate/android.hardware.dumpstate@1.0-service.gs101.rc @@ -0,0 +1,5 @@ +service vendor.dumpstate-1-0 /vendor/bin/hw/android.hardware.dumpstate@1.0-service.gs101 + class hal + user system + group system + interface android.hardware.dumpstate@1.0::IDumpstateDevice default diff --git a/dumpstate/service.cpp b/dumpstate/service.cpp new file mode 100644 index 00000000..e06d4245 --- /dev/null +++ b/dumpstate/service.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define LOG_TAG "android.hardware.dumpstate@1.0-service.gs101" + +#include +#include + +#include "DumpstateDevice.h" + +using ::android::hardware::configureRpcThreadpool; +using ::android::hardware::dumpstate::V1_0::IDumpstateDevice; +using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice; +using ::android::hardware::joinRpcThreadpool; +using ::android::sp; + + +int main(int /* argc */, char* /* argv */ []) { + sp dumpstate = new DumpstateDevice; + configureRpcThreadpool(1, true); + + android::status_t status = dumpstate->registerAsService(); + + if (status != android::OK) + { + ALOGE("Could not register DumpstateDevice service (%d).", status); + return -1; + } + + joinRpcThreadpool(); +} diff --git a/factory/framework/Android.bp b/factory/framework/Android.bp new file mode 100644 index 00000000..54b5b68f --- /dev/null +++ b/factory/framework/Android.bp @@ -0,0 +1,15 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +runtime_resource_overlay { + name: "FactoryOverlayFrameworkRes", + product_specific: true, +} diff --git a/factory/framework/AndroidManifest.xml b/factory/framework/AndroidManifest.xml new file mode 100644 index 00000000..73875be8 --- /dev/null +++ b/factory/framework/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/factory/framework/res/drawable-nodpi/default_wallpaper.png b/factory/framework/res/drawable-nodpi/default_wallpaper.png new file mode 100644 index 00000000..93b787e3 Binary files /dev/null and b/factory/framework/res/drawable-nodpi/default_wallpaper.png differ diff --git a/factory/launcher3/Android.bp b/factory/launcher3/Android.bp new file mode 100644 index 00000000..31ee56ae --- /dev/null +++ b/factory/launcher3/Android.bp @@ -0,0 +1,15 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +runtime_resource_overlay { + name: "FactoryOverlayLauncher3", + product_specific: true, +} diff --git a/factory/launcher3/AndroidManifest.xml b/factory/launcher3/AndroidManifest.xml new file mode 100644 index 00000000..3f285855 --- /dev/null +++ b/factory/launcher3/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/factory/launcher3/res/xml/default_workspace_5x5.xml b/factory/launcher3/res/xml/default_workspace_5x5.xml new file mode 100644 index 00000000..ba1427a8 --- /dev/null +++ b/factory/launcher3/res/xml/default_workspace_5x5.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + diff --git a/factory/settings/Android.bp b/factory/settings/Android.bp new file mode 100644 index 00000000..adc3ea41 --- /dev/null +++ b/factory/settings/Android.bp @@ -0,0 +1,15 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +runtime_resource_overlay { + name: "FactoryOverlaySettings", + product_specific: true, +} diff --git a/factory/settings/AndroidManifest.xml b/factory/settings/AndroidManifest.xml new file mode 100644 index 00000000..72e7838a --- /dev/null +++ b/factory/settings/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/factory/settings/res/values/defaults.xml b/factory/settings/res/values/defaults.xml new file mode 100644 index 00000000..b7febd9e --- /dev/null +++ b/factory/settings/res/values/defaults.xml @@ -0,0 +1,26 @@ + + + + 0 + true + false + false + false + confirmed + diff --git a/factory_common.mk b/factory_common.mk new file mode 100644 index 00000000..9872bc43 --- /dev/null +++ b/factory_common.mk @@ -0,0 +1,70 @@ +# +# Copyright 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. +# + +$(call inherit-product, device/google/gs101/aosp_common.mk) + +PRODUCT_PROPERTY_OVERRIDES += service.adb.root=1 \ + ro.vendor.factory=1 + +# Factory Libraries of Audio +PRODUCT_PACKAGES += audioroute libaudioroutelite + +# Enable fatp by default for factory builds +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + persist.vendor.camera.fatp.enable=1 + +# Disable camera related features for factory builds +PRODUCT_PROPERTY_OVERRIDES += \ + vendor.camera.debug.bypass_face_ssd_processor=1 \ + vendor.camera.debug.csi_ebuf_enable=0 \ + vendor.camera.debug.enable_face_detection=0 \ + vendor.camera.debug.force_dpm_on=0 \ + vendor.camera.debug.force_eis_on=0 \ + vendor.camera.debug.force_eaf_on=0 \ + vendor.camera.debug.force_local_tone_mapping_on=0 \ + vendor.camera.debug.force_mesh_warp_on=0 \ + vendor.camera.debug.force_rectiface_node_on=0 \ + vendor.camera.debug.force_steadiface_on=0 \ + vendor.camera.debug.force_tnr_on=0 \ + vendor.camera.debug.local_tone_mapping_controller_v1.mode=0 + +# Disable ScreenDecorations for factory builds +PRODUCT_PROPERTY_OVERRIDES += \ + debug.disable_screen_decorations=true + +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=80 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_touch_timer_ms=200 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_display_power_timer_ms=1000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_content_detection_for_refresh_rate=true + +# factory should always has SELinux permissive +BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive + +# Disable Bluetooth as default in factory build +DEVICE_PACKAGE_OVERLAYS += device/google/gs101/overlay-factory + +PRODUCT_COPY_FILES += \ + device/google/gs101/conf/init.factory.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.factory.rc + +# Add factory-friendly changes +PRODUCT_PACKAGES += \ + FactoryOverlaySettings \ + FactoryOverlayLauncher3 \ + FactoryOverlayFrameworkRes + +# PixelLogger for RF testing +PRODUCT_PACKAGES_DEBUG += \ + PixelLogger \ diff --git a/fingerprint/fpc1540/fingerprint_config.mk b/fingerprint/fpc1540/fingerprint_config.mk new file mode 100644 index 00000000..1c3323e7 --- /dev/null +++ b/fingerprint/fpc1540/fingerprint_config.mk @@ -0,0 +1,18 @@ +# ---------------------------- +# Add feature flags below +# ---------------------------- +FPC_CONFIG_BUILD_VERSION=31 +FPC_CONFIG_CAPACITIVE=1 +FPC_CONFIG_MAX_NR_TEMPLATES=5 +FPC_CONFIG_SENSE_TOUCH_CALIBRATION_PATH=/data/fpc/calibration_sense_touch.dat +FPC_CONFIG_TA_FS=1 +FPC_DEFECTIVE_PIXEL_LIST_SIZE=5000 +FPC_SENSOR_SDK_LOG_LEVEL=3 +FPC_TEE_RUNTIME=TRUSTY +LIBFPC_NAME=libfpc1541_S_nav_debug.a +FPC_CONFIG_DEBUG=1 +FPC_CONFIG_PRODUCT_DEFAULT=FPC_PRODUCT_TYPE1541_S + +# +# File included from device//<>/.mk +# Packages to include into the build diff --git a/fingerprint/fpc1540/fingerprint_config_factory.mk b/fingerprint/fpc1540/fingerprint_config_factory.mk new file mode 100644 index 00000000..58ca55d1 --- /dev/null +++ b/fingerprint/fpc1540/fingerprint_config_factory.mk @@ -0,0 +1,21 @@ +# ---------------------------- +# Add feature flags below +# ---------------------------- +FPC_CONFIG_BUILD_VERSION=31 +FPC_CONFIG_CAPACITIVE=1 +FPC_CONFIG_MAX_NR_TEMPLATES=5 +FPC_CONFIG_NAVIGATION=0 +FPC_CONFIG_SENSE_TOUCH_CALIBRATION_PATH=/data/fpc/calibration_sense_touch.dat +FPC_CONFIG_SENSORTEST=1 +FPC_CONFIG_TA_FS=1 +FPC_DEFECTIVE_PIXEL_LIST_SIZE=5000 +FPC_SENSOR_SDK_LOG_LEVEL=3 +FPC_TEE_RUNTIME=TRUSTY +LIBFPC_NAME=libfpc1541_S_nav_debug.a +FPC_CONFIG_DEBUG=1 +FPC_CONFIG_ENGINEERING=1 +FPC_CONFIG_PRODUCT_DEFAULT=FPC_PRODUCT_TYPE1541_S + +# +# File included from device//<>/.mk +# Packages to include into the build diff --git a/fingerprint/fpc1540/fpc1540.mk b/fingerprint/fpc1540/fpc1540.mk new file mode 100644 index 00000000..7fdcb120 --- /dev/null +++ b/fingerprint/fpc1540/fpc1540.mk @@ -0,0 +1,8 @@ +# Fingerprint +include device/google/gs101/fingerprint/fpc1540/fingerprint_config.mk + +PRODUCT_PACKAGES += \ + android.hardware.biometrics.fingerprint@2.1-service.fpc \ + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml diff --git a/fingerprint/fpc1540/fpc1540_factory.mk b/fingerprint/fpc1540/fpc1540_factory.mk new file mode 100644 index 00000000..e868c5e9 --- /dev/null +++ b/fingerprint/fpc1540/fpc1540_factory.mk @@ -0,0 +1,10 @@ +# Fingerprint +include device/google/gs101/fingerprint/fpc1540/fingerprint_config_factory.mk + +PRODUCT_PACKAGES += \ + fpc_tee_test\ + SensorTestTool \ + +PRODUCT_PACKAGES += \ + com.fingerprints.extension.xml \ + com.fingerprints.extension \ diff --git a/fingerprint/udfps.mk b/fingerprint/udfps.mk new file mode 100644 index 00000000..089b531f --- /dev/null +++ b/fingerprint/udfps.mk @@ -0,0 +1,21 @@ +# +# 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. +# + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml + +PRODUCT_PACKAGES += \ + android.hardware.biometrics.fingerprint@2.1-service.goodix diff --git a/fingerprint/udfps_factory.mk b/fingerprint/udfps_factory.mk new file mode 100644 index 00000000..41aebe08 --- /dev/null +++ b/fingerprint/udfps_factory.mk @@ -0,0 +1,22 @@ +# +# 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. +# + +PRODUCT_PACKAGES += \ + GF_delmar_factory \ + udfps_test + +PRODUCT_PROPERTY_OVERRIDES += \ + gf.debug.dump_data=1 diff --git a/firmware/BCM.btaddr b/firmware/BCM.btaddr new file mode 100644 index 00000000..4bf70ebc --- /dev/null +++ b/firmware/BCM.btaddr @@ -0,0 +1 @@ +22:22:3b:ff:0d:50 diff --git a/firmware/BCM4362A2_001.003.006.0027.0033.hcd b/firmware/BCM4362A2_001.003.006.0027.0033.hcd new file mode 100644 index 00000000..27b0dbc2 Binary files /dev/null and b/firmware/BCM4362A2_001.003.006.0027.0033.hcd differ diff --git a/firmware/BCM4389C0_003.001.010.0101.0000_Google_eval_USI_ES10.hcd b/firmware/BCM4389C0_003.001.010.0101.0000_Google_eval_USI_ES10.hcd new file mode 100644 index 00000000..8e73e471 Binary files /dev/null and b/firmware/BCM4389C0_003.001.010.0101.0000_Google_eval_USI_ES10.hcd differ diff --git a/firmware/BCM4389C1_003.002.009.0050.0000_Google_eval_USI_ES10_ePA_Updated.hcd b/firmware/BCM4389C1_003.002.009.0050.0000_Google_eval_USI_ES10_ePA_Updated.hcd new file mode 100644 index 00000000..47120b34 Binary files /dev/null and b/firmware/BCM4389C1_003.002.009.0050.0000_Google_eval_USI_ES10_ePA_Updated.hcd differ diff --git a/firmware/mfc_fw_v14.2.bin b/firmware/mfc_fw_v14.2.bin new file mode 100644 index 00000000..61a32f70 Binary files /dev/null and b/firmware/mfc_fw_v14.2.bin differ diff --git a/gnss/47765/Android.bp b/gnss/47765/Android.bp new file mode 100644 index 00000000..f4a29026 --- /dev/null +++ b/gnss/47765/Android.bp @@ -0,0 +1,231 @@ +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +soong_namespace { +} + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +cc_prebuilt_library_shared { + name: "android.hardware.gnss@2.1-impl-google", + arch: { + arm64: { + srcs: ["bin/android.hardware.gnss@2.1-impl-google.so"], + shared_libs: [ + "liblog", + "libhidlbase", + // "libhidltransport", + "libutils", + "android.hardware.gnss@1.0", + "android.hardware.gnss@1.1", + "android.hardware.gnss@2.0", + "android.hardware.gnss@2.1", + "android.hardware.gnss.measurement_corrections@1.0", + "android.hardware.gnss.visibility_control@1.0", + "android.hardware.gnss-V1-ndk_platform", + "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", + "libc++", + "libc", + "libm", + "libdl", + ], + }, + }, + compile_multilib: "64", + vendor: true, + relative_install_path: "hw", + strip: { + none: true, + }, + // Bypass because libhidltransport is deprecated + // Bypass because libhwbinder is deprecated + check_elf_files: false, + vintf_fragments: ["android.hardware.gnss@2.1-service-brcm.xml"] +} + +cc_prebuilt_library_shared { + name: "flp.default", + arch: { + arm64: { + srcs: ["bin/flp.default.so"], + shared_libs: [ + "liblog", + "libcutils", + "libutils", + "libc++", + "libc", + "libm", + "libdl", + ], + }, + }, + compile_multilib: "64", + vendor: true, + relative_install_path: "hw", + strip: { + none: true, + }, + // Bypass because soname mismatch + check_elf_files: false, +} + +cc_prebuilt_binary { + name: "gpsd", + arch: { + arm64: { + srcs: ["bin/gpsd"], + shared_libs: [ + "liblog", + "libutils", + "libhardware_legacy", + "libcutils", + "libssl", + "libcrypto", + // "libsitril-gps", + "android.frameworks.sensorservice@1.0", + "libhidlbase", + "libandroid_net", + "libc++", + "libc", + "libm", + "libdl", + ], + }, + }, + compile_multilib: "64", + vendor: true, + relative_install_path: "hw", + strip: { + none: true, + }, + // Bypass because libsitril-gps is Android.mk module + check_elf_files: false, +} + +cc_prebuilt_library_shared { + name: "gps.default", + arch: { + arm64: { + srcs: ["bin/gps.default.so"], + shared_libs: [ + "liblog", + "libcutils", + "libutils", + "libc++", + "libc", + "libm", + "libdl", + ], + }, + }, + compile_multilib: "64", + vendor: true, + relative_install_path: "hw", + strip: { + none: true, + }, + // Bypass because soname mismatch + check_elf_files: false, +} + +cc_prebuilt_binary { + name: "lhd", + arch: { + arm64: { + srcs: ["bin/lhd"], + shared_libs: [ + "liblog", + "libutils", + "libhardware_legacy", + "libc++", + "libc", + "libm", + "libz", + "android.hardware.contexthub@1.0", + "libhidlbase", + "libdl", + ], + }, + }, + compile_multilib: "64", + vendor: true, + relative_install_path: "hw", + strip: { + none: true, + }, +} + +cc_prebuilt_binary { + name: "scd", + arch: { + arm64: { + srcs: ["bin/scd"], + shared_libs: [ + "liblog", + "libutils", + "libssl", + "libcrypto", + "libandroid_net", + ], + }, + }, + compile_multilib: "64", + vendor: true, + relative_install_path: "hw", + strip: { + none: true, + }, +} diff --git a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml b/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml new file mode 100644 index 00000000..1eb3509e --- /dev/null +++ b/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml @@ -0,0 +1,16 @@ + + + android.hardware.gnss + hwbinder + 2.1 + 1.1 + + IGnss + default + + + + android.hardware.gnss + IGnss/default + + diff --git a/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so b/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so new file mode 100755 index 00000000..f4a280b9 Binary files /dev/null and b/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so differ diff --git a/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm b/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm new file mode 100755 index 00000000..d04cbfd3 Binary files /dev/null and b/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm differ diff --git a/gnss/47765/bin/flp.default.so b/gnss/47765/bin/flp.default.so new file mode 100755 index 00000000..fc176c06 Binary files /dev/null and b/gnss/47765/bin/flp.default.so differ diff --git a/gnss/47765/bin/gps.default.so b/gnss/47765/bin/gps.default.so new file mode 100755 index 00000000..5ec25529 Binary files /dev/null and b/gnss/47765/bin/gps.default.so differ diff --git a/gnss/47765/bin/gpsd b/gnss/47765/bin/gpsd new file mode 100755 index 00000000..ca45731a Binary files /dev/null and b/gnss/47765/bin/gpsd differ diff --git a/gnss/47765/bin/lhd b/gnss/47765/bin/lhd new file mode 100755 index 00000000..9d465af4 Binary files /dev/null and b/gnss/47765/bin/lhd differ diff --git a/gnss/47765/bin/scd b/gnss/47765/bin/scd new file mode 100755 index 00000000..d4ae8ea7 Binary files /dev/null and b/gnss/47765/bin/scd differ diff --git a/gnss/47765/config/gps.cer b/gnss/47765/config/gps.cer new file mode 100644 index 00000000..452d3d20 --- /dev/null +++ b/gnss/47765/config/gps.cer @@ -0,0 +1,160 @@ +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy +dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 +MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx +dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f +BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A +cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm +aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw +ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj +IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y +7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh +1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 +MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL +v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 +eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq +tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd +C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa +zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB +mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH +V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n +bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG +3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs +J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO +291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS +ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd +AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH +MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI +2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx +1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ +q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz +tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ +vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV +5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY +1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 +NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG +Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 +8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe +pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- diff --git a/gnss/47765/config/gps.xml b/gnss/47765/config/gps.xml new file mode 100644 index 00000000..335f1f00 --- /dev/null +++ b/gnss/47765/config/gps.xml @@ -0,0 +1,86 @@ + + + + + + + + + + diff --git a/gnss/47765/config/lhd.conf b/gnss/47765/config/lhd.conf new file mode 100644 index 00000000..0ee45635 --- /dev/null +++ b/gnss/47765/config/lhd.conf @@ -0,0 +1,27 @@ +LheName=bbd + +LheRsmResetTimeoutMS=10000 +GpioNStdbyPath=/sys/devices/platform/10940000.spi/spi_master/spi5/spi5.0/nstandby + +LhePatch=/vendor/firmware/SensorHub.patch +Lhe477xDebugFlags=RPC:FACILITY=65535-dKP+CUST+LHE:LOG_DEBUG:STDOUT_PUTS:STDOUT_LOG +LheConsole=/data/vendor/gps/LheConsole + +LogEnabled=true +Log=JAVA +LogDirectory=/sdcard/gps/broadcom/storage + +LheBbdPacket=/dev/ttyBCM + +LheBbdControl=/dev/bbd_control + +# LheBbdSensor=/dev/bbd_sensor + +LheFailSafe=/data/vendor/gps/esw-crash-dump.txt + +NvStorageDir=/data/vendor/gps/ + +# Enable BBD debugging at these stages: +# LheDriverDebugFlags=PATCH_BBD:LHE_BBD:FSC_BBD + +LheAutoBaudDelayMS=10 diff --git a/gnss/47765/config/scd.conf b/gnss/47765/config/scd.conf new file mode 100644 index 00000000..f6305c38 --- /dev/null +++ b/gnss/47765/config/scd.conf @@ -0,0 +1,5 @@ +LogEnabled=true +Log=JAVA +LogDirectory=/sdcard/gps/broadcom/storage +NvStorageDir=/data/vendor/gps/ +TcpConnectionTimeout=20 diff --git a/gnss/47765/firmware/SensorHub.patch b/gnss/47765/firmware/SensorHub.patch new file mode 100644 index 00000000..015037cd --- /dev/null +++ b/gnss/47765/firmware/SensorHub.patch @@ -0,0 +1,6467 @@ + + + + + + + + + + + + + + diff --git a/gnss/Android.mk b/gnss/Android.mk new file mode 100644 index 00000000..12f46b76 --- /dev/null +++ b/gnss/Android.mk @@ -0,0 +1,40 @@ +# Copyright (C) 2010 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# We're moving the emulator-specific platform libs to +# development.git/tools/emulator/. The following test is to ensure +# smooth builds even if the tree contains both versions. +# + +ifeq ($(BOARD_USES_EXYNOS_GNSS_DUMMY), true) + +LOCAL_PATH := $(call my-dir) + +# HAL module implemenation stored in +# hw/..so +include $(CLEAR_VARS) + +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware +LOCAL_SRC_FILES := gps_dummy.c +LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM) +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE +LOCAL_PROPRIETARY_MODULE := true + +include $(BUILD_SHARED_LIBRARY) + +endif diff --git a/gnss/gps_dummy.c b/gnss/gps_dummy.c new file mode 100644 index 00000000..9ccde1d3 --- /dev/null +++ b/gnss/gps_dummy.c @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* this implements a GPS hardware library for the Android emulator. + * the following code should be built as a shared library that will be + * placed into /system/lib/hw/gps.goldfish.so + * + * it will be loaded by the code in hardware/libhardware/hardware.c + * which is itself called from android_location_GpsLocationProvider.cpp + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOG_TAG "gps_dummy" +#include +//#include +#include + +#define GPS_DEBUG 0 + +#if GPS_DEBUG +# define D(...) ALOGD(__VA_ARGS__) +#else +# define D(...) ((void)0) +#endif + +static int +dummy_gps_init(GpsCallbacks* callbacks) +{ + return 0; +} + +static void +dummy_gps_cleanup(void) +{ +} + + +static int +dummy_gps_start() +{ + return 0; +} + + +static int +dummy_gps_stop() +{ + return 0; +} + + +static int +dummy_gps_inject_time(GpsUtcTime __unused time, + int64_t __unused timeReference, + int __unused uncertainty) +{ + return 0; +} + +static int +dummy_gps_inject_location(double __unused latitude, + double __unused longitude, + float __unused accuracy) +{ + return 0; +} + +static void +dummy_gps_delete_aiding_data(GpsAidingData __unused flags) +{ +} + +static int dummy_gps_set_position_mode(GpsPositionMode __unused mode, + GpsPositionRecurrence __unused recurrence, + uint32_t __unused min_interval, + uint32_t __unused preferred_accuracy, + uint32_t __unused preferred_time) +{ + // FIXME - support fix_frequency + return 0; +} + +static const void* +dummy_gps_get_extension(const char* __unused name) +{ + // no extensions supported + return NULL; +} + +static const GpsInterface dummyGpsInterface = { + sizeof(GpsInterface), + dummy_gps_init, + dummy_gps_start, + dummy_gps_stop, + dummy_gps_cleanup, + dummy_gps_inject_time, + dummy_gps_inject_location, + dummy_gps_delete_aiding_data, + dummy_gps_set_position_mode, + dummy_gps_get_extension, +}; + +const GpsInterface* gps__get_gps_interface(struct gps_device_t* __unused dev) +{ + return &dummyGpsInterface; +} + +static int open_gps(const struct hw_module_t* module, + char const* __unused name, + struct hw_device_t** device) +{ + struct gps_device_t *dev = (struct gps_device_t *)malloc(sizeof(struct gps_device_t)); + memset(dev, 0, sizeof(*dev)); + + dev->common.tag = HARDWARE_DEVICE_TAG; + dev->common.version = 0; + dev->common.module = (struct hw_module_t*)module; + dev->get_gps_interface = gps__get_gps_interface; + + *device = (struct hw_device_t*)dev; + return 0; +} + +static struct hw_module_methods_t gps_module_methods = { + .open = open_gps +}; + +struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = GPS_HARDWARE_MODULE_ID, + .name = "Dummy GPS Module", + .author = "The Android Open Source Project", + .methods = &gps_module_methods, +}; diff --git a/health/Android.bp b/health/Android.bp new file mode 100644 index 00000000..41a0e126 --- /dev/null +++ b/health/Android.bp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +cc_library_shared { + name: "android.hardware.health@2.1-impl-gs101", + stem: "android.hardware.health@2.0-impl-2.1-gs101", + + proprietary: true, + relative_install_path: "hw", + srcs: [ + "Health.cpp", + ], + + cflags: [ + "-Wall", + "-Werror", + ], + + static_libs: [ + "android.hardware.health@1.0-convert", + "libbatterymonitor", + "libhealth2impl", + "libhealthloop", + ], + + shared_libs: [ + "libbase", + "libcutils", + "libhidlbase", + "libpixelhealth", + "libutils", + "android.hardware.health@2.0", + "android.hardware.health@2.1", + ], +} diff --git a/health/Health.cpp b/health/Health.cpp new file mode 100644 index 00000000..9af0d342 --- /dev/null +++ b/health/Health.cpp @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2018 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.health@2.1-impl-gs101" +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace { + +using namespace std::literals; + +using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo; +using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo; +using android::hardware::health::V2_0::DiskStats; +using android::hardware::health::V2_0::StorageAttribute; +using android::hardware::health::V2_0::StorageInfo; +using android::hardware::health::V2_0::Result; +using ::android::hardware::health::V2_1::IHealth; +using android::hardware::health::InitHealthdConfig; + +using hardware::google::pixel::health::BatteryDefender; +using hardware::google::pixel::health::BatteryMetricsLogger; +using hardware::google::pixel::health::BatteryThermalControl; +using hardware::google::pixel::health::DeviceHealth; +using hardware::google::pixel::health::LowBatteryShutdownMetrics; +using hardware::google::pixel::health::ChargerDetect; + +#define FG_DIR "/sys/class/power_supply/battery" +constexpr char kBatteryResistance[] {FG_DIR "/resistance"}; +constexpr char kBatteryOCV[] {FG_DIR "/voltage_ocv"}; +constexpr char kVoltageAvg[] {FG_DIR "/voltage_now"}; + +static BatteryDefender battDefender; +static BatteryThermalControl battThermalControl( + "dev/thermal/tz-by-name/soc/mode"); +static BatteryMetricsLogger battMetricsLogger(kBatteryResistance, kBatteryOCV); +static LowBatteryShutdownMetrics shutdownMetrics(kVoltageAvg); +static DeviceHealth deviceHealth; + +#define UFS_DIR "/dev/sys/block/bootdevice" +constexpr char kUfsHealthEol[]{UFS_DIR "/health_descriptor/eol_info"}; +constexpr char kUfsHealthLifetimeA[]{UFS_DIR "/health_descriptor/life_time_estimation_a"}; +constexpr char kUfsHealthLifetimeB[]{UFS_DIR "/health_descriptor/life_time_estimation_b"}; +constexpr char kUfsVersion[]{UFS_DIR "/device_descriptor/specification_version"}; +constexpr char kDiskStatsFile[]{"/sys/block/sda/stat"}; +constexpr char kUFSName[]{"UFS0"}; + +static std::string ufs_version; +static uint16_t eol; +static uint16_t lifetimeA; +static uint16_t lifetimeB; +static std::chrono::system_clock::time_point ufs_last_query_time; +constexpr auto kUfsQueryIntervalHours = std::chrono::hours{24}; + +#define WLC_DIR "/sys/class/power_supply/wireless" +static bool needs_wlc_updates = false; +constexpr char kWlcCapacity[]{WLC_DIR "/capacity"}; + +std::ifstream assert_open(const std::string &path) { + std::ifstream stream(path); + if (!stream.is_open()) { + LOG(WARNING) << "Cannot read " << path; + } + return stream; +} + +template +void read_value_from_file(const std::string &path, T *field) { + auto stream = assert_open(path); + stream.unsetf(std::ios_base::basefield); + stream >> *field; +} + +void read_ufs_version(StorageInfo *info) { + if (ufs_version.empty()) { + uint64_t value; + read_value_from_file(kUfsVersion, &value); + std::stringstream ss; + ss << "ufs " << std::hex << value; + ufs_version = ss.str(); + LOG(INFO) << "ufs: " << ufs_version << " detected"; + } + info->version = ufs_version; +} + +void fill_ufs_storage_attribute(StorageAttribute *attr) { + attr->isInternal = true; + attr->isBootDevice = true; + attr->name = kUFSName; +} + +static bool FileExists(const std::string &filename) { + struct stat buffer; + + return stat(filename.c_str(), &buffer) == 0; +} + +void private_healthd_board_init(struct healthd_config *hc) { + std::string tcpmPsyName; + ChargerDetect::populateTcpmPsyName(&tcpmPsyName); + hc->ignorePowerSupplyNames.push_back(android::String8(tcpmPsyName.c_str())); + needs_wlc_updates = FileExists(kWlcCapacity); +} + +int private_healthd_board_battery_update(struct android::BatteryProperties *props) { + deviceHealth.update(props); + battThermalControl.updateThermalState(props); + battMetricsLogger.logBatteryProperties(props); + shutdownMetrics.logShutdownVoltage(props); + // Allow BatteryDefender to override online properties + ChargerDetect::onlineUpdate(props); + battDefender.update(props); + + if (needs_wlc_updates && + !android::base::WriteStringToFile(std::to_string(props->batteryLevel), kWlcCapacity)) + LOG(INFO) << "Unable to write battery level to wireless capacity"; + + return 0; +} + +void private_get_storage_info(std::vector &vec_storage_info) { + vec_storage_info.resize(1); + StorageInfo *storage_info = &vec_storage_info[0]; + fill_ufs_storage_attribute(&storage_info->attr); + + read_ufs_version(storage_info); + + auto time_now = std::chrono::system_clock::now(); + auto time_delta = time_now - ufs_last_query_time; + auto hoursElapsed = std::chrono::duration_cast(time_delta); + if (hoursElapsed >= kUfsQueryIntervalHours) { + ufs_last_query_time = time_now; + read_value_from_file(kUfsHealthEol, &eol); + read_value_from_file(kUfsHealthLifetimeA, &lifetimeA); + read_value_from_file(kUfsHealthLifetimeB, &lifetimeB); + LOG(INFO) << "ufs: eol=" << eol << " lifetimeA=" << lifetimeA << " lifetimeB=" << lifetimeB; + } + storage_info->eol = eol; + storage_info->lifetimeA = lifetimeA; + storage_info->lifetimeB = lifetimeB; + + return; +} + +void private_get_disk_stats(std::vector &vec_stats) { + vec_stats.resize(1); + DiskStats *stats = &vec_stats[0]; + fill_ufs_storage_attribute(&stats->attr); + + auto stream = assert_open(kDiskStatsFile); + // Regular diskstats entries + stream >> stats->reads >> stats->readMerges >> stats->readSectors >> + stats->readTicks >> stats->writes >> stats->writeMerges >> + stats->writeSectors >> stats->writeTicks >> stats->ioInFlight >> + stats->ioTicks >> stats->ioInQueue; + return; +} +} // anonymous namespace + +namespace android { +namespace hardware { +namespace health { +namespace V2_1 { +namespace implementation { +class HealthImpl : public Health { + public: + HealthImpl(std::unique_ptr&& config) + : Health(std::move(config)) {} + + Return getStorageInfo(getStorageInfo_cb _hidl_cb) override; + Return getDiskStats(getDiskStats_cb _hidl_cb) override; + + protected: + void UpdateHealthInfo(HealthInfo* health_info) override; + +}; + +void HealthImpl::UpdateHealthInfo(HealthInfo* health_info) { + struct BatteryProperties props; + convertFromHealthInfo(health_info->legacy.legacy, &props); + private_healthd_board_battery_update(&props); + convertToHealthInfo(&props, health_info->legacy.legacy); +} + +Return HealthImpl::getStorageInfo(getStorageInfo_cb _hidl_cb) +{ + std::vector info; + private_get_storage_info(info); + hidl_vec info_vec(info); + if (!info.size()) { + _hidl_cb(Result::NOT_SUPPORTED, info_vec); + } else { + _hidl_cb(Result::SUCCESS, info_vec); + } + return Void(); +} + +Return HealthImpl::getDiskStats(getDiskStats_cb _hidl_cb) +{ + std::vector stats; + private_get_disk_stats(stats); + hidl_vec stats_vec(stats); + if (!stats.size()) { + _hidl_cb(Result::NOT_SUPPORTED, stats_vec); + } else { + _hidl_cb(Result::SUCCESS, stats_vec); + } + return Void(); +} + +} // namespace implementation +} // namespace V2_1 +} // namespace health +} // namespace hardware +} // namespace android + +extern "C" IHealth* HIDL_FETCH_IHealth(const char* instance) { + using ::android::hardware::health::V2_1::implementation::HealthImpl; + if (instance != "default"sv) { + return nullptr; + } + auto config = std::make_unique(); + InitHealthdConfig(config.get()); + + private_healthd_board_init(config.get()); + + return new HealthImpl(std::move(config)); +} diff --git a/init.insmod.gs101.cfg b/init.insmod.gs101.cfg new file mode 100644 index 00000000..9518eace --- /dev/null +++ b/init.insmod.gs101.cfg @@ -0,0 +1,33 @@ +#################################################### +# 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 +insmod|/vendor/lib/modules/mailbox-wc.ko +insmod|/vendor/lib/modules/aoc_core.ko +insmod|/vendor/lib/modules/aoc_channel_dev.ko +insmod|/vendor/lib/modules/aoc_control_dev.ko +insmod|/vendor/lib/modules/snd-soc-wm-adsp.ko +insmod|/vendor/lib/modules/snd-soc-cs35l41.ko +insmod|/vendor/lib/modules/snd_soc_google_aoc_util.ko +insmod|/vendor/lib/modules/snd_soc_google_aoc.ko +insmod|/vendor/lib/modules/aoc_char_dev.ko +insmod|/vendor/lib/modules/aoc_usb_driver.ko +insmod|/vendor/lib/modules/videobuf2-vmalloc.ko +insmod|/vendor/lib/modules/heatmap.ko +insmod|/vendor/lib/modules/gsa.ko +insmod|/vendor/lib/modules/gsa_gsc.ko +insmod|/vendor/lib/modules/abrolhos.ko +insmod|/vendor/lib/modules/haptics-cs40l2x.ko +modprobe|slg51000-core.ko +modprobe|slg51000-regulator.ko +modprobe|pinctrl-slg51000.ko +modprobe|lwis.ko +modprobe|stmvl53l1.ko +insmod|/vendor/lib/modules/st21nfc.ko +# All common modules loaded +setprop|vendor.common.modules.ready diff --git a/init.insmod.sh b/init.insmod.sh new file mode 100755 index 00000000..5d400639 --- /dev/null +++ b/init.insmod.sh @@ -0,0 +1,55 @@ +#!/vendor/bin/sh + +############################################################# +### init.insmod.cfg format: ### +### ----------------------------------------------------- ### +### [insmod|setprop|enable/moprobe|wait] [path|prop name] ### +### ... ### +############################################################# + +# 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 /vendor/lib/modules exynos-drm.ko + modprobe -d /vendor/lib/modules $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 + 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") modprobe -a -d /vendor/lib/modules $arg ;; + "wait") wait_for_file $arg ;; + "install_display_drivers") install_display_drivers ;; + esac + done < $cfg_file +fi diff --git a/init.ramoops.sh b/init.ramoops.sh new file mode 100755 index 00000000..22146da1 --- /dev/null +++ b/init.ramoops.sh @@ -0,0 +1,17 @@ +#!/vendor/bin/sh + +# Decrypt the keys and write them to the kernel +ramoops -D + +if [ $? -eq 0 ]; then + # Pivot (and decrypt) + echo 1 > /sys/devices/virtual/ramoops/pstore/use_alt +else + setprop vendor.ramoops.decryption.error $? +fi + +# Trigger remount of pstore regardless of decryption state +setprop vendor.ramoops.decrypted true + +# Generate keys (if none exist), and load the keys to carveout +ramoops -g -l -c diff --git a/interfaces/boot/1.0/Android.bp b/interfaces/boot/1.0/Android.bp new file mode 100644 index 00000000..179a6f95 --- /dev/null +++ b/interfaces/boot/1.0/Android.bp @@ -0,0 +1,66 @@ +// +// Copyright (C) 2019 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +cc_binary { + name: "android.hardware.boot@1.0-service-gs101", + defaults: ["hidl_defaults"], + relative_install_path: "hw", + vendor: true, + init_rc: ["android.hardware.boot@1.0-service-gs101.rc"], + srcs: [ + "BootControl.cpp", + "GptUtils.cpp", + "service.cpp" + ], + shared_libs: [ + "libbase", + "liblog", + "libhidlbase", + "libutils", + "libcutils", + "libz", + "android.hardware.boot@1.0", + ], +} + +cc_library { + name: "android.hardware.boot@1.0-impl-gs101", + recovery: true, + srcs: [ + "BootControl.cpp", + "GptUtils.cpp", + ], + relative_install_path: "hw", + shared_libs: [ + "libbase", + "liblog", + "libhidlbase", + "libutils", + "libcutils", + "libz", + "android.hardware.boot@1.0", + ], +} diff --git a/interfaces/boot/1.0/BootControl.cpp b/interfaces/boot/1.0/BootControl.cpp new file mode 100644 index 00000000..1f155c9d --- /dev/null +++ b/interfaces/boot/1.0/BootControl.cpp @@ -0,0 +1,272 @@ +/* + * Copyright (C) 2019 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 "bootcontrolhal" + +#include "BootControl.h" +#include "GptUtils.h" + +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_0 { +namespace implementation { + +namespace { + +#define BOOT_A_PATH "/dev/block/by-name/boot_a" +#define BOOT_B_PATH "/dev/block/by-name/boot_b" + +// slot flags +#define AB_ATTR_PRIORITY_SHIFT 52 +#define AB_ATTR_PRIORITY_MASK (3UL << AB_ATTR_PRIORITY_SHIFT) +#define AB_ATTR_ACTIVE_SHIFT 54 +#define AB_ATTR_ACTIVE (1UL << AB_ATTR_ACTIVE_SHIFT) +#define AB_ATTR_RETRY_COUNT_SHIFT (55) +#define AB_ATTR_RETRY_COUNT_MASK (7UL << AB_ATTR_RETRY_COUNT_SHIFT) +#define AB_ATTR_SUCCESSFUL (1UL << 58) +#define AB_ATTR_UNBOOTABLE (1UL << 59) + +#define AB_ATTR_MAX_PRIORITY 3UL +#define AB_ATTR_MAX_RETRY_COUNT 3UL + +static std::string getDevPath(uint32_t slot) { + char real_path[PATH_MAX]; + + const char *path = slot == 0 ? BOOT_A_PATH : BOOT_B_PATH; + + int ret = readlink(path, real_path, sizeof real_path); + if (ret < 0) { + ALOGE("readlink failed for boot device %s\n", strerror(errno)); + return std::string(); + } + + std::string dp(real_path); + // extract /dev/sda.. part + return dp.substr(0, sizeof "/dev/block/sdX" - 1); +} + +static bool isSlotFlagSet(uint32_t slot, uint64_t flag) { + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + ALOGI("Could not get device path for slot %d\n", slot); + return false; + } + + GptUtils gpt(dev_path); + if (gpt.Load()) { + ALOGI("failed to load gpt data\n"); + return false; + } + + gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); + if (e == nullptr) { + ALOGI("failed to get gpt entry\n"); + return false; + } + + return !!(e->attr & flag); +} + +static int setSlotFlag(uint32_t slot, uint64_t flag) { + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + ALOGI("Could not get device path for slot %d\n", slot); + return -1; + } + + GptUtils gpt(dev_path); + if (gpt.Load()) { + ALOGI("failed to load gpt data\n"); + return -1; + } + + gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); + if (e == nullptr) { + ALOGI("failed to get gpt entry\n"); + return -1; + } + + e->attr |= flag; + gpt.Sync(); + + return 0; +} + +} + +// Methods from ::android::hardware::boot::V1_0::IBootControl follow. +Return BootControl::getNumberSlots() { + uint32_t slots = 0; + + if (access(BOOT_A_PATH, F_OK) == 0) + slots++; + + if (access(BOOT_B_PATH, F_OK) == 0) + slots++; + + return slots; +} + +Return BootControl::getCurrentSlot() { + char suffix[PROPERTY_VALUE_MAX]; + property_get("ro.boot.slot_suffix", suffix, "_a"); + return std::string(suffix) == "_b" ? 1 : 0; +} + +Return BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) { + if (getNumberSlots() == 0) { + // no slots, just return true otherwise Android keeps trying + _hidl_cb({true, ""}); + return Void(); + } + int ret = setSlotFlag(getCurrentSlot(), AB_ATTR_SUCCESSFUL); + ret ? _hidl_cb({false, "Failed to set successfull flag"}) : _hidl_cb({true, ""}); + return Void(); +} + +Return BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) { + if (slot >= 2) { + _hidl_cb({false, "Invalid slot"}); + return Void(); + } + + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + _hidl_cb({false, "Could not get device path for slot"}); + return Void(); + } + + GptUtils gpt(dev_path); + if (gpt.Load()) { + _hidl_cb({false, "failed to load gpt data"}); + return Void(); + } + + gpt_entry *active_entry = gpt.GetPartitionEntry(slot == 0 ? "boot_a" : "boot_b"); + gpt_entry *inactive_entry = gpt.GetPartitionEntry(slot == 0 ? "boot_b" : "boot_a"); + if (active_entry == nullptr || inactive_entry == nullptr) { + _hidl_cb({false, "failed to get entries for boot partitions"}); + return Void(); + } + + ALOGV("slot active attributes %lx\n", active_entry->attr); + ALOGV("slot inactive attributes %lx\n", inactive_entry->attr); + + char boot_dev[PROPERTY_VALUE_MAX]; + property_get("ro.boot.bootdevice", boot_dev, ""); + if (boot_dev[0] == '\0') { + _hidl_cb({false, "invalid ro.boot.bootdevice prop"}); + return Void(); + } + + 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); + 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); + if (fd < 0) { + _hidl_cb({false, "failed to open ufs attr boot_lun_enabled"}); + return Void(); + } + } + + // update attributes for active and inactive + inactive_entry->attr &= ~AB_ATTR_ACTIVE; + active_entry->attr = AB_ATTR_ACTIVE | (AB_ATTR_MAX_PRIORITY << AB_ATTR_PRIORITY_SHIFT) | + (AB_ATTR_MAX_RETRY_COUNT << AB_ATTR_RETRY_COUNT_SHIFT); + + // + // bBootLunEn + // 0x1 => Boot LU A = enabled, Boot LU B = disable + // 0x2 => Boot LU A = disable, Boot LU B = enabled + // + int ret = android::base::WriteStringToFd(slot == 0 ? "1" : "2", fd); + close(fd); + if (ret < 0) { + _hidl_cb({false, "faied to write boot_lun_enabled attribute"}); + return Void(); + } + + _hidl_cb({true, ""}); + return Void(); +} + +Return BootControl::setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) { + if (slot >= 2) { + _hidl_cb({false, "Invalid slot"}); + return Void(); + } + + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + _hidl_cb({false, "Could not get device path for slot"}); + return Void(); + } + + GptUtils gpt(dev_path); + gpt.Load(); + + gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); + e->attr |= AB_ATTR_UNBOOTABLE; + + gpt.Sync(); + + _hidl_cb({true, ""}); + return Void(); +} + +Return<::android::hardware::boot::V1_0::BoolResult> BootControl::isSlotBootable(uint32_t slot) { + if (getNumberSlots() == 0) + return BoolResult::FALSE; + if (slot >= getNumberSlots()) + return BoolResult::INVALID_SLOT; + return isSlotFlagSet(slot, AB_ATTR_UNBOOTABLE) ? BoolResult::FALSE : BoolResult::TRUE; +} + +Return<::android::hardware::boot::V1_0::BoolResult> BootControl::isSlotMarkedSuccessful(uint32_t slot) { + if (getNumberSlots() == 0) { + // just return true so that we don't we another call trying to mark it as successful + // when there is no slots + return BoolResult::TRUE; + } + if (slot >= getNumberSlots()) + return BoolResult::INVALID_SLOT; + return isSlotFlagSet(slot, AB_ATTR_SUCCESSFUL) ? BoolResult::TRUE : BoolResult::FALSE; +} + +Return BootControl::getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) { + _hidl_cb(slot == 0 ? "_a" : slot == 1 ? "_b" : ""); + return Void(); +} + +extern "C" IBootControl* HIDL_FETCH_IBootControl(const char*) { + return new BootControl(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.0/BootControl.h b/interfaces/boot/1.0/BootControl.h new file mode 100644 index 00000000..eb81cb07 --- /dev/null +++ b/interfaces/boot/1.0/BootControl.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_0 { +namespace implementation { + +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::sp; + +struct BootControl : public IBootControl { + // Methods from ::android::hardware::boot::V1_0::IBootControl follow. + Return getNumberSlots() override; + Return getCurrentSlot() override; + Return markBootSuccessful(markBootSuccessful_cb _hidl_cb) override; + Return setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override; + Return setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override; + Return<::android::hardware::boot::V1_0::BoolResult> isSlotBootable(uint32_t slot) override; + Return<::android::hardware::boot::V1_0::BoolResult> isSlotMarkedSuccessful(uint32_t slot) override; + Return getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override; + + // Methods from ::android::hidl::base::V1_0::IBase follow. + +}; + +// FIXME: most likely delete, this is only for passthrough implementations +extern "C" IBootControl* HIDL_FETCH_IBootControl(const char* name); + +} // namespace implementation +} // namespace V1_0 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.0/GptUtils.cpp b/interfaces/boot/1.0/GptUtils.cpp new file mode 100644 index 00000000..f8936175 --- /dev/null +++ b/interfaces/boot/1.0/GptUtils.cpp @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2019 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 "bootcontrolhal" + +#include "GptUtils.h" + +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_0 { +namespace implementation { + +namespace { + +static int ValidateGptHeader(gpt_header *gpt) +{ + if (gpt->signature != GPT_SIGNATURE) { + ALOGE("invalid gpt signature 0x%lx\n", gpt->signature); + return -1; + } + + if (gpt->header_size != sizeof(gpt_header)) { + ALOGE("invalid gpt header size %u\n", gpt->header_size); + return -1; + } + + if (gpt->entry_size != sizeof(gpt_entry)) { + ALOGE("invalid gpt entry size %u\n", gpt->entry_size); + return -1; + } + + return 0; +} + +} + +GptUtils::GptUtils(const std::string dev_path) : dev_path(dev_path), fd(0) {} + +int GptUtils::Load(void) +{ + fd = open(dev_path.c_str(), O_RDWR); + if (fd < 0) { + ALOGE("failed to open block dev %s, %d\n", dev_path.c_str(), errno); + return -1; + } + + int ret = ioctl(fd, BLKSSZGET, &block_size); + if (ret < 0) { + ALOGE("failed to get block size %d\n", errno); + return -1; + } + + // read primary header + lseek64(fd, block_size, SEEK_SET); + ret = read(fd, &gpt_primary, sizeof gpt_primary); + if (ret < 0) { + ALOGE("failed to read gpt primary header %d\n", errno); + return -1; + } + + if (ValidateGptHeader(&gpt_primary)) { + ALOGE("error validating gpt header\n"); + return -1; + } + + // read partition entries + entry_array.resize(gpt_primary.entry_count); + uint32_t entries_size = gpt_primary.entry_size * gpt_primary.entry_count; + lseek64(fd, block_size * gpt_primary.start_lba, SEEK_SET); + ret = read(fd, entry_array.data(), entries_size); + if (ret < 0) { + ALOGE("failed to read gpt partition entries %d\n", errno); + return -1; + } + + // read gpt back header + lseek64(fd, block_size * gpt_primary.backup_lba, SEEK_SET); + ret = read(fd, &gpt_backup, sizeof gpt_backup); + if (ret < 0) { + ALOGE("failed to read gpt backup header %d\n", errno); + return -1; + } + + if (ValidateGptHeader(&gpt_backup)) { + ALOGW("error validating gpt backup\n"); // just warn about it, not fail + } + + // Create map + auto get_name = [](const uint16_t *efi_name) { + char name[37] = {}; + for (int i = 0; efi_name[i] && i < sizeof name - 1; ++i) + name[i] = efi_name[i]; + return std::string(name); + }; + + for (auto const &e: entry_array) { + if (e.name[0] == 0) + break; // stop at the first partition with no name + std::string s = get_name(e.name); + entries[s] = const_cast(&e); + } + + return 0; +} + +gpt_entry *GptUtils::GetPartitionEntry(std::string name) +{ + return entries.find(name) != entries.end() ? entries[name] : nullptr; +} + +int GptUtils::Sync(void) +{ + if (!fd) + return -1; + + // calculate crc and check if we need to update gpt + gpt_primary.entries_crc32 = crc32(0, reinterpret_cast(entry_array.data()), + entry_array.size() * sizeof(gpt_entry)); + + // save old crc + uint32_t crc = gpt_primary.crc32; + gpt_primary.crc32 = 0; + + gpt_primary.crc32 = crc32(0, reinterpret_cast(&gpt_primary), sizeof gpt_primary); + if (crc == gpt_primary.crc32) + return 0; // nothing to do (no changes) + + ALOGI("updating GPT\n"); + + lseek64(fd, block_size * gpt_primary.current_lba, SEEK_SET); + int ret = write(fd, &gpt_primary, sizeof gpt_primary); + if (ret < 0) { + ALOGE("failed to write gpt primary header %d\n", errno); + return -1; + } + + lseek64(fd, block_size * gpt_primary.start_lba, SEEK_SET); + ret = write(fd, entry_array.data(), entry_array.size() * sizeof(gpt_entry)); + if (ret < 0) { + ALOGE("failed to write gpt partition entries %d\n", errno); + return -1; + } + + //update GPT backup entries and backup + lseek64(fd, block_size * gpt_backup.start_lba, SEEK_SET); + ret = write(fd, entry_array.data(), entry_array.size() * sizeof(gpt_entry)); + if (ret < 0) { + ALOGE("failed to write gpt backup partition entries %d\n", errno); + return -1; + } + + gpt_backup.entries_crc32 = gpt_primary.entries_crc32; + gpt_backup.crc32 = 0; + gpt_backup.crc32 = crc32(0, reinterpret_cast(&gpt_backup), sizeof gpt_backup); + lseek64(fd, block_size * gpt_primary.backup_lba, SEEK_SET); + ret = write(fd, &gpt_backup, sizeof gpt_backup); + if (ret < 0) { + ALOGE("failed to write gpt backup header %d\n", errno); + return -1; + } + + fsync(fd); + + return 0; +} + +GptUtils::~GptUtils() +{ + if (fd) { + Sync(); + close(fd); + } +} + +} // namespace implementation +} // namespace V1_0 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.0/GptUtils.h b/interfaces/boot/1.0/GptUtils.h new file mode 100644 index 00000000..d969d9d8 --- /dev/null +++ b/interfaces/boot/1.0/GptUtils.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_0 { +namespace implementation { + +#define GPT_SIGNATURE 0x5452415020494645UL + +typedef struct { + uint8_t type_guid[16]; + uint8_t guid[16]; + uint64_t first_lba; + uint64_t last_lba; + uint64_t attr; + uint16_t name[36]; +} __attribute__((packed)) gpt_entry; + +typedef struct { + uint64_t signature; + uint32_t revision; + uint32_t header_size; + uint32_t crc32; + uint32_t reserved; + uint64_t current_lba; + uint64_t backup_lba; + uint64_t first_usable_lba; + uint64_t last_usable_lba; + uint8_t disk_guid[16]; + uint64_t start_lba; + uint32_t entry_count; + uint32_t entry_size; + uint32_t entries_crc32; +} __attribute__((packed)) gpt_header; + +class GptUtils { + public: + GptUtils(const std::string dev_path); + int Load(void); + gpt_entry *GetPartitionEntry(std::string name); + int Sync(void); + ~GptUtils(); + + private: + std::string dev_path; + int fd; + uint32_t block_size; + gpt_header gpt_primary; + gpt_header gpt_backup; + std::vector entry_array; + std::mapentries; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.0/android.hardware.boot@1.0-service-gs101.rc b/interfaces/boot/1.0/android.hardware.boot@1.0-service-gs101.rc new file mode 100644 index 00000000..24a4b451 --- /dev/null +++ b/interfaces/boot/1.0/android.hardware.boot@1.0-service-gs101.rc @@ -0,0 +1,4 @@ +service vendor.boot-hal-1-0 /vendor/bin/hw/android.hardware.boot@1.0-service-gs101 + class early_hal + user root + group root diff --git a/interfaces/boot/1.0/service.cpp b/interfaces/boot/1.0/service.cpp new file mode 100644 index 00000000..9dcd78cc --- /dev/null +++ b/interfaces/boot/1.0/service.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define LOG_TAG "android.hardware.boot@1.0-service" + +#include +#include +#include +#include +#include "BootControl.h" + +using ::android::status_t; + +using ::android::hardware::boot::V1_0::IBootControl; + +using ::android::hardware::boot::V1_0::implementation::BootControl; + +int main (int /* argc */, char * /* argv */ []) { + // This function must be called before you join to ensure the proper + // number of threads are created. The threadpool will never exceed + // size one because of this call. + ::android::hardware::configureRpcThreadpool(1 /*threads*/, true /*willJoin*/); + + ::android::sp bootctrl = new BootControl(); + const status_t status = bootctrl->registerAsService(); + if (status != ::android::OK) { + return 1; // or handle error + } + + // Adds this thread to the threadpool, resulting in one total + // thread in the threadpool. We could also do other things, but + // would have to specify 'false' to willJoin in configureRpcThreadpool. + ::android::hardware::joinRpcThreadpool(); + return 1; // joinRpcThreadpool should never return +} diff --git a/interfaces/boot/1.2/Android.bp b/interfaces/boot/1.2/Android.bp new file mode 100644 index 00000000..982a543a --- /dev/null +++ b/interfaces/boot/1.2/Android.bp @@ -0,0 +1,81 @@ +// +// 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. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +cc_binary { + name: "android.hardware.boot@1.2-service-gs101", + defaults: ["hidl_defaults"], + relative_install_path: "hw", + vendor: true, + init_rc: ["android.hardware.boot@1.2-service-gs101.rc"], + srcs: [ + "BootControl.cpp", + "GptUtils.cpp", + "service.cpp" + ], + shared_libs: [ + "libbase", + "liblog", + "libhidlbase", + "libutils", + "libcutils", + "libz", + "android.hardware.boot@1.0", + "android.hardware.boot@1.1", + "android.hardware.boot@1.2", + ], + static_libs: [ + "libboot_control", + "libbootloader_message_vendor", + "libfstab", + ], +} + +cc_library { + name: "android.hardware.boot@1.2-impl-gs101", + stem: "android.hardware.boot@1.0-impl-1.2-impl-gs101", + recovery: true, + srcs: [ + "BootControl.cpp", + "GptUtils.cpp", + ], + relative_install_path: "hw", + shared_libs: [ + "libbase", + "liblog", + "libhidlbase", + "libutils", + "libcutils", + "libz", + "android.hardware.boot@1.0", + "android.hardware.boot@1.1", + "android.hardware.boot@1.2", + ], + static_libs: [ + "libboot_control", + "libbootloader_message_vendor", + "libfstab", + ], +} diff --git a/interfaces/boot/1.2/BootControl.cpp b/interfaces/boot/1.2/BootControl.cpp new file mode 100644 index 00000000..b754404a --- /dev/null +++ b/interfaces/boot/1.2/BootControl.cpp @@ -0,0 +1,316 @@ +/* + * 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. + */ + +#define LOG_TAG "bootcontrolhal" + +#include "BootControl.h" +#include "GptUtils.h" + +#include +#include +#include +#include +//#include +#include +#include + + +namespace android { +namespace hardware { +namespace boot { +namespace V1_2 { +namespace implementation { + +using android::bootable::GetMiscVirtualAbMergeStatus; +using android::bootable::InitMiscVirtualAbMessageIfNeeded; +using android::bootable::SetMiscVirtualAbMergeStatus; +using android::hardware::boot::V1_1::MergeStatus; +using android::hardware::boot::V1_0::CommandResult; +using android::hardware::boot::V1_0::BoolResult; + +namespace { + +#define BOOT_A_PATH "/dev/block/by-name/boot_a" +#define BOOT_B_PATH "/dev/block/by-name/boot_b" + +// slot flags +#define AB_ATTR_PRIORITY_SHIFT 52 +#define AB_ATTR_PRIORITY_MASK (3UL << AB_ATTR_PRIORITY_SHIFT) +#define AB_ATTR_ACTIVE_SHIFT 54 +#define AB_ATTR_ACTIVE (1UL << AB_ATTR_ACTIVE_SHIFT) +#define AB_ATTR_RETRY_COUNT_SHIFT (55) +#define AB_ATTR_RETRY_COUNT_MASK (7UL << AB_ATTR_RETRY_COUNT_SHIFT) +#define AB_ATTR_SUCCESSFUL (1UL << 58) +#define AB_ATTR_UNBOOTABLE (1UL << 59) + +#define AB_ATTR_MAX_PRIORITY 3UL +#define AB_ATTR_MAX_RETRY_COUNT 3UL + +static std::string getDevPath(uint32_t slot) { + char real_path[PATH_MAX]; + + const char *path = slot == 0 ? BOOT_A_PATH : BOOT_B_PATH; + + int ret = readlink(path, real_path, sizeof real_path); + if (ret < 0) { + ALOGE("readlink failed for boot device %s\n", strerror(errno)); + return std::string(); + } + + std::string dp(real_path); + // extract /dev/sda.. part + return dp.substr(0, sizeof "/dev/block/sdX" - 1); +} + +static bool isSlotFlagSet(uint32_t slot, uint64_t flag) { + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + ALOGI("Could not get device path for slot %d\n", slot); + return false; + } + + GptUtils gpt(dev_path); + if (gpt.Load()) { + ALOGI("failed to load gpt data\n"); + return false; + } + + gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); + if (e == nullptr) { + ALOGI("failed to get gpt entry\n"); + return false; + } + + return !!(e->attr & flag); +} + +static int setSlotFlag(uint32_t slot, uint64_t flag) { + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + ALOGI("Could not get device path for slot %d\n", slot); + return -1; + } + + GptUtils gpt(dev_path); + if (gpt.Load()) { + ALOGI("failed to load gpt data\n"); + return -1; + } + + gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); + if (e == nullptr) { + ALOGI("failed to get gpt entry\n"); + return -1; + } + + e->attr |= flag; + gpt.Sync(); + + return 0; +} + +} + +// Methods from ::android::hardware::boot::V1_0::IBootControl follow. +Return BootControl::getNumberSlots() { + uint32_t slots = 0; + + if (access(BOOT_A_PATH, F_OK) == 0) + slots++; + + if (access(BOOT_B_PATH, F_OK) == 0) + slots++; + + return slots; +} + +Return BootControl::getCurrentSlot() { + char suffix[PROPERTY_VALUE_MAX]; + property_get("ro.boot.slot_suffix", suffix, "_a"); + return std::string(suffix) == "_b" ? 1 : 0; +} + +Return BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) { + if (getNumberSlots() == 0) { + // no slots, just return true otherwise Android keeps trying + _hidl_cb({true, ""}); + return Void(); + } + int ret = setSlotFlag(getCurrentSlot(), AB_ATTR_SUCCESSFUL); + ret ? _hidl_cb({false, "Failed to set successful flag"}) : _hidl_cb({true, ""}); + return Void(); +} + +Return BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) { + if (slot >= 2) { + _hidl_cb({false, "Invalid slot"}); + return Void(); + } + + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + _hidl_cb({false, "Could not get device path for slot"}); + return Void(); + } + + GptUtils gpt(dev_path); + if (gpt.Load()) { + _hidl_cb({false, "failed to load gpt data"}); + return Void(); + } + + gpt_entry *active_entry = gpt.GetPartitionEntry(slot == 0 ? "boot_a" : "boot_b"); + gpt_entry *inactive_entry = gpt.GetPartitionEntry(slot == 0 ? "boot_b" : "boot_a"); + if (active_entry == nullptr || inactive_entry == nullptr) { + _hidl_cb({false, "failed to get entries for boot partitions"}); + return Void(); + } + + ALOGV("slot active attributes %lx\n", active_entry->attr); + ALOGV("slot inactive attributes %lx\n", inactive_entry->attr); + + char boot_dev[PROPERTY_VALUE_MAX]; + property_get("ro.boot.bootdevice", boot_dev, ""); + if (boot_dev[0] == '\0') { + _hidl_cb({false, "invalid ro.boot.bootdevice prop"}); + return Void(); + } + + 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); + 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); + if (fd < 0) { + _hidl_cb({false, "failed to open ufs attr boot_lun_enabled"}); + return Void(); + } + } + + // update attributes for active and inactive + inactive_entry->attr &= ~AB_ATTR_ACTIVE; + active_entry->attr = AB_ATTR_ACTIVE | (AB_ATTR_MAX_PRIORITY << AB_ATTR_PRIORITY_SHIFT) | + (AB_ATTR_MAX_RETRY_COUNT << AB_ATTR_RETRY_COUNT_SHIFT); + + // + // bBootLunEn + // 0x1 => Boot LU A = enabled, Boot LU B = disable + // 0x2 => Boot LU A = disable, Boot LU B = enabled + // + int ret = android::base::WriteStringToFd(slot == 0 ? "1" : "2", fd); + close(fd); + if (ret < 0) { + _hidl_cb({false, "faied to write boot_lun_enabled attribute"}); + return Void(); + } + + _hidl_cb({true, ""}); + return Void(); +} + +Return BootControl::setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) { + if (slot >= 2) { + _hidl_cb({false, "Invalid slot"}); + return Void(); + } + + std::string dev_path = getDevPath(slot); + if (dev_path.empty()) { + _hidl_cb({false, "Could not get device path for slot"}); + return Void(); + } + + GptUtils gpt(dev_path); + gpt.Load(); + + gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); + e->attr |= AB_ATTR_UNBOOTABLE; + + gpt.Sync(); + + _hidl_cb({true, ""}); + return Void(); +} + +Return<::android::hardware::boot::V1_0::BoolResult> BootControl::isSlotBootable(uint32_t slot) { + if (getNumberSlots() == 0) + return BoolResult::FALSE; + if (slot >= getNumberSlots()) + return BoolResult::INVALID_SLOT; + return isSlotFlagSet(slot, AB_ATTR_UNBOOTABLE) ? BoolResult::FALSE : BoolResult::TRUE; +} + +Return<::android::hardware::boot::V1_0::BoolResult> BootControl::isSlotMarkedSuccessful(uint32_t slot) { + if (getNumberSlots() == 0) { + // just return true so that we don't we another call trying to mark it as successful + // when there is no slots + return BoolResult::TRUE; + } + if (slot >= getNumberSlots()) + return BoolResult::INVALID_SLOT; + return isSlotFlagSet(slot, AB_ATTR_SUCCESSFUL) ? BoolResult::TRUE : BoolResult::FALSE; +} + +Return BootControl::getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) { + _hidl_cb(slot == 0 ? "_a" : slot == 1 ? "_b" : ""); + return Void(); +} + +// Methods from ::android::hardware::boot::V1_1::IBootControl follow. +bool BootControl::Init() { + return InitMiscVirtualAbMessageIfNeeded(); +} + +Return BootControl::setSnapshotMergeStatus(::android::hardware::boot::V1_1::MergeStatus status) { + return SetMiscVirtualAbMergeStatus(getCurrentSlot(), status); +} + +Return<::android::hardware::boot::V1_1::MergeStatus> BootControl::getSnapshotMergeStatus() { + MergeStatus status; + if (!GetMiscVirtualAbMergeStatus(getCurrentSlot(), &status)) { + return MergeStatus::UNKNOWN; + } + return status; +} + +// Methods from ::android::hardware::boot::V1_2::IBootControl follow. +Return BootControl::getActiveBootSlot() { + if (getNumberSlots() == 0) + return 0; + + return isSlotFlagSet(1, AB_ATTR_ACTIVE) ? 1 : 0; +} + +// Methods from ::android::hidl::base::V1_0::IBase follow. + + +IBootControl* HIDL_FETCH_IBootControl(const char* /* name */) { + auto module = new BootControl(); + + module->Init(); + + return module; +} + +} // namespace implementation +} // namespace V1_2 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.2/BootControl.h b/interfaces/boot/1.2/BootControl.h new file mode 100644 index 00000000..b6017798 --- /dev/null +++ b/interfaces/boot/1.2/BootControl.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_2 { +namespace implementation { + +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::sp; + +struct BootControl : public IBootControl { + + bool Init(); + + // Methods from ::android::hardware::boot::V1_0::IBootControl follow. + Return getNumberSlots() override; + Return getCurrentSlot() override; + Return markBootSuccessful(markBootSuccessful_cb _hidl_cb) override; + Return setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override; + Return setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override; + Return<::android::hardware::boot::V1_0::BoolResult> isSlotBootable(uint32_t slot) override; + Return<::android::hardware::boot::V1_0::BoolResult> isSlotMarkedSuccessful(uint32_t slot) override; + Return getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override; + + // Methods from ::android::hardware::boot::V1_1::IBootControl follow. + Return setSnapshotMergeStatus(::android::hardware::boot::V1_1::MergeStatus status) override; + Return<::android::hardware::boot::V1_1::MergeStatus> getSnapshotMergeStatus() override; + + // Methods from ::android::hardware::boot::V1_2::IBootControl follow. + Return getActiveBootSlot() override; + + // Methods from ::android::hidl::base::V1_0::IBase follow. + +}; + +// FIXME: most likely delete, this is only for passthrough implementations +extern "C" IBootControl* HIDL_FETCH_IBootControl(const char* name); + +} // namespace implementation +} // namespace V1_2 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.2/GptUtils.cpp b/interfaces/boot/1.2/GptUtils.cpp new file mode 100644 index 00000000..514aa89d --- /dev/null +++ b/interfaces/boot/1.2/GptUtils.cpp @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2019 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 "bootcontrolhal" + +#include "GptUtils.h" + +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_2 { +namespace implementation { + +namespace { + +static int ValidateGptHeader(gpt_header *gpt) +{ + if (gpt->signature != GPT_SIGNATURE) { + ALOGE("invalid gpt signature 0x%lx\n", gpt->signature); + return -1; + } + + if (gpt->header_size != sizeof(gpt_header)) { + ALOGE("invalid gpt header size %u\n", gpt->header_size); + return -1; + } + + if (gpt->entry_size != sizeof(gpt_entry)) { + ALOGE("invalid gpt entry size %u\n", gpt->entry_size); + return -1; + } + + return 0; +} + +} + +GptUtils::GptUtils(const std::string dev_path) : dev_path(dev_path), fd(0) {} + +int GptUtils::Load(void) +{ + fd = open(dev_path.c_str(), O_RDWR); + if (fd < 0) { + ALOGE("failed to open block dev %s, %d\n", dev_path.c_str(), errno); + return -1; + } + + int ret = ioctl(fd, BLKSSZGET, &block_size); + if (ret < 0) { + ALOGE("failed to get block size %d\n", errno); + return -1; + } + + // read primary header + lseek64(fd, block_size, SEEK_SET); + ret = read(fd, &gpt_primary, sizeof gpt_primary); + if (ret < 0) { + ALOGE("failed to read gpt primary header %d\n", errno); + return -1; + } + + if (ValidateGptHeader(&gpt_primary)) { + ALOGE("error validating gpt header\n"); + return -1; + } + + // read partition entries + entry_array.resize(gpt_primary.entry_count); + uint32_t entries_size = gpt_primary.entry_size * gpt_primary.entry_count; + lseek64(fd, block_size * gpt_primary.start_lba, SEEK_SET); + ret = read(fd, entry_array.data(), entries_size); + if (ret < 0) { + ALOGE("failed to read gpt partition entries %d\n", errno); + return -1; + } + + // read gpt back header + lseek64(fd, block_size * gpt_primary.backup_lba, SEEK_SET); + ret = read(fd, &gpt_backup, sizeof gpt_backup); + if (ret < 0) { + ALOGE("failed to read gpt backup header %d\n", errno); + return -1; + } + + if (ValidateGptHeader(&gpt_backup)) { + ALOGW("error validating gpt backup\n"); // just warn about it, not fail + } + + // Create map + auto get_name = [](const uint16_t *efi_name) { + char name[37] = {}; + for (int i = 0; efi_name[i] && i < sizeof name - 1; ++i) + name[i] = efi_name[i]; + return std::string(name); + }; + + for (auto const &e: entry_array) { + if (e.name[0] == 0) + break; // stop at the first partition with no name + std::string s = get_name(e.name); + entries[s] = const_cast(&e); + } + + return 0; +} + +gpt_entry *GptUtils::GetPartitionEntry(std::string name) +{ + return entries.find(name) != entries.end() ? entries[name] : nullptr; +} + +int GptUtils::Sync(void) +{ + if (!fd) + return -1; + + // calculate crc and check if we need to update gpt + gpt_primary.entries_crc32 = crc32(0, reinterpret_cast(entry_array.data()), + entry_array.size() * sizeof(gpt_entry)); + + // save old crc + uint32_t crc = gpt_primary.crc32; + gpt_primary.crc32 = 0; + + gpt_primary.crc32 = crc32(0, reinterpret_cast(&gpt_primary), sizeof gpt_primary); + if (crc == gpt_primary.crc32) + return 0; // nothing to do (no changes) + + ALOGI("updating GPT\n"); + + lseek64(fd, block_size * gpt_primary.current_lba, SEEK_SET); + int ret = write(fd, &gpt_primary, sizeof gpt_primary); + if (ret < 0) { + ALOGE("failed to write gpt primary header %d\n", errno); + return -1; + } + + lseek64(fd, block_size * gpt_primary.start_lba, SEEK_SET); + ret = write(fd, entry_array.data(), entry_array.size() * sizeof(gpt_entry)); + if (ret < 0) { + ALOGE("failed to write gpt partition entries %d\n", errno); + return -1; + } + + //update GPT backup entries and backup + lseek64(fd, block_size * gpt_backup.start_lba, SEEK_SET); + ret = write(fd, entry_array.data(), entry_array.size() * sizeof(gpt_entry)); + if (ret < 0) { + ALOGE("failed to write gpt backup partition entries %d\n", errno); + return -1; + } + + gpt_backup.entries_crc32 = gpt_primary.entries_crc32; + gpt_backup.crc32 = 0; + gpt_backup.crc32 = crc32(0, reinterpret_cast(&gpt_backup), sizeof gpt_backup); + lseek64(fd, block_size * gpt_primary.backup_lba, SEEK_SET); + ret = write(fd, &gpt_backup, sizeof gpt_backup); + if (ret < 0) { + ALOGE("failed to write gpt backup header %d\n", errno); + return -1; + } + + fsync(fd); + + return 0; +} + +GptUtils::~GptUtils() +{ + if (fd) { + Sync(); + close(fd); + } +} + +} // namespace implementation +} // namespace V1_2 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.2/GptUtils.h b/interfaces/boot/1.2/GptUtils.h new file mode 100644 index 00000000..8965118d --- /dev/null +++ b/interfaces/boot/1.2/GptUtils.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace android { +namespace hardware { +namespace boot { +namespace V1_2 { +namespace implementation { + +#define GPT_SIGNATURE 0x5452415020494645UL + +typedef struct { + uint8_t type_guid[16]; + uint8_t guid[16]; + uint64_t first_lba; + uint64_t last_lba; + uint64_t attr; + uint16_t name[36]; +} __attribute__((packed)) gpt_entry; + +typedef struct { + uint64_t signature; + uint32_t revision; + uint32_t header_size; + uint32_t crc32; + uint32_t reserved; + uint64_t current_lba; + uint64_t backup_lba; + uint64_t first_usable_lba; + uint64_t last_usable_lba; + uint8_t disk_guid[16]; + uint64_t start_lba; + uint32_t entry_count; + uint32_t entry_size; + uint32_t entries_crc32; +} __attribute__((packed)) gpt_header; + +class GptUtils { + public: + GptUtils(const std::string dev_path); + int Load(void); + gpt_entry *GetPartitionEntry(std::string name); + int Sync(void); + ~GptUtils(); + + private: + std::string dev_path; + int fd; + uint32_t block_size; + gpt_header gpt_primary; + gpt_header gpt_backup; + std::vector entry_array; + std::mapentries; +}; + +} // namespace implementation +} // namespace V1_2 +} // namespace boot +} // namespace hardware +} // namespace android diff --git a/interfaces/boot/1.2/android.hardware.boot@1.2-service-gs101.rc b/interfaces/boot/1.2/android.hardware.boot@1.2-service-gs101.rc new file mode 100644 index 00000000..b0b14dc3 --- /dev/null +++ b/interfaces/boot/1.2/android.hardware.boot@1.2-service-gs101.rc @@ -0,0 +1,7 @@ +service vendor.boot-hal-1-2 /vendor/bin/hw/android.hardware.boot@1.2-service-gs101 + interface android.hardware.boot@1.0::IBootControl default + interface android.hardware.boot@1.1::IBootControl default + interface android.hardware.boot@1.2::IBootControl default + class early_hal + user root + group root diff --git a/interfaces/boot/1.2/service.cpp b/interfaces/boot/1.2/service.cpp new file mode 100644 index 00000000..158c4560 --- /dev/null +++ b/interfaces/boot/1.2/service.cpp @@ -0,0 +1,49 @@ +/* + * 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. + */ + +#define LOG_TAG "android.hardware.boot@1.2-service" + +#include +#include +#include +#include +#include "BootControl.h" + +using ::android::status_t; + +using ::android::hardware::boot::V1_2::IBootControl; + +using ::android::hardware::boot::V1_2::implementation::BootControl; +//using ::android::hardware::boot::implementation::BootControl; + +int main (int /* argc */, char * /* argv */ []) { + // This function must be called before you join to ensure the proper + // number of threads are created. The threadpool will never exceed + // size one because of this call. + ::android::hardware::configureRpcThreadpool(1 /*threads*/, true /*willJoin*/); + + ::android::sp bootctrl = new BootControl(); + const status_t status = bootctrl->registerAsService(); + if (status != ::android::OK) { + return 1; // or handle error + } + + // Adds this thread to the threadpool, resulting in one total + // thread in the threadpool. We could also do other things, but + // would have to specify 'false' to willJoin in configureRpcThreadpool. + ::android::hardware::joinRpcThreadpool(); + return 1; // joinRpcThreadpool should never return +} diff --git a/keymaster/Android.bp b/keymaster/Android.bp new file mode 100644 index 00000000..99aa4b45 --- /dev/null +++ b/keymaster/Android.bp @@ -0,0 +1,40 @@ +// +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: [ + "//device/google/gs101:device_google_gs101_license", + ], +} + +cc_binary { + name: "wait_for_strongbox", + init_rc: ["wait_for_strongbox.rc"], + relative_install_path: "hw", + srcs: [ "wait_for_strongbox.cpp" ], + cflags: [ "-Werror", "-Wall" ], + shared_libs: [ + "android.hardware.keymaster@4.0", + "libbase", + "libkeymaster4_1support", + "libutils", + ], + proprietary: true, +} diff --git a/keymaster/wait_for_strongbox.cpp b/keymaster/wait_for_strongbox.cpp new file mode 100644 index 00000000..c0f4094b --- /dev/null +++ b/keymaster/wait_for_strongbox.cpp @@ -0,0 +1,59 @@ +/* + ** Copyright 2018, 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 + +#define LOG_TAG "wait_for_strongbox" +#include + +#include + +using android::hardware::keymaster::V4_1::SecurityLevel; +using android::hardware::keymaster::V4_1::support::Keymaster; + +useconds_t kWaitTimeMicroseconds = 1 * 1000; // 1 milliseconds + +int main() { + for (unsigned cycleCount = 0; /* Forever */; ++cycleCount) { + auto keymasters = Keymaster::enumerateAvailableDevices(); + + bool foundStrongBox = false; + bool foundTee = false; + for (auto &dev : keymasters) { + SecurityLevel securityLevel = dev->halVersion().securityLevel; + uint8_t majorVersion = dev->halVersion().majorVersion; + if (securityLevel == SecurityLevel::STRONGBOX && majorVersion == 4) { + foundStrongBox = true; + } + if (securityLevel == SecurityLevel::TRUSTED_ENVIRONMENT && majorVersion == 4) { + foundTee = true; + } + } + + if (foundTee && foundStrongBox) { + return 0; + } + if (cycleCount % 10 == 1) { + if (!foundStrongBox) { + LOG(WARNING) << "Still waiting for StrongBox Keymaster"; + } + if (!foundTee) { + LOG(WARNING) << "Still waiting for TEE Keymaster"; + } + } + usleep(kWaitTimeMicroseconds); + } +} diff --git a/keymaster/wait_for_strongbox.rc b/keymaster/wait_for_strongbox.rc new file mode 100644 index 00000000..c02fc465 --- /dev/null +++ b/keymaster/wait_for_strongbox.rc @@ -0,0 +1,9 @@ +# Wait for both Trusty and Strongbox HALs to be up +service wait_for_strongbox /vendor/bin/hw/wait_for_strongbox + user root + group root system + priority -20 + ioprio rt 0 + +on late-fs + exec_start wait_for_strongbox diff --git a/manifest-gralloc3.xml b/manifest-gralloc3.xml new file mode 100644 index 00000000..3142a994 --- /dev/null +++ b/manifest-gralloc3.xml @@ -0,0 +1,233 @@ + + + android.hardware.audio + hwbinder + 6.0 + + IDevicesFactory + default + + + + android.hardware.audio.effect + hwbinder + 6.0 + + IEffectsFactory + default + + + + android.hardware.soundtrigger + hwbinder + 2.3 + + ISoundTriggerHw + default + + + + android.hardware.media.omx + hwbinder + 1.0 + + IOmx + default + + + IOmxStore + default + + + + android.hardware.graphics.allocator + hwbinder + 2.0 + + IAllocator + default + + + + android.hardware.graphics.mapper + passthrough + 2.0 + + IMapper + default + + + + android.hardware.graphics.composer + hwbinder + 2.4 + + IComposer + default + + + + android.hardware.memtrack + hwbinder + 1.0 + + IMemtrack + default + + + + android.hardware.renderscript + passthrough + 1.0 + + IDevice + default + + + + android.hardware.drm + hwbinder + 1.0 + + ICryptoFactory + default + + + IDrmFactory + default + + @1.3::ICryptoFactory/clearkey + @1.3::IDrmFactory/clearkey + @1.3::ICryptoFactory/widevine + @1.3::IDrmFactory/widevine + + + android.hardware.dumpstate + hwbinder + 1.0 + + IDumpstateDevice + default + + + + android.hardware.bluetooth + hwbinder + 1.1 + + IBluetoothHci + default + + + + android.hardware.bluetooth.audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + + + android.hardware.boot + hwbinder + @1.2::IBootControl/default + + + android.hardware.sensors + hwbinder + 1.0 + + ISensors + default + + + + android.hardware.neuralnetworks + hwbinder + 1.2 + + IDevice + armnn + + @1.2::IDevice/armnn + + + android.hardware.neuralnetworks + hwbinder + @1.3::IDevice/google-edgetpu + + + android.hardware.nfc + hwbinder + 1.2 + + INfc + default + + + + android.hardware.health + hwbinder + 2.1 + + IHealth + default + + + + hardware.google.bluetooth.bt_channel_avoidance + hwbinder + 1.0 + + IBTChannelAvoidance + default + + + + hardware.google.bluetooth.sar + hwbinder + 1.1 + + IBluetoothSar + default + + + + vendor.google.google_battery + hwbinder + 1.1 + + IGoogleBattery + default + + + + vendor.google.radioext + hwbinder + 1.3 + + IRadioExt + default + + + + vendor.google.whitechapel.audio.audioext + hwbinder + 2.0 + + IAudioExt + default + + + + vendor.google.wireless_charger + hwbinder + 1.2 + + IWirelessCharger + default + + + + diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 00000000..8dd4c314 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,233 @@ + + + android.hardware.audio + hwbinder + 6.0 + + IDevicesFactory + default + + + + android.hardware.audio.effect + hwbinder + 6.0 + + IEffectsFactory + default + + + + android.hardware.soundtrigger + hwbinder + 2.3 + + ISoundTriggerHw + default + + + + android.hardware.media.omx + hwbinder + 1.0 + + IOmx + default + + + IOmxStore + default + + + + android.hardware.graphics.allocator + hwbinder + 4.0 + + IAllocator + default + + + + android.hardware.graphics.mapper + passthrough + 4.0 + + IMapper + default + + + + android.hardware.graphics.composer + hwbinder + 2.4 + + IComposer + default + + + + android.hardware.memtrack + hwbinder + 1.0 + + IMemtrack + default + + + + android.hardware.renderscript + passthrough + 1.0 + + IDevice + default + + + + android.hardware.drm + hwbinder + 1.0 + + ICryptoFactory + default + + + IDrmFactory + default + + @1.3::ICryptoFactory/clearkey + @1.3::IDrmFactory/clearkey + @1.3::ICryptoFactory/widevine + @1.3::IDrmFactory/widevine + + + android.hardware.dumpstate + hwbinder + 1.0 + + IDumpstateDevice + default + + + + android.hardware.bluetooth + hwbinder + 1.1 + + IBluetoothHci + default + + + + android.hardware.bluetooth.audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + + + android.hardware.boot + hwbinder + @1.2::IBootControl/default + + + android.hardware.sensors + hwbinder + 1.0 + + ISensors + default + + + + android.hardware.neuralnetworks + hwbinder + 1.2 + + IDevice + armnn + + @1.2::IDevice/armnn + + + android.hardware.neuralnetworks + hwbinder + @1.3::IDevice/google-edgetpu + + + android.hardware.nfc + hwbinder + 1.2 + + INfc + default + + + + android.hardware.health + hwbinder + 2.1 + + IHealth + default + + + + hardware.google.bluetooth.bt_channel_avoidance + hwbinder + 1.0 + + IBTChannelAvoidance + default + + + + hardware.google.bluetooth.sar + hwbinder + 1.1 + + IBluetoothSar + default + + + + vendor.google.google_battery + hwbinder + 1.1 + + IGoogleBattery + default + + + + vendor.google.radioext + hwbinder + 1.3 + + IRadioExt + default + + + + vendor.google.whitechapel.audio.audioext + hwbinder + 2.0 + + IAudioExt + default + + + + vendor.google.wireless_charger + hwbinder + 1.2 + + IWirelessCharger + default + + + + diff --git a/manifest_64-gralloc3.xml b/manifest_64-gralloc3.xml new file mode 100644 index 00000000..750dbc2d --- /dev/null +++ b/manifest_64-gralloc3.xml @@ -0,0 +1,222 @@ + + + android.hardware.audio + hwbinder + 6.0 + + IDevicesFactory + default + + + + android.hardware.audio.effect + hwbinder + 6.0 + + IEffectsFactory + default + + + + android.hardware.soundtrigger + hwbinder + 2.3 + + ISoundTriggerHw + default + + + + android.hardware.graphics.allocator + hwbinder + 2.0 + + IAllocator + default + + + + android.hardware.graphics.mapper + passthrough + 2.1 + + IMapper + default + + + + android.hardware.graphics.composer + hwbinder + 2.4 + + IComposer + default + + + + android.hardware.memtrack + hwbinder + 1.0 + + IMemtrack + default + + + + android.hardware.renderscript + passthrough + 1.0 + + IDevice + default + + + + android.hardware.drm + hwbinder + 1.0 + + ICryptoFactory + default + + + IDrmFactory + default + + @1.3::ICryptoFactory/clearkey + @1.3::IDrmFactory/clearkey + @1.3::ICryptoFactory/widevine + @1.3::IDrmFactory/widevine + + + android.hardware.dumpstate + hwbinder + 1.0 + + IDumpstateDevice + default + + + + android.hardware.bluetooth + hwbinder + 1.1 + + IBluetoothHci + default + + + + android.hardware.bluetooth.audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + + + android.hardware.boot + hwbinder + @1.2::IBootControl/default + + + android.hardware.sensors + hwbinder + 1.0 + + ISensors + default + + + + + android.hardware.neuralnetworks + hwbinder + @1.3::IDevice/google-edgetpu + + + android.hardware.nfc + hwbinder + 1.2 + + INfc + default + + + + android.hardware.health + hwbinder + 2.1 + + IHealth + default + + + + hardware.google.bluetooth.bt_channel_avoidance + hwbinder + 1.0 + + IBTChannelAvoidance + default + + + + hardware.google.bluetooth.sar + hwbinder + 1.1 + + IBluetoothSar + default + + + + vendor.google.google_battery + hwbinder + 1.1 + + IGoogleBattery + default + + + + vendor.google.radioext + hwbinder + 1.3 + + IRadioExt + default + + + + vendor.google.whitechapel.audio.audioext + hwbinder + 2.0 + + IAudioExt + default + + + + vendor.google.wireless_charger + hwbinder + 1.2 + + IWirelessCharger + default + + + + diff --git a/manifest_64.xml b/manifest_64.xml new file mode 100644 index 00000000..7f38648a --- /dev/null +++ b/manifest_64.xml @@ -0,0 +1,222 @@ + + + android.hardware.audio + hwbinder + 6.0 + + IDevicesFactory + default + + + + android.hardware.audio.effect + hwbinder + 6.0 + + IEffectsFactory + default + + + + android.hardware.soundtrigger + hwbinder + 2.3 + + ISoundTriggerHw + default + + + + android.hardware.graphics.allocator + hwbinder + 4.0 + + IAllocator + default + + + + android.hardware.graphics.mapper + passthrough + 4.0 + + IMapper + default + + + + android.hardware.graphics.composer + hwbinder + 2.4 + + IComposer + default + + + + android.hardware.memtrack + hwbinder + 1.0 + + IMemtrack + default + + + + android.hardware.renderscript + passthrough + 1.0 + + IDevice + default + + + + android.hardware.drm + hwbinder + 1.0 + + ICryptoFactory + default + + + IDrmFactory + default + + @1.3::ICryptoFactory/clearkey + @1.3::IDrmFactory/clearkey + @1.3::ICryptoFactory/widevine + @1.3::IDrmFactory/widevine + + + android.hardware.dumpstate + hwbinder + 1.0 + + IDumpstateDevice + default + + + + android.hardware.bluetooth + hwbinder + 1.1 + + IBluetoothHci + default + + + + android.hardware.bluetooth.audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + + + android.hardware.boot + hwbinder + @1.2::IBootControl/default + + + android.hardware.sensors + hwbinder + 1.0 + + ISensors + default + + + + + android.hardware.neuralnetworks + hwbinder + @1.3::IDevice/google-edgetpu + + + android.hardware.nfc + hwbinder + 1.2 + + INfc + default + + + + android.hardware.health + hwbinder + 2.1 + + IHealth + default + + + + hardware.google.bluetooth.bt_channel_avoidance + hwbinder + 1.0 + + IBTChannelAvoidance + default + + + + hardware.google.bluetooth.sar + hwbinder + 1.1 + + IBluetoothSar + default + + + + vendor.google.google_battery + hwbinder + 1.1 + + IGoogleBattery + default + + + + vendor.google.radioext + hwbinder + 1.3 + + IRadioExt + default + + + + vendor.google.whitechapel.audio.audioext + hwbinder + 2.0 + + IAudioExt + default + + + + vendor.google.wireless_charger + hwbinder + 1.2 + + IWirelessCharger + default + + + + diff --git a/manifest_media.xml b/manifest_media.xml new file mode 100644 index 00000000..3ed9e247 --- /dev/null +++ b/manifest_media.xml @@ -0,0 +1,12 @@ + + + android.hardware.media.c2 + hwbinder + 1.0 + + IComponentStore + default + default1 + + + diff --git a/manifest_media_aosp.xml b/manifest_media_aosp.xml new file mode 100644 index 00000000..3bc347c9 --- /dev/null +++ b/manifest_media_aosp.xml @@ -0,0 +1,11 @@ + + + android.hardware.media.c2 + hwbinder + 1.0 + + IComponentStore + default + + + diff --git a/media_codecs.xml b/media_codecs.xml new file mode 100644 index 00000000..87a42ef5 --- /dev/null +++ b/media_codecs.xml @@ -0,0 +1,82 @@ + + + + + + + + diff --git a/media_codecs_aosp_c2.xml b/media_codecs_aosp_c2.xml new file mode 100644 index 00000000..b6407019 --- /dev/null +++ b/media_codecs_aosp_c2.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media_codecs_bo_c2.xml b/media_codecs_bo_c2.xml new file mode 100644 index 00000000..a3d3fc3a --- /dev/null +++ b/media_codecs_bo_c2.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media_codecs_performance.xml b/media_codecs_performance.xml new file mode 100644 index 00000000..9cb42101 --- /dev/null +++ b/media_codecs_performance.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/media_codecs_performance_c2.xml b/media_codecs_performance_c2.xml new file mode 100644 index 00000000..a595ee4b --- /dev/null +++ b/media_codecs_performance_c2.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media_profiles.xml b/media_profiles.xml new file mode 100644 index 00000000..f31d6ec5 --- /dev/null +++ b/media_profiles.xml @@ -0,0 +1,895 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nfc/libese-hal-st.conf b/nfc/libese-hal-st.conf new file mode 100644 index 00000000..1954bf72 --- /dev/null +++ b/nfc/libese-hal-st.conf @@ -0,0 +1,6 @@ +########################### Start of libese-hal-st.conf ########################### +############################################################################### +############################################################################### +# ST HAL trace log level +STESE_HAL_LOGLEVEL=1 +ST_ESE_DEV_NODE="/dev/st54j_se" diff --git a/nfc/libnfc-hal-st-gs101.conf b/nfc/libnfc-hal-st-gs101.conf new file mode 100644 index 00000000..2b455df7 --- /dev/null +++ b/nfc/libnfc-hal-st-gs101.conf @@ -0,0 +1,152 @@ +########################### Start of libnf-hal-st_aosp.conf ########################### + +############################################################################### +############################################################################### +# ST HAL trace log level +STNFC_HAL_LOGLEVEL=4 +NFC_DEBUG_ENABLED=1 + +############################################################################### +# Vendor specific mode to enable FW (RF & SWP) traces. +STNFC_FW_DEBUG_ENABLED=0 + +############################################################################### +# File used for NFA storage +NFA_STORAGE="/data/nfc" + +############################################################################### +# Dev Node used for ST HAL +ST_NFC_DEV_NODE="/dev/st_no_such_device" + +############################################################################### +# Keep the nfa storage file. +PRESERVE_STORAGE=1 + +############################################################################### +# In Switch OFF mode (phone switched-off), specify the desired CE mode to +# the controller. +# 0: No card-emulation; DEFAULT +# 1: Switch-off card-emulation enabled +CE_ON_SWITCH_OFF_STATE=1 + +############################################################################### +# Vendor specific mode to support the USB charging mode if VPSIO=1 in switch off. +STNFC_USB_CHARGING_MODE=1 + +############################################################################### +# Vendor Specific Proprietary Protocol & Discovery Configuration +# Set to 0xFF if unsupported +# byte[0] NCI_PROTOCOL_18092_ACTIVE +# byte[1] NCI_PROTOCOL_B_PRIME +# byte[2] NCI_PROTOCOL_DUAL +# byte[3] NCI_PROTOCOL_15693 +# byte[4] NCI_PROTOCOL_KOVIO +# byte[5] NCI_PROTOCOL_MIFARE +# byte[6] NCI_DISCOVERY_TYPE_POLL_KOVIO +# byte[7] NCI_DISCOVERY_TYPE_POLL_B_PRIME +# byte[8] NCI_DISCOVERY_TYPE_LISTEN_B_PRIME +NFA_PROPRIETARY_CFG={05:FF:FF:06:8A:90:77:FF:FF} + +############################################################################### +# Choose the presence-check algorithm for type-4 tag. If not defined, +# the default value is 1. +# 0 NFA_RW_PRES_CHK_DEFAULT; Let stack selects an algorithm +# 1 NFA_RW_PRES_CHK_I_BLOCK; ISO-DEP protocol's empty I-block +# 2 NFA_RW_PRES_CHK_RESET; Deactivate to Sleep, then re-activate +# 3 NFA_RW_PRES_CHK_RB_CH0; Type-4 tag protocol's ReadBinary command on channel 0 +# 4 NFA_RW_PRES_CHK_RB_CH3; Type-4 tag protocol's ReadBinary command on channel 3 +# 5 NFA_RW_PRES_CHK_ISO_DEP_NAK; presence check command ISO-DEP NAK as per NCI2.0 +PRESENCE_CHECK_ALGORITHM=5 + +############################################################################### +# Name of the NCI HAL module to use +# If unset, falls back to nfc_nci.bcm2079x +NCI_HAL_MODULE="nfc_nci.st21nfc" + +############################################################################### +# White list to be set at startup. +DEVICE_HOST_WHITE_LIST={02:C0} + +############################################################################### +# BAIL OUT value for P2P +# Implements algorithm for NFC-DEP protocol priority over ISO-DEP protocol. +POLL_BAIL_OUT_MODE=1 + +############################################################################### +# Extended APDU length for ISO_DEP +ISO_DEP_MAX_TRANSCEIVE=0xFEFF + +############################################################################### +# Configure the NFC Extras to open and use a static pipe. If the value is +# not set or set to 0, then the default is use a dynamic pipe based on a +# destination gate (see NFA_HCI_DEFAULT_DEST_GATE). Note there is a value +# for each EE (ESE/SIM) +OFF_HOST_ESE_PIPE_ID=0x5E +OFF_HOST_SIM_PIPE_ID=0x3E + +############################################################################### +#Set the default Felica T3T System Code OffHost route Location : +#This settings will be used when application does not set this parameter +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_SYS_CODE_ROUTE=0x86 + +############################################################################### +#Set the Felica T3T System Code supported power state: +DEFAULT_SYS_CODE_PWR_STATE=0x3B + +############################################################################### +# Path and Files used for FW update binaries storage +STNFC_FW_PATH_STORAGE="/vendor/firmware" +STNFC_FW_BIN_NAME="/st54j_fw.bin" +STNFC_FW_CONF_NAME="/st54j_conf.bin" + +############################################################################### +# Default off-host route for Felica. +# This settings will be used when application does not set this parameter +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_NFCF_ROUTE=0x86 + +############################################################################### +# Configure the default off-host route. +# used for technology A and B routing +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_OFFHOST_ROUTE=0x81 + +############################################################################### +# Configure the default AID route. +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_ROUTE=0x00 + +############################################################################### +# Configure the NFCEEIDs of offhost UICC. +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +OFFHOST_ROUTE_UICC={81} + +############################################################################### +# Configure the NFCEEIDs of offhost eSEs. +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +OFFHOST_ROUTE_ESE={86} + +############################################################################### +# Configure the list of NFCEE for the ISO-DEP routing. +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_ISODEP_ROUTE=0x81 + +############################################################################### +# Core configuration settings +CORE_CONF_PROP={ 20, 02, 0a, 03, + a1, 01, 1e, + a2, 01, 19, + 80, 01, 01 +} + + diff --git a/nfc/libnfc-hal-st.conf b/nfc/libnfc-hal-st.conf new file mode 100644 index 00000000..3774dcfa --- /dev/null +++ b/nfc/libnfc-hal-st.conf @@ -0,0 +1,148 @@ +########################### Start of libnf-hal-st_aosp.conf ########################### + +############################################################################### +############################################################################### +# ST HAL trace log level +STNFC_HAL_LOGLEVEL=1 +NFC_DEBUG_ENABLED=1 + +############################################################################### +# Vendor specific mode to enable FW (RF & SWP) traces. +STNFC_FW_DEBUG_ENABLED=0 + +############################################################################### +# File used for NFA storage +NFA_STORAGE="/data/nfc" + +############################################################################### +# Keep the nfa storage file. +PRESERVE_STORAGE=1 + +############################################################################### +# In Switch OFF mode (phone switched-off), specify the desired CE mode to +# the controller. +# 0: No card-emulation; DEFAULT +# 1: Switch-off card-emulation enabled +CE_ON_SWITCH_OFF_STATE=1 + +############################################################################### +# Vendor specific mode to support the USB charging mode if VPSIO=1 in switch off. +STNFC_USB_CHARGING_MODE=1 + +############################################################################### +# Vendor Specific Proprietary Protocol & Discovery Configuration +# Set to 0xFF if unsupported +# byte[0] NCI_PROTOCOL_18092_ACTIVE +# byte[1] NCI_PROTOCOL_B_PRIME +# byte[2] NCI_PROTOCOL_DUAL +# byte[3] NCI_PROTOCOL_15693 +# byte[4] NCI_PROTOCOL_KOVIO +# byte[5] NCI_PROTOCOL_MIFARE +# byte[6] NCI_DISCOVERY_TYPE_POLL_KOVIO +# byte[7] NCI_DISCOVERY_TYPE_POLL_B_PRIME +# byte[8] NCI_DISCOVERY_TYPE_LISTEN_B_PRIME +NFA_PROPRIETARY_CFG={05:FF:FF:06:8A:90:77:FF:FF} + +############################################################################### +# Choose the presence-check algorithm for type-4 tag. If not defined, +# the default value is 1. +# 0 NFA_RW_PRES_CHK_DEFAULT; Let stack selects an algorithm +# 1 NFA_RW_PRES_CHK_I_BLOCK; ISO-DEP protocol's empty I-block +# 2 NFA_RW_PRES_CHK_RESET; Deactivate to Sleep, then re-activate +# 3 NFA_RW_PRES_CHK_RB_CH0; Type-4 tag protocol's ReadBinary command on channel 0 +# 4 NFA_RW_PRES_CHK_RB_CH3; Type-4 tag protocol's ReadBinary command on channel 3 +# 5 NFA_RW_PRES_CHK_ISO_DEP_NAK; presence check command ISO-DEP NAK as per NCI2.0 +PRESENCE_CHECK_ALGORITHM=5 + +############################################################################### +# Name of the NCI HAL module to use +# If unset, falls back to nfc_nci.bcm2079x +NCI_HAL_MODULE="nfc_nci.st21nfc" + +############################################################################### +# White list to be set at startup. +DEVICE_HOST_WHITE_LIST={02:C0} + +############################################################################### +# BAIL OUT value for P2P +# Implements algorithm for NFC-DEP protocol priority over ISO-DEP protocol. +POLL_BAIL_OUT_MODE=1 + +############################################################################### +# Extended APDU length for ISO_DEP +ISO_DEP_MAX_TRANSCEIVE=0xFEFF + +############################################################################### +# Configure the NFC Extras to open and use a static pipe. If the value is +# not set or set to 0, then the default is use a dynamic pipe based on a +# destination gate (see NFA_HCI_DEFAULT_DEST_GATE). Note there is a value +# for each EE (ESE/SIM) +OFF_HOST_ESE_PIPE_ID=0x5E +OFF_HOST_SIM_PIPE_ID=0x3E + +############################################################################### +#Set the default Felica T3T System Code OffHost route Location : +#This settings will be used when application does not set this parameter +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_SYS_CODE_ROUTE=0x86 + +############################################################################### +#Set the Felica T3T System Code supported power state: +DEFAULT_SYS_CODE_PWR_STATE=0x3B + +############################################################################### +# Path and Files used for FW update binaries storage +STNFC_FW_PATH_STORAGE="/vendor/firmware" +STNFC_FW_BIN_NAME="/st54j_fw.bin" +STNFC_FW_CONF_NAME="/st54j_conf.bin" + +############################################################################### +# Default off-host route for Felica. +# This settings will be used when application does not set this parameter +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_NFCF_ROUTE=0x86 + +############################################################################### +# Configure the default off-host route. +# used for technology A and B routing +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_OFFHOST_ROUTE=0x81 + +############################################################################### +# Configure the default AID route. +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_ROUTE=0x00 + +############################################################################### +# Configure the NFCEEIDs of offhost UICC. +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +OFFHOST_ROUTE_UICC={81} + +############################################################################### +# Configure the NFCEEIDs of offhost eSEs. +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +OFFHOST_ROUTE_ESE={86} + +############################################################################### +# Configure the list of NFCEE for the ISO-DEP routing. +# host 0x00 +# eSE 0x82 (eSE), 0x86 (eUICC/SPI-SE) +# UICC 0x81 (UICC_1), 0x85 (UICC_2) +DEFAULT_ISODEP_ROUTE=0x81 + +############################################################################### +# Core configuration settings +CORE_CONF_PROP={ 20, 02, 0a, 03, + a1, 01, 1e, + a2, 01, 19, + 80, 01, 01 +} + + diff --git a/nfc/libnfc-nci.conf b/nfc/libnfc-nci.conf new file mode 100644 index 00000000..c4751615 --- /dev/null +++ b/nfc/libnfc-nci.conf @@ -0,0 +1,108 @@ +############################################################################### +# Application options +NFC_DEBUG_ENABLED=0 + +############################################################################### +# File used for NFA storage +NFA_STORAGE="/data/nfc" + +############################################################################### +# Force UICC to only listen to the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | NFA_TECHNOLOGY_MASK_F +UICC_LISTEN_TECH_MASK=0x07 + +############################################################################### +# AID for Empty Select command +# If specified, this AID will be substituted when an Empty SELECT command is +# detected. The first byte is the length of the AID. Maximum length is 16. +AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00} + +############################################################################### +# When screen is turned off, specify the desired power state of the controller. +# 0: power-off-sleep state; DEFAULT +# 1: full-power state +# 2: screen-off card-emulation (CE4/CE3/CE1 modes are used) +SCREEN_OFF_POWER_STATE=1 + +############################################################################### +# Force tag polling for the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | +# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | +# NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_KOVIO | +# NFA_TECHNOLOGY_MASK_ACTIVE +# +# Notable bits: +# NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ +# NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */ +# NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ +# NFA_TECHNOLOGY_MASK_ISO15693 0x08 /* Proprietary Technology */ +# NFA_TECHNOLOGY_MASK_KOVIO 0x20 /* Proprietary Technology */ +# NFA_TECHNOLOGY_MASK_ACTIVE 0x40 /* NFC Technology Active */ +POLLING_TECH_MASK=0x2F + +############################################################################### +# Force P2P to only listen for the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F | +# NFA_TECHNOLOGY_MASK_ACTIVE +# +# Notable bits: +# NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ +# NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ +# NFA_TECHNOLOGY_MASK_ACTIVE 0x40 /* NFC Technology Active */ +P2P_LISTEN_TECH_MASK=0x00 + +PRESERVE_STORAGE=0x01 + +############################################################################### +# Override the stack default for NFA_EE_MAX_EE_SUPPORTED set in nfc_target.h. +# The value is set to 3 by default as it assumes we will discover 0xF2, +# 0xF3, and 0xF4. If a platform will exclude and SE, this value can be reduced +# so that the stack will not wait any longer than necessary. +# Maximum EE supported number +# NXP PN547C2 0x02 +# NXP PN65T 0x03 +# NXP PN548C2 0x02 +# NXP PN66T 0x03 +NFA_MAX_EE_SUPPORTED=0x02 + +############################################################################### +# AID_MATCHING constants +# AID_MATCHING_EXACT_ONLY 0x00 +# AID_MATCHING_EXACT_OR_PREFIX 0x01 +# AID_MATCHING_PREFIX_ONLY 0x02 +# AID_MATCHING_EXACT_OR_SUBSET_OR_PREFIX 0x03 +AID_MATCHING_MODE=0x03 + +############################################################################### +#Set the default Felica T3T System Code : +#This settings will be used when application does not set this parameter +DEFAULT_SYS_CODE={FE:FE} + +############################################################################### +# Value of NIC parameter NFCC_COFNIG_CONTROL +# 0x00 NFCC is not allowed to manage RF configuration +# 0x01 NFCC is allowed to manage RF configuration +NFCC_CONFIG_CONTROL=0x01 + +############################################################################### +#Set if the AID routing should be blocked for the power modes not supported. +NFA_AID_BLOCK_ROUTE=1 + +############################################################################### +#Set the OffHost AID supported power state: +OFFHOST_AID_ROUTE_PWR_STATE=0x3B + +############################################################################### +# Mifare Tag implementation +# 0: General implementation +# 1: Legacy implementation +LEGACY_MIFARE_READER=0 + +############################################################################### +# Nfc recovery implementation +# 0: Crash Nfc Service +# 1: Toggle Nfc state +RECOVERY_OPTION=1 diff --git a/nfc/libse-gto-hal.conf b/nfc/libse-gto-hal.conf new file mode 100644 index 00000000..f4e443df --- /dev/null +++ b/nfc/libse-gto-hal.conf @@ -0,0 +1,2 @@ +#Gemalto SPI devnode +GTO_DEV=/dev/st54spi; diff --git a/nfc/libse-gto-hal2.conf b/nfc/libse-gto-hal2.conf new file mode 100644 index 00000000..13ecd545 --- /dev/null +++ b/nfc/libse-gto-hal2.conf @@ -0,0 +1,2 @@ +#Gemalto SPI devnode +GTO_DEV=/dev/st33spi; diff --git a/nfc/manifest_se_gs101.xml b/nfc/manifest_se_gs101.xml new file mode 100644 index 00000000..7d7afcfe --- /dev/null +++ b/nfc/manifest_se_gs101.xml @@ -0,0 +1,8 @@ + + + android.hardware.secure_element + hwbinder + @1.2::ISecureElement/eSE1 + @1.2::ISecureElement/eSE2 + + diff --git a/overlay-factory/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay-factory/frameworks/base/packages/SettingsProvider/res/values/defaults.xml new file mode 100644 index 00000000..3f3258f5 --- /dev/null +++ b/overlay-factory/frameworks/base/packages/SettingsProvider/res/values/defaults.xml @@ -0,0 +1,23 @@ + + + + + false + + diff --git a/overlay-factory/vendor/google/apps/PixelLogger/res/values/arrays.xml b/overlay-factory/vendor/google/apps/PixelLogger/res/values/arrays.xml new file mode 100644 index 00000000..20a83653 --- /dev/null +++ b/overlay-factory/vendor/google/apps/PixelLogger/res/values/arrays.xml @@ -0,0 +1,7 @@ + + + shannondm + cnss_diag + brcm_gps + + diff --git a/overlay-factory/vendor/google/apps/PixelLogger/res/values/config.xml b/overlay-factory/vendor/google/apps/PixelLogger/res/values/config.xml new file mode 100644 index 00000000..ee2e1e81 --- /dev/null +++ b/overlay-factory/vendor/google/apps/PixelLogger/res/values/config.xml @@ -0,0 +1,10 @@ + + + shannondm + Built-in Mask #1 + + + cnss_diag.conf + + true + diff --git a/overlay-factory/vendor/google/apps/PixelLogger/res/values/configmessages.xml b/overlay-factory/vendor/google/apps/PixelLogger/res/values/configmessages.xml new file mode 100644 index 00000000..578cfc57 --- /dev/null +++ b/overlay-factory/vendor/google/apps/PixelLogger/res/values/configmessages.xml @@ -0,0 +1,19 @@ + + + + + + + This will collect audio from your voice calls. Would you like to proceed? + + + This may collect audio from your voice calls. Would you like to proceed? + Pixel_Default.nprf + Built-in Mask #0 + Built-in Mask #1 + Built-in Mask #2 + Built-in Mask #3 + + Privacy Warning + You are loading a user defined logging config. This may collect audio from your voice calls. Would you like to proceed? + diff --git a/overlay-vendor/vendor/google/apps/ModemService/res/values/config.xml b/overlay-vendor/vendor/google/apps/ModemService/res/values/config.xml new file mode 100644 index 00000000..7266f917 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/ModemService/res/values/config.xml @@ -0,0 +1,21 @@ + + + + false + 1 + 0 + + + 0 + 3 + + + false + + + + 3 + 4 + diff --git a/overlay-vendor/vendor/google/apps/PixelLogger/res/values/arrays.xml b/overlay-vendor/vendor/google/apps/PixelLogger/res/values/arrays.xml new file mode 100644 index 00000000..79f0587f --- /dev/null +++ b/overlay-vendor/vendor/google/apps/PixelLogger/res/values/arrays.xml @@ -0,0 +1,6 @@ + + + qxdm + cnss_diag + + diff --git a/overlay-vendor/vendor/google/apps/PixelLogger/res/values/config.xml b/overlay-vendor/vendor/google/apps/PixelLogger/res/values/config.xml new file mode 100644 index 00000000..80c0abe6 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/PixelLogger/res/values/config.xml @@ -0,0 +1,5 @@ + + + + cnss_diag.conf + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable-ldrtl/deferred_setup_closing_img.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable-ldrtl/deferred_setup_closing_img.xml new file mode 100644 index 00000000..983fc647 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable-ldrtl/deferred_setup_closing_img.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable-nodpi/placeholder.png b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable-nodpi/placeholder.png new file mode 100644 index 00000000..ec4f14d1 Binary files /dev/null and b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable-nodpi/placeholder.png differ diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/deferred_setup_closing_img.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/deferred_setup_closing_img.xml new file mode 100644 index 00000000..284de8ae --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/deferred_setup_closing_img.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/deferred_setup_welcome_img.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/deferred_setup_welcome_img.xml new file mode 100644 index 00000000..c2b0ba13 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/deferred_setup_welcome_img.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_deferred_setup_icon.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_deferred_setup_icon.xml new file mode 100644 index 00000000..990ed484 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_deferred_setup_icon.xml @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_language.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_language.xml new file mode 100644 index 00000000..6cc9a729 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_language.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_logo_googleg.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_logo_googleg.xml new file mode 100644 index 00000000..36454fa7 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_logo_googleg.xml @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_network_signal.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_network_signal.xml new file mode 100644 index 00000000..73bbac11 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/drawable/ic_network_signal.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/esim_intro_activity.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/esim_intro_activity.xml new file mode 100644 index 00000000..f35062b3 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/esim_intro_activity.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/items_esim.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/items_esim.xml new file mode 100644 index 00000000..1d60d9d1 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/items_esim.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/sim_missing_activity.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/sim_missing_activity.xml new file mode 100644 index 00000000..18d74477 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/sim_missing_activity.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/welcome_activity.xml b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/welcome_activity.xml new file mode 100644 index 00000000..060b38f8 --- /dev/null +++ b/overlay-vendor/vendor/google/apps/SetupWizard/res/layout/welcome_activity.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +