From: Nolen Johnson Date: Thu, 17 Jun 2021 04:41:55 +0000 (-0400) Subject: g12: Initial Commit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=11fc4c85b2e6118be6b3b75738b2d51ef59cb6a9;p=GitHub%2FLineageOS%2FG12%2Fandroid_device_amlogic_g12-common.git g12: Initial Commit Change-Id: I332674f5c2bb24c4a189690c0d7f60342eb22c2f --- 11fc4c85b2e6118be6b3b75738b2d51ef59cb6a9 diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..0058594 --- /dev/null +++ b/Android.bp @@ -0,0 +1,7 @@ +// +// Copyright (C) 2021 The LineageOS Project +// +// SPDX-License-Identifier: Apache-2.0 +// + +soong_namespace {} diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..af44c00 --- /dev/null +++ b/Android.mk @@ -0,0 +1,12 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +ifneq ($(filter g12a g12b sm1,$(TARGET_AMLOGIC_SOC)),) + +LOCAL_PATH := $(call my-dir) +include $(call all-makefiles-under,$(LOCAL_PATH)) + +endif diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk new file mode 100644 index 0000000..425dd37 --- /dev/null +++ b/BoardConfigCommon.mk @@ -0,0 +1,115 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +include vendor/amlogic/g12-common/BoardConfigVendor.mk + +COMMON_PATH := device/amlogic/g12-common + +## Android Verified Boot +BOARD_AVB_ALGORITHM := SHA256_RSA2048 +BOARD_AVB_ENABLE := true +BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA2048 +BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem +BOARD_AVB_RECOVERY_ROLLBACK_INDEX := 0 +BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 2 +BOARD_AVB_ROLLBACK_INDEX := 0 +BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3 + +## Architecture +TARGET_ARCH := arm +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +TARGET_CPU_VARIANT := cortex-a53.a57 +TARGET_KERNEL_ARCH := arm64 + +## Audio +BOARD_USES_ALSA_AUDIO := true +USE_CUSTOM_AUDIO_POLICY := 1 + +## Dex Pre-Opt +WITH_DEXPREOPT_DEBUG_INFO := false + +## Display +TARGET_SCREEN_DENSITY := 320 + +## HIDL +DEVICE_MANIFEST_FILE := $(COMMON_PATH)/manifest.xml +DEVICE_MATRIX_FILE := $(COMMON_PATH)/compatibility_matrix.xml + +## Kernel +BOARD_BOOTIMG_HEADER_VERSION := 2 +BOARD_KERNEL_BASE := 0x00000000 +BOARD_KERNEL_CMDLINE := androidboot.dynamic_partitions=true androidboot.dtbo_idx=0 androidboot.boot_devices=ffe07000.emmc otg_device=1 +BOARD_KERNEL_IMAGE_NAME := Image.gz +BOARD_KERNEL_PAGESIZE := 2048 +BOARD_KERNEL_SEPARATED_DTBO := true +TARGET_KERNEL_CLANG_COMPILE := true +TARGET_KERNEL_CONFIG := g12a_defconfig +TARGET_KERNEL_SOURCE := kernel/amlogic/linux-4.9 +TARGET_USES_64_BIT_BINDER := true + +## LMKD +TARGET_LMKD_STATS_LOG := true + +## Metadata +BOARD_USES_METADATA_PARTITION := true + +## Partitions +# Dynamic +BOARD_AMLOGIC_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor +BOARD_AMLOGIC_DYNAMIC_PARTITIONS_SIZE := 1673527296 # (BOARD_SUPER_PARTITION_SIZE - "Reasonable Overhead of 4 MiB" 4194304) +BOARD_SUPER_PARTITION_GROUPS := amlogic_dynamic_partitions + +# Sizes +BOARD_BOOTIMAGE_PARTITION_SIZE := 16777216 +BOARD_CACHEIMAGE_PARTITION_SIZE := 838860800 +BOARD_DTBOIMG_PARTITION_SIZE := 2097152 +BOARD_FLASH_BLOCK_SIZE := 131072 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 4896849920 +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 25165824 +BOARD_SUPER_PARTITION_SIZE := 1677721600 + +# TARGET_COPY_OUT_$PARTITION +TARGET_COPY_OUT_ODM := odm +TARGET_COPY_OUT_PRODUCT := product +TARGET_COPY_OUT_SYSTEM_EXT := system_ext +TARGET_COPY_OUT_VENDOR := vendor + +# Types +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 +TARGET_USERIMAGES_USE_EXT4 := true + +## Platform +TARGET_BOARD_PLATFORM := amlogic + +## Properties +TARGET_PRODUCT_PROP += $(COMMON_PATH)/product.prop +TARGET_VENDOR_PROP += $(COMMON_PATH)/vendor.prop + +## Soong Namespace +PRODUCT_SOONG_NAMESPACES += $(COMMON_PATH) + +## Treble +BOARD_VNDK_VERSION := current +PRODUCT_FULL_TREBLE_OVERRIDE := true + +## Recovery +TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/init-files/fstab.amlogic +TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888" + +## Vendor SPL +VENDOR_SECURITY_PATCH := 2020-10-05 + +## Wi-Fi +BOARD_HOSTAPD_DRIVER := NL80211 +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +WPA_SUPPLICANT_VERSION := VER_0_8_X diff --git a/audio/audio_effects.xml b/audio/audio_effects.xml new file mode 100644 index 0000000..8bb2603 --- /dev/null +++ b/audio/audio_effects.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml new file mode 100644 index 0000000..a9f3240 --- /dev/null +++ b/audio/audio_policy_configuration.xml @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + Speaker + Built-In Mic + Built-In Back Mic + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/audio_policy_configuration_dolby_ms12.xml b/audio/audio_policy_configuration_dolby_ms12.xml new file mode 100644 index 0000000..80f2b39 --- /dev/null +++ b/audio/audio_policy_configuration_dolby_ms12.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + Speaker + Built-In Mic + Built-In Back Mic + Tuner + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/mixer_paths.xml b/audio/mixer_paths.xml new file mode 100644 index 0000000..ff22845 --- /dev/null +++ b/audio/mixer_paths.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml new file mode 100644 index 0000000..ca7f55a --- /dev/null +++ b/compatibility_matrix.xml @@ -0,0 +1,10 @@ + + + android.hidl.manager + 1.0 + + IServiceManager + default + + + diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..d591b8e --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +ONLY_COMMON= +ONLY_TARGET= +KANG= +SECTION= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + --only-common ) + ONLY_COMMON=true + ;; + --only-target ) + ONLY_TARGET=true + ;; + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +function blob_fixup() { + case "${1}" in + vendor/lib/libmeson_display_adapter_remote.so) + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + "${PATCHELF}" --remove-needed "libhwbinder.so" "${2}" + ;; + vendor/lib/libmeson_display_service.so) + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + "${PATCHELF}" --remove-needed "libhwbinder.so" "${2}" + ;; + vendor/lib/hw/android.hardware.graphics.mapper@3.0-impl-arm.so) + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + ;; + vendor/lib/hw/android.hardware.graphics.allocator@3.0-impl-arm.so) + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + ;; + vendor/bin/hw/android.hardware.graphics.allocator@3.0-service) + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + ;; + esac + } + +if [ -z "${ONLY_TARGET}" ]; then + # Initialize the helper for common device + setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" + + extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" +fi + +if [ -z "${ONLY_COMMON}" ] && [ -s "${MY_DIR}/../../${VENDOR_DEVICE}/${DEVICE}/proprietary-files.txt" ]; then + # Reinitialize the helper for device + source "${MY_DIR}/../../${VENDOR_DEVICE}/${DEVICE}/extract-files.sh" + setup_vendor "${DEVICE}" "${VENDOR_DEVICE}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" + + extract "${MY_DIR}/../../${VENDOR_DEVICE}/${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" +fi + +"${MY_DIR}/setup-makefiles.sh" diff --git a/g12.mk b/g12.mk new file mode 100644 index 0000000..252a267 --- /dev/null +++ b/g12.mk @@ -0,0 +1,190 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +$(call inherit-product, vendor/amlogic/g12-common/g12-common-vendor.mk) + +COMMON_PATH := device/amlogic/g12-common + +## AAPT +PRODUCT_AAPT_PREF_CONFIG := tvdpi + +## Audio +PRODUCT_COPY_FILES += \ + $(COMMON_PATH)/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ + $(COMMON_PATH)/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + $(COMMON_PATH)/audio/audio_policy_configuration_dolby_ms12.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_dolby_ms12.xml \ + $(COMMON_PATH)/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml \ + 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/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ + frameworks/av/services/audiopolicy/config/hearing_aid_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/hearing_aid_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/msd_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/msd_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/surround_sound_configuration_5_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/surround_sound_configuration_5_0.xml \ + frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml + +PRODUCT_PACKAGES += \ + android.hardware.audio@2.0-service \ + android.hardware.audio@5.0-impl \ + android.hardware.audio.effect@5.0-impl \ + android.hardware.soundtrigger@2.2-impl \ + audio.a2dp.default \ + audio.bluetooth.default \ + audio.hearing_aid.default \ + audio.r_submix.default \ + audio.usb.default + +## Bluetooth +PRODUCT_PACKAGES += \ + android.hardware.bluetooth@1.0-impl \ + android.hardware.bluetooth@1.0-service \ + android.hardware.bluetooth.audio@2.0-impl + +## Boot animation +TARGET_SCREEN_HEIGHT := 1080 +TARGET_SCREEN_WIDTH := 1920 + +## Camera +PRODUCT_PACKAGES += \ + android.hardware.camera.provider@2.4-legacy \ + android.hardware.camera.provider@2.5-legacy \ + camera.device@1.0-impl \ + camera.device@3.2-impl \ + camera.device@3.3-impl \ + camera.device@3.4-impl \ + camera.device@3.5-impl + +## Characteristics +PRODUCT_CHARACTERISTICS := tv +PRODUCT_IS_ATV := true + +## Codecs +PRODUCT_COPY_FILES += \ + $(COMMON_PATH)/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ + $(COMMON_PATH)/media/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \ + $(COMMON_PATH)/media/media_codecs_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_profiles.xml \ + $(COMMON_PATH)/media/media_codecs_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_profiles_V1_0.xml \ + $(COMMON_PATH)/media/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles.xml \ + $(COMMON_PATH)/media/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml + +## DRM +PRODUCT_PACKAGES += \ + android.hardware.drm@1.0-impl \ + android.hardware.drm@1.0-service \ + android.hardware.drm@1.3-service.clearkey + +## fastbootd +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.fastbootd.available=true +PRODUCT_PACKAGES += fastbootd + +## File-system permissions +PRODUCT_PACKAGES += \ + fs_config_dirs \ + fs_config_files + +## Gatekeeper +PRODUCT_PACKAGES += \ + android.hardware.gatekeeper@1.0-service.software + +## Hardware Compsoer +PRODUCT_PACKAGES += \ + libhwc2on1adapter \ + libhwc2onfbadapter + +## HDMI CEC +PRODUCT_PACKAGES += \ + android.hardware.tv.cec@1.0-impl \ + android.hardware.tv.cec@1.0-service + +## Health +PRODUCT_PACKAGES += \ + android.hardware.health@2.0-service + +# Init-Files +PRODUCT_COPY_FILES += \ + $(COMMON_PATH)/init-files/fstab.amlogic:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.amlogic \ + $(COMMON_PATH)/init-files/init.amlogic.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.rc \ + $(COMMON_PATH)/init-files/init.amlogic.board.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.board.rc \ + $(COMMON_PATH)/init-files/init.amlogic.media.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.media.rc \ + $(COMMON_PATH)/init-files/init.amlogic.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.usb.rc \ + $(COMMON_PATH)/init-files/init.amlogic.wifi.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.wifi.rc \ + $(COMMON_PATH)/init-files/init.amlogic.wifi_buildin.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.wifi_buildin.rc \ + $(COMMON_PATH)/init-files/init.recovery.amlogic.rc:recovery/root/init.recovery.amlogic.rc \ + $(COMMON_PATH)/init-files/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc + +## Keymaster +PRODUCT_PACKAGES += \ + libkeymaster4.vendor \ + libkeymaster4support.vendor \ + libkeymaster_messages.vendor \ + libkeymaster_portable.vendor \ + libpuresoftkeymasterdevice.vendor \ + libsoft_attestation_cert.vendor + +## Memtrack +PRODUCT_PACKAGES += \ + android.hardware.memtrack@1.0-impl \ + android.hardware.memtrack@1.0-service + +## Overlays +DEVICE_PACKAGE_OVERLAYS += \ + $(COMMON_PATH)/overlay +PRODUCT_ENFORCE_RRO_TARGETS := * + +## Partitions +BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true +BUILDING_SUPER_EMPTY_IMAGE := true +PRODUCT_BUILD_SUPER_PARTITION := true +PRODUCT_USE_DYNAMIC_PARTITIONS := true + +## Permissions +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 \ + frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \ + frameworks/native/data/etc/android.hardware.gamepad.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.gamepad.xml \ + frameworks/native/data/etc/android.hardware.hdmi.cec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.hdmi.cec.xml \ + frameworks/native/data/etc/android.hardware.location.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.xml \ + 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.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.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.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.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.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.software.app_widgets.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.app_widgets.xml \ + frameworks/native/data/etc/android.software.backup.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.backup.xml \ + frameworks/native/data/etc/android.software.cts.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.cts.xml \ + frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml \ + frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \ + frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \ + frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml \ + frameworks/native/data/etc/android.software.vulkan.deqp.level-2019-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level-2019-03-01.xml.xml \ + frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml + +## Platform +TARGET_AMLOGIC_SOC ?= g12a + +## Power +PRODUCT_PACKAGES += \ + android.hardware.power@1.0-impl \ + android.hardware.power@1.0-service + +## Shipping API +PRODUCT_SHIPPING_API_LEVEL := 29 + +## Trust HAL +PRODUCT_PACKAGES += \ + vendor.lineage.trust@1.0-service + +## Wi-Fi +PRODUCT_PACKAGES += \ + android.hardware.wifi@1.0-service \ + hostapd \ + libwpa_client \ + wpa_supplicant \ + wpa_supplicant.conf diff --git a/init-files/fstab.amlogic b/init-files/fstab.amlogic new file mode 100644 index 0000000..dc822dd --- /dev/null +++ b/init-files/fstab.amlogic @@ -0,0 +1,17 @@ +# 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/misc /misc emmc defaults defaults +/dev/block/data /data ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,fileencryption=aes-256-xts,quota,formattable,reservedsize=32M +/dev/block/cache /cache ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,formattable +/dev/block/metadata /metadata ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,formattable,first_stage_mount +/devices/*.sd*/mmc_host/sd* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata +/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sd* auto auto defaults voldmanaged=usb:auto,encryptable=userdata +/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sr* auto auto defaults voldmanaged=sr0:auto,encryptable=userdata +/dev/block/loop auto loop defaults voldmanaged=loop:auto +/dev/block/param /mnt/vendor/param ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,quota,formattable +# Add for zram. zramsize can be in numeric (byte) , in percent +/dev/block/zram0 none swap defaults wait,zramsize=268435456 +/dev/block/tee /mnt/vendor/tee ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,formattable diff --git a/init-files/init.amlogic.board.rc b/init-files/init.amlogic.board.rc new file mode 100644 index 0000000..abb3f74 --- /dev/null +++ b/init-files/init.amlogic.board.rc @@ -0,0 +1,27 @@ +import /vendor/etc/init/hw/init.amlogic.usb.rc +import /vendor/etc/init/hw/init.amlogic.tb_detect.rc + +on early-init + loglevel 3 + +on init + +on post-fs-data + insmod /vendor/lib/modules/mali.ko + insmod /vendor/lib/modules/dovi.ko + insmod /vendor/lib/sl_hdr.ko + insmod /vendor/lib/modules/atbm8881_fe.ko + insmod /vendor/lib/modules/aml_hardware_dmx.ko + +on boot + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive + write /proc/sys/net/core/rmem_max 12582912 + write /proc/sys/net/core/wmem_max 12582912 + write /proc/sys/net/core/rmem_default 2097152 + write /proc/sys/net/core/wmem_default 2097152 + write /sys/module/amvdec_mh264/parameters/reorder_dpb_size_margin 9 + write /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin 9 + write /sys/module/amvdec_vp9/parameters/max_buf_num 12 + +on property:ro.boot.oem.key1=* + setprop ro.oem.key1 ${ro.boot.oem.key1} diff --git a/init-files/init.amlogic.media.rc b/init-files/init.amlogic.media.rc new file mode 100644 index 0000000..cae9e76 --- /dev/null +++ b/init-files/init.amlogic.media.rc @@ -0,0 +1,42 @@ +on boot + chmod 666 /sys/class/vdec/poweron_clock_level + chmod 666 /sys/class/codec_mm/tvp_enable + chown mediacodec mediadrm /sys/class/codec_mm/tvp_enable + chown mediacodec system /sys/class/codec_mm/config + chown mediacodec system /sys/class/codec_mm/fastplay_enable + chown media system /sys/module/amvdec_mpeg12/parameters/dec_control + chown media system /sys/module/amvideo/parameters/smooth_sync_enable + + write /sys/module/stream_input/parameters/def_vstreambuf_sizeM 10 + write /sys/module/stream_input/parameters/def_4k_vstreambuf_sizeM 15 + write /sys/devices/platform/ffe40000.bifrost/dvfs_period 50 + +on fs + insmod /vendor/lib/modules/media_clock.ko + write /sys/module/firmware_class/parameters/path "/vendor/lib/firmware/" + insmod /vendor/lib/modules/firmware.ko + insmod /vendor/lib/modules/video_framerate_adapter.ko + insmod /vendor/lib/modules/decoder_common.ko + insmod /vendor/lib/modules/stream_input.ko + insmod /vendor/lib/modules/amvdec_avs.ko + insmod /vendor/lib/modules/amvdec_h264.ko + insmod /vendor/lib/modules/amvdec_mh264.ko + insmod /vendor/lib/modules/amvdec_h264mvc.ko + insmod /vendor/lib/modules/amvdec_h265.ko + insmod /vendor/lib/modules/amvdec_mjpeg.ko + insmod /vendor/lib/modules/amvdec_mmjpeg.ko + insmod /vendor/lib/modules/amvdec_mpeg12.ko + insmod /vendor/lib/modules/amvdec_mmpeg12.ko + insmod /vendor/lib/modules/amvdec_mpeg4.ko + insmod /vendor/lib/modules/amvdec_mmpeg4.ko + insmod /vendor/lib/modules/amvdec_real.ko + insmod /vendor/lib/modules/amvdec_vc1.ko + insmod /vendor/lib/modules/amvdec_vp9.ko + insmod /vendor/lib/modules/amvdec_avs2.ko + insmod /vendor/lib/modules/encoder.ko + insmod /vendor/lib/modules/vpu.ko + insmod /vendor/lib/modules/amvdec_ports.ko + insmod /vendor/lib/modules/amlogic_fbc_lib.ko + insmod /vendor/lib/modules/amvdec_mavs.ko + insmod /vendor/lib/modules/amvdec_av1.ko + diff --git a/init-files/init.amlogic.rc b/init-files/init.amlogic.rc new file mode 100644 index 0000000..af11b56 --- /dev/null +++ b/init-files/init.amlogic.rc @@ -0,0 +1,120 @@ +import /vendor/etc/init/hw/init.amlogic.usb.rc +import /vendor/etc/init/hw/init.amlogic.board.rc +import /vendor/etc/init/hw/init.amlogic.wifi.rc +import /vendor/etc/init/hw/init.amlogic.media.rc +import /vendor/etc/init/hw/init.amlogic.wifi_buildin.rc +import /vendor/etc/init/cppreopts_amlogic.rc + +on early-init + mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755 + mount proc proc /proc remount hidepid=2,gid=3009 + +on init + # Support legacy paths + symlink /sdcard /mnt/sdcard + start console + #30 means reserve 3% memory using for high water mark, 1GB DDR x 3% = 30MB + write /proc/sys/vm/watermark_scale_factor 30 + #12288KB + write /proc/sys/vm/min_free_kbytes 12288 + + #init the unifykeys + write /sys/class/unifykeys/attach 1 + chmod 666 /dev/video_composer.0 + chmod 666 /dev/video_composer.1 +on boot + chown system graphics /sys/module/fb/parameters/osd_logo_index + chmod 0660 /sys/module/fb/parameters/osd_logo_index + + chmod 0666 /sys/class/tsync_pcr/tsync_vpts_adjust + chmod 0666 /sys/class/amstream/reset_audio_port + + # HDMI/LCD switch + chown media system /sys/class/switch/hdmi/state + chmod 0660 /sys/class/switch/hdmi/state + chown media system /sys/devices/virtual/switch/hdmi/state + chmod 0660 /sys/devices/virtual/switch/hdmi/state + chmod 666 /dev/v4lvideo + # thermal + chown system system /sys/class/thermal/thermal_zone0/mode + chown system system /sys/class/thermal/thermal_zone1/mode + chmod 664 /sys/class/thermal/thermal_zone0/mode + chmod 664 /sys/class/thermal/thermal_zone1/mode + + #power + chmod 664 /sys/power/early_suspend_trigger + chown root system /sys/power/early_suspend_trigger + + #vfm map + chown media system /sys/class/vfm/map + chmod 666 /sys/class/vfm/map + write /sys/class/vfm/map "rm default" + write /sys/class/vfm/map "add default decoder ppmgr deinterlace amvideo" + + #0: normal user and root user can read + #1: only root user can read + write /proc/sys/kernel/dmesg_restrict 0 + + +service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/sdcard1 /storage/sdcard1 + class late_start + disabled + +service fuse_udisk0 /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/udisk0 /storage/udisk0 + class late_start + disabled + +service fuse_udisk1 /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/udisk1 /storage/udisk1 + class late_start + disabled + +service fuse_sr0 /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/sr0 /storage/sr0 + class late_start + disabled + +service fuse_loop /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/loop /storage/loop + class late_start + disabled + +# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin +#service watchdogd /sbin/watchdogd 10 20 +# class core +# disabled +# seclabel u:r:watchdogd:s0 + +service remotecfg /vendor/bin/remotecfg /vendor/etc/remote.conf + class main + oneshot + seclabel u:r:remotecfg:s0 + +service hdcp_tx22 /vendor/bin/hdcp_tx22 \ + -f /odm/etc/firmware/firmware.le + class main + disabled + oneshot + +#service hdcp_rx22 /vendor/bin/hdcp_rx22 \ +# -f /mnt/vendor/param/firmware.le +# class main +# disabled +# oneshot +# seclabel u:r:hdcp_rx22:s0 + +service factoryreset /vendor/bin/factoryreset.sh + class main + user root + group root + disabled + oneshot + seclabel u:r:install_recovery:s0 + +service bugreport /system/bin/dumpstate -d -p -B -z \ + -o /data/user_de/0/com.android.shell/files/bugreports/bugreport + class main + disabled + oneshot + +on property:sys.boot_completed=1 + # Enable ZRAM on boot_complete + swapon_all /vendor/etc/fstab.amlogic + start factoryreset diff --git a/init-files/init.amlogic.usb.rc b/init-files/init.amlogic.usb.rc new file mode 100644 index 0000000..7db1312 --- /dev/null +++ b/init-files/init.amlogic.usb.rc @@ -0,0 +1,47 @@ +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +on early-boot + mount configfs none /config + mkdir /config/usb_gadget/g1 0770 + mkdir /config/usb_gadget/g1/strings/0x409 0770 + write /config/usb_gadget/g1/bcdUSB 0x0200 + write /config/usb_gadget/g1/idVendor 0x18d1 + write /config/usb_gadget/g1/bcdDevice 0x0440 + 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} + mkdir /config/usb_gadget/g1/functions/mass_storage.0 + mkdir /config/usb_gadget/g1/functions/accessory.gs2 + mkdir /config/usb_gadget/g1/functions/audio_source.gs3 + mkdir /config/usb_gadget/g1/functions/midi.gs5 + mkdir /config/usb_gadget/g1/functions/ffs.adb + mkdir /config/usb_gadget/g1/functions/ffs.mtp + mkdir /config/usb_gadget/g1/functions/ffs.ptp + mkdir /config/usb_gadget/g1/functions/diag.diag + mkdir /config/usb_gadget/g1/functions/cser.dun.0 + mkdir /config/usb_gadget/g1/functions/cser.nmea.1 + mkdir /config/usb_gadget/g1/functions/gsi.rmnet + mkdir /config/usb_gadget/g1/functions/rndis.gsi + mkdir /config/usb_gadget/g1/functions/qdss.qdss + mkdir /config/usb_gadget/g1/configs/b.1 0770 + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 + write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 + write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" + mkdir /dev/usb-ffs 0775 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mount functionfs adb /dev/usb-ffs/adb rmode=0770,fmode=0660,uid=2000,gid=2000,no_disconnect=1 + mkdir /dev/usb-ffs/mtp 0770 mtp mtp + mkdir /dev/usb-ffs/ptp 0770 mtp mtp + 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 + setprop sys.usb.controller ${vendor.usb.controller} + write /sys/module/libcomposite/parameters/disable_l1_for_hs "y" + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 + write /config/usb_gadget/g1/functions/gsi.rndis/rndis_wceis 1 + +on boot + setprop sys.usb.configfs 2 diff --git a/init-files/init.amlogic.wifi.rc b/init-files/init.amlogic.wifi.rc new file mode 100644 index 0000000..2cff02e --- /dev/null +++ b/init-files/init.amlogic.wifi.rc @@ -0,0 +1,19 @@ +on fs +service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ + -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -dd \ + -g@android:wpa_wlan0 + + interface android.hardware.wifi.supplicant@1.0::ISupplicant default + interface android.hardware.wifi.supplicant@1.1::ISupplicant default + interface android.hardware.wifi.supplicant@1.2::ISupplicant default + interface android.hardware.wifi.supplicant@1.3::ISupplicant default + + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + +service bcmdl /vendor/xbin/bcmdl -n /vendor/etc/wifi/43569/nvram_ap6269a2.nvm /vendor/etc/wifi/43569/fw_bcm43569a2_ag.bin.trx + class main + oneshot + disabled diff --git a/init-files/init.amlogic.wifi_buildin.rc b/init-files/init.amlogic.wifi_buildin.rc new file mode 100644 index 0000000..7979822 --- /dev/null +++ b/init-files/init.amlogic.wifi_buildin.rc @@ -0,0 +1,6 @@ +on boot + insmod /vendor/lib/modules/dhd.ko firmware_path=/vendor/etc/wifi/buildin/ nvram_path=/vendor/etc/wifi/buildin/ + chown root wifi /sys/module/dhd/parameters/firmware_path + chown root wifi /sys/module/bcmdhd/parameters/firmware_path + chmod 664 /sys/module/bcmdhd/parameters/firmware_path + chmod 664 /sys/module/dhd/parameters/firmware_path diff --git a/init-files/init.recovery.amlogic.rc b/init-files/init.recovery.amlogic.rc new file mode 100644 index 0000000..14af9b1 --- /dev/null +++ b/init-files/init.recovery.amlogic.rc @@ -0,0 +1,347 @@ +on early-init + insmod /boot/dwc3.ko + +on init + chmod 0777 /sbin/systemcontrol_static + chmod 0777 /sbin/remotecfg + +on fs + +on post-fs-data + chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file + chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file + chown system system /sys/class/android_usb/android0/f_rndis/ethaddr + chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr + +on boot + mkdir /udisk + mkdir /dev/usb-ffs 0770 system system + mkdir /dev/usb-ffs/adb 0770 system system + mkdir /dev/usb-ffs/fastboot 0770 system system + mount configfs none /config + mkdir /config/usb_gadget/g1 0770 system system + write /config/usb_gadget/g1/idVendor 0x18d1 + write /config/usb_gadget/g1/bcdDevice 0x0223 + write /config/usb_gadget/g1/bcdUSB 0x0200 + mkdir /config/usb_gadget/g1/strings/0x409 0770 + write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} + write /config/usb_gadget/g1/strings/0x409/manufacturer droidlogic + write /config/usb_gadget/g1/strings/0x409/product deadpool + mkdir /config/usb_gadget/g1/functions/ffs.adb + mkdir /config/usb_gadget/g1/functions/ffs.fastboot + mkdir /config/usb_gadget/g1/functions/mtp.gs0 + mkdir /config/usb_gadget/g1/configs/b.1 0770 system system + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 system system + write /config/usb_gadget/g1/configs/b.1/MaxPower 500 + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + mount functionfs fastboot /dev/usb-ffs/fastboot rmode=0770,fmode=0660,uid=1000,gid=1000 + setprop sys.usb.configfs 1 + setprop sys.usb.controller ${sys.usb.controller} + +service console /system/bin/sh + seclabel u:r:shell:s0 + console + +service remotecfg3 /sbin/remotecfg -c /sbin/remote.cfg -t /sbin/remote.tab3 -d + oneshot + seclabel u:r:recovery:s0 + +service remotecfg1 /sbin/remotecfg -c /sbin/remote.cfg -t /sbin/remote.tab1 -d + oneshot + seclabel u:r:recovery:s0 + +service remotecfg2 /sbin/remotecfg -c /sbin/remote.cfg -t /sbin/remote.tab2 -d + oneshot + seclabel u:r:recovery:s0 + +service systemcontrol /sbin/systemcontrol_static /sbin/mesondisplay.cfg + oneshot + seclabel u:r:recovery:s0 + +on property:sys.usb.config=none && property:sys.usb.configfs=1 + setprop sys.usb.ffs.ready 0 + +on property:init.svc.adbd=stopped + setprop sys.usb.ffs.ready 0 + +on property:sys.usb.config=mtp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4e41 + +on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4e12 + +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4e40 + +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee0 + +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=none && property:sys.usb.configfs=1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=none && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/UDC "none" + stop adbd + stop fastbootd + setprop sys.usb.ffs.ready 0 + write /config/usb_gadget/g1/bDeviceClass 0 + write /config/usb_gadget/g1/bDeviceSubClass 0 + write /config/usb_gadget/g1/bDeviceProtocol 0 + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rmdir /config/usb_gadget/g1/functions/rndis.gs4 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.config=fastboot && property:sys.usb.configfs=1 + start fastbootd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" + symlink /config/usb_gadget/g1/functions/ffs.adb /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.ffs.ready=1 && property:sys.usb.config=fastboot && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "fastboot" + symlink /config/usb_gadget/g1/functions/ffs.fastboot /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=mtp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp" + symlink /config/usb_gadget/g1/functions/mtp.gs0 /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=mtp,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb" + symlink /config/usb_gadget/g1/functions/mtp.gs0 /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=ptp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp" + symlink /config/usb_gadget/g1/functions/ptp.gs1 /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=ptp,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb" + symlink /config/usb_gadget/g1/functions/ptp.gs1 /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=accessory && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory" + symlink /config/usb_gadget/g1/functions/accessory.gs2 /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=accessory,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_adb" + symlink /config/usb_gadget/g1/functions/accessory.gs2 /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=audio_source && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource" + symlink /config/usb_gadget/g1/functions/audio_source.gs3 /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=audio_source,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource_adb" + symlink /config/usb_gadget/g1/functions/audio_source.gs3 /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=accessory,audio_source && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource" + symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/audio_source.gs3 /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=accessory,audio_source,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource_adb" + symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/audio_source.gs3 /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=midi && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi" + symlink /config/usb_gadget/g1/functions/midi.gs5 /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=midi,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi_adb" + symlink /config/usb_gadget/g1/functions/midi.gs5 /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=rndis && property:sys.usb.configfs=1 + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis" + symlink /config/usb_gadget/g1/functions/rndis.gs4 /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=rndis,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 + mkdir /config/usb_gadget/g1/functions/rndis.gs4 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb" + symlink /config/usb_gadget/g1/functions/rndis.gs4 /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:ro.kernel.qemu=1 + start adbd + +# Used to disable USB when switching states +on property:sys.usb.config=none && property:sys.usb.configfs=0 + stop adbd + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/bDeviceClass 0 + setprop sys.usb.state ${sys.usb.config} + +# adb only USB configuration +# This is the fallback configuration if the +# USB manager fails to set a standard configuration +on property:sys.usb.config=adb && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 4EE7 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# USB accessory configuration +on property:sys.usb.config=accessory && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 2d00 + 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} + +# USB accessory configuration, with adb +on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 2d01 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# audio accessory configuration +on property:sys.usb.config=audio_source && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 2d02 + 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} + +# audio accessory configuration, with adb +on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 2d03 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# USB and audio accessory configuration +on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 2d04 + 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} + +# USB and audio accessory configuration, with adb +on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18d1 + write /sys/class/android_usb/android0/idProduct 2d05 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# Used to set USB configuration at boot and to switch the configuration +# when changing the default configuration +on boot && property:persist.sys.usb.config=* + setprop sys.usb.config ${persist.sys.usb.config} + +# +# USB type C +# + +# USB mode changes +on property:sys.usb.typec.mode=dfp + write /sys/class/dual_role_usb/otg_default/mode ${sys.usb.typec.mode} + setprop sys.usb.typec.state ${sys.usb.typec.mode} + +on property:sys.usb.typec.mode=ufp + write /sys/class/dual_role_usb/otg_default/mode ${sys.usb.typec.mode} + setprop sys.usb.typec.state ${sys.usb.typec.mode} + +# USB data role changes +on property:sys.usb.typec.data_role=device + write /sys/class/dual_role_usb/otg_default/data_role ${sys.usb.typec.data_role} + setprop sys.usb.typec.state ${sys.usb.typec.data_role} + +on property:sys.usb.typec.data_role=host + write /sys/class/dual_role_usb/otg_default/data_role ${sys.usb.typec.data_role} + setprop sys.usb.typec.state ${sys.usb.typec.data_role} + +# USB power role changes +on property:sys.usb.typec.power_role=source + write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power_role} + setprop sys.usb.typec.state ${sys.usb.typec.power_role} + +on property:sys.usb.typec.power_role=sink + write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power_role} + setprop sys.usb.typec.state ${sys.usb.typec.power_role} diff --git a/init-files/ueventd.rc b/init-files/ueventd.rc new file mode 100644 index 0000000..44a96b7 --- /dev/null +++ b/init-files/ueventd.rc @@ -0,0 +1,160 @@ +# /dev/ devices +# + +# Amlogic AV streaming devices +/dev/amvideo 0666 media system +/dev/ionvideo 0666 media system +/dev/video_composer.0 0660 media system +/dev/video_composer.1 0660 media system +/dev/ppmgr 0660 media system +/dev/amstream_* 0666 media system +/dev/audiodsp0 0660 media system +/dev/uio0 0666 system mediadrm +/dev/video0 0660 system camera +/dev/video1 0660 system camera +/dev/video10 0660 system mediadrm +/dev/video11 0660 media system +/dev/video13 0660 system mediadrm +/dev/video14 0660 system mediadrm +/dev/video15 0660 system mediadrm +/dev/video16 0660 system mediadrm +/dev/video16 0660 system mediadrm +/dev/video17 0660 system mediadrm +/dev/video18 0660 system mediadrm +/dev/video19 0660 system mediadrm +/dev/video20 0660 system mediadrm +/dev/video21 0660 system mediadrm +/dev/video23 0660 system mediadrm +/dev/video26 0660 system mediadrm +/dev/video30 0660 system mediadrm +/dev/video31 0660 system mediadrm +/dev/video32 0660 system mediadrm +/dev/video33 0660 system mediadrm +/dev/video34 0660 system mediadrm +/dev/video35 0660 system mediadrm +/dev/video36 0660 system mediadrm +/dev/video37 0660 system mediadrm +/dev/video38 0660 system mediadrm +/dev/video50 0660 system camera +/dev/amaudio_utils 0660 media system +/dev/amaudio_ctl 0660 media system +/dev/amvenc_avc 0660 mediacodec system +/dev/HevcEnc 0660 mediacodec system +/dev/amsubtitle 0660 media system +/dev/jpegenc 0660 media system +/dev/videosync 0666 media system +/dev/ac_sbuf0 0660 system camera +/dev/ac_isp4uf 0660 system camera + + +#audio data +/dev/audio_data_debug 0660 mediacodec audio +/dev/amjpegdec 0666 system system +/dev/ge2d 0660 system system +/dev/vdin0 0660 system system +/dev/vdin1 0660 system system +/dev/virtmem 0666 system system + +# Mali +/dev/ump 0666 system graphics +/dev/mali 0666 system graphics +/dev/mali0 0666 system graphics +/dev/ion 0666 system graphics + +# uvm +/dev/uvm 0660 system graphics + +# video tunnel +/dev/videotunnel 0666 system graphics + +# sw_sync +/dev/sw_sync 0666 system graphics + +#possible serial +/dev/ttyS1 0660 bluetooth bluetooth +/dev/ttyS2 0660 bluetooth bluetooth +/dev/ttyS3 0666 system system +/dev/ttya0 0660 system system +/dev/ttya1 0660 system system +/dev/ptya0 0660 system system +/dev/ptya1 0660 system system +/dev/ttyHS2 0666 bluetooth bluetooth +/dev/ttyS20 0664 system system + +/dev/mpu 0666 system system +/dev/mpuirq 0666 system system +/dev/accelirq 0666 system system +/dev/timerirq 0666 system system + + +/dev/rtk_btusb 0660 bluetooth bluetooth +#mtkbt +/dev/stpbt 0664 bluetooth bluetooth +/dev/rtkbt_dev 0660 bluetooth bluetooth +/dev/hidraw* 0660 system audio +/dev/btusb0 0660 bluetooth bluetooth + +/dev/display 0660 root graphics + +# For USB Joysticks +/dev/input/js* 0664 system system + +/dev/wifi_power 0660 system wifi + +/dev/otz_client 0666 drm drm + +/dev/cec 0666 system system +/dev/v4l2_frontend 0666 system system +/dev/opteearmtz00 0666 system system +/dev/tee0 0666 system system + +/dev/block/by-name/frp 0660 system system + +# /sys/ sysfs +# + +#bluetooth +/sys/devices/platform/bt-dev/rfkill/rfkill0 state 0666 bluetooth bluetooth +/sys/devices/platform/bt-dev/rfkill/rfkill0 type 0660 bluetooth bluetooth +/sys/devices/platform/aml_bt/rfkill/rfkill0 state 0666 bluetooth bluetooth +/sys/devices/platform/aml_bt/rfkill/rfkill0 type 0660 bluetooth bluetooth +/sys/devices/bt-dev.*/rfkill/rfkill0 state 0660 bluetooth bluetooth +/sys/devices/bt-dev.*/rfkill/rfkill0 type 0660 bluetooth bluetooth + +#hdmi cec +/sys/class/amhdmitx/amhdmitx0 hpd_state 0664 system system +/sys/class/amhdmitx/amhdmitx0 disp_mode 0664 system system +/sys/class/amhdmitx/amhdmitx0 config 0664 system system +/sys/class/amhdmitx/amhdmitx0 avmute 0664 system system +/sys/class/amhdmitx/amhdmitx0 aud_ch 0664 system mediadrm + +/sys/class/amhdmitx/amhdmitx0 allm_cap 0664 system system +/sys/class/amhdmitx/amhdmitx0 allm_mode 0664 system system +/sys/class/amhdmitx/amhdmitx0 contenttype_cap 0664 system system +/sys/class/amhdmitx/amhdmitx0 contenttype_mode 0664 system system + +#graphic +/sys/class/graphics/fb* blank 0664 media system +/sys/class/graphics/fb* order 0664 media system +/sys/class/graphics/fb* scale 0664 media system +/sys/class/graphics/fb* scale_axis 0664 system system +/sys/class/graphics/fb* free_scale 0664 system system +/sys/class/graphics/fb* scale_width 0664 system system +/sys/class/graphics/fb* scale_height 0664 system system + +/sys/class/graphics/fb0 free_scale_switch 0664 system graphics +/sys/class/graphics/fb0 enable_key 0664 media system +/sys/class/graphics/fb0 enable_key_onhold 0664 media system +/sys/class/graphics/fb0 free_scale_axis 0664 system system +/sys/class/graphics/fb0 freescale_mode 0664 system system +/sys/class/graphics/fb0 free_scale_axis 0664 system system +/sys/class/graphics/fb0 window_axis 0664 system system + +#cpu +/sys/devices/system/cpu/cpu1 online 0664 system system +/sys/devices/system/cpu/cpu0 cpufreq/scaling_governor 0664 system system +/sys/devices/system/cpu/cpu0 cpufreq/hmp_boost 0664 system system + +#led +/sys/devices/platform/gpioleds/leds/yellow_led trigger 0666 root root +/sys/devices/platform/gpioleds/leds/sys_led brightness 0666 root root diff --git a/lineage.dependencies b/lineage.dependencies new file mode 100644 index 0000000..5be7d39 --- /dev/null +++ b/lineage.dependencies @@ -0,0 +1,18 @@ +[ + { + "repository": "android_kernel_amlogic_linux-4.9", + "target_path": "device/amlogic/linux-4.9" + }, + { + "repository": "android_hardware_amlogic_tools_dtbtool", + "target_path": "hardware/amlogic/tools/dtbtool" + }, + { + "repository": "android_hardware_amlogic_tools_imagepacker", + "target_path": "hardware/amlogic/tools/imagepacker" + }, + { + "repository": "android_hardware_amlogic_tools_respacker", + "target_path": "hardware/amlogic/tools/respacker" + } +] diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..3e1d318 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,190 @@ + + + android.hardware.audio + hwbinder + 5.0 + + IDevicesFactory + default + + @5.0::IDevicesFactory/default + + + android.hardware.audio.effect + hwbinder + 5.0 + + IEffectsFactory + default + + @5.0::IEffectsFactory/default + + + android.hardware.bluetooth + hwbinder + 1.0 + + IBluetoothHci + default + + @1.0::IBluetoothHci/default + + + android.hardware.camera.provider + hwbinder + 2.5 + + ICameraProvider + legacy/0 + + @2.5::ICameraProvider/legacy/0 + + + android.hardware.bluetooth.audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + @2.0::IBluetoothAudioProvidersFactory/default + + + android.hardware.configstore + hwbinder + 1.1 + + ISurfaceFlingerConfigs + default + + @1.1::ISurfaceFlingerConfigs/default + + + android.hardware.drm + hwbinder + 1.0 + + ICryptoFactory + default + widevine + + + IDrmFactory + default + widevine + + @1.0::ICryptoFactory/default + @1.0::ICryptoFactory/widevine + @1.0::IDrmFactory/default + @1.0::IDrmFactory/widevine + @1.3::ICryptoFactory/clearkey + @1.3::ICryptoFactory/widevine + @1.3::IDrmFactory/clearkey + @1.3::IDrmFactory/widevine + + + android.hardware.graphics.allocator + hwbinder + 3.0 + + IAllocator + default + + @3.0::IAllocator/default + + + android.hardware.graphics.mapper + passthrough + 3.0 + + IMapper + default + + @3.0::IMapper/default + + + android.hardware.health + hwbinder + 2.0 + + IHealth + default + + @2.0::IHealth/default + + + android.hardware.keymaster + hwbinder + 4.1 + + IKeymasterDevice + default + + @4.1::IKeymasterDevice/default + + + android.hardware.media.omx + hwbinder + 1.0 + + IOmx + default + + + IOmxStore + default + + @1.0::IOmx/default + @1.0::IOmxStore/default + + + android.hardware.memtrack + hwbinder + 1.0 + + IMemtrack + default + + @1.0::IMemtrack/default + + + android.hardware.power + hwbinder + 1.0 + + IPower + default + + @1.0::IPower/default + + + android.hardware.tv.cec + hwbinder + 1.0 + + IHdmiCec + default + + @1.0::IHdmiCec/default + + + vendor.amlogic.hardware.hdmicec + hwbinder + 1.0 + + IDroidHdmiCEC + default + + @1.0::IDroidHdmiCEC/default + + + vendor.amlogic.hardware.systemcontrol + hwbinder + 1.1 + + ISystemControl + default + + @1.1::ISystemControl/default + + diff --git a/media/media_codecs.xml b/media/media_codecs.xml new file mode 100644 index 0000000..a66a122 --- /dev/null +++ b/media/media_codecs.xml @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/media_codecs_performance.xml b/media/media_codecs_performance.xml new file mode 100644 index 0000000..1cf6f8b --- /dev/null +++ b/media/media_codecs_performance.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/media_codecs_profiles.xml b/media/media_codecs_profiles.xml new file mode 100644 index 0000000..16e8eb8 --- /dev/null +++ b/media/media_codecs_profiles.xml @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/media_codecs_profiles_V1_0.xml b/media/media_codecs_profiles_V1_0.xml new file mode 100644 index 0000000..0c501f0 --- /dev/null +++ b/media/media_codecs_profiles_V1_0.xml @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/media_profiles.xml b/media/media_profiles.xml new file mode 100644 index 0000000..16e8eb8 --- /dev/null +++ b/media/media_profiles.xml @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/media_profiles_V1_0.xml b/media/media_profiles_V1_0.xml new file mode 100644 index 0000000..0c501f0 --- /dev/null +++ b/media/media_profiles_V1_0.xml @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..c0f10f2 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,53 @@ + + + + + + + + + "wifi,1,1,1,-1,true" + "ethernet,9,9,2,-1,true" + + + + + + "1,1" + "9,1" + + + + + + 1 + 7 + + + + true + + + true + + + false + + + 2 + diff --git a/overlay/packages/apps/Bluetooth/res/values/config.xml b/overlay/packages/apps/Bluetooth/res/values/config.xml new file mode 100644 index 0000000..84206a0 --- /dev/null +++ b/overlay/packages/apps/Bluetooth/res/values/config.xml @@ -0,0 +1,20 @@ + + false + false + false + false + false + false + false + + false + false + false + false + false + + true + true + true + true + diff --git a/product.prop b/product.prop new file mode 100644 index 0000000..562bfe2 --- /dev/null +++ b/product.prop @@ -0,0 +1,27 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +## Audio +ro.af.client_heap_size_kbyte=1536 +ro.config.media_vol_default=20 +ro.config.media_vol_steps=25 +ro.config.ringtone=Ring_Synth_04.ogg +ro.config.notification_sound=pixiedust.ogg + +## Battery (Fake) +ro.boot.fake_battery=42 + +## Camera +camera.disable_zsl_mode=1 +rw.camera.usb.faceback=true + +## Graphics +debug.sf.disable_backpressure=1 +debug.sf.latch_unsignaled=1 +ro.sf.disable_triple_buffer=0 + +## Identifiers +ro.oem.key1=ATV00100020 diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..7709634 --- /dev/null +++ b/proprietary-files.txt @@ -0,0 +1,254 @@ +### All blobs from this list, unless pinned and noted as otherwise, +## are from adt3-user 11 RTT1.200909.003.A2 6832896 release-keys. + +odm/etc/firmware/firmware.le +odm/usr/idc/Vendor_000d_Product_3838.idc +odm/usr/idc/Vendor_000d_Product_3839.idc +odm/usr/keylayout/Vendor_000d_Product_3838.kl +odm/usr/keylayout/Vendor_000d_Product_3839.kl +odm/usr/keylayout/Vendor_7545_Product_0021.kl + +product/etc/permissions/privapp-permissions-atv-product.xml:product/etc/permissions/privapp-permissions-atv-product-lineage.xml +product/etc/permissions/privapp-permissions-google-p.xml:product/etc/permissions/privapp-permissions-google-p-lineage.xml +product/etc/permissions/split-permissions-google.xml:product/etc/permissions/split-permissions-google-lineage.xml +product/etc/sysconfig/google-hiddenapi-package-whitelist.xml +product/etc/sysconfig/google.xml:product/etc/sysconfig/google-lineage.xml +product/etc/sysconfig/google_atv.xml +product/lib/libsystemcontrolservice.so +product/media/audio/alarms/Alarm_Beep_02.ogg +product/media/audio/ui/Effect_Tick.ogg +product/media/audio/ui/KeypressDelete.ogg +product/media/audio/ui/KeypressInvalid.ogg +product/media/audio/ui/KeypressReturn.ogg +product/media/audio/ui/KeypressSpacebar.ogg +product/media/audio/ui/KeypressStandard.ogg + +system/etc/audio_effects.conf +system/etc/permissions/privapp-permissions-atv.xml:system/etc/permissions/privapp-permissions-atv-lineage.xml +system/etc/permissions/privapp-permissions-google.xml:system/etc/permissions/privapp-permissions-google-lineage.xml +system/lib/hw/screen_source.amlogic.so +system/lib/libmediahal_resman.system.so +system/lib/libmediahal_tsplayer.system.so +system/lib/libmediahal_videodec.system.so + +system_ext/etc/permissions/privapp-permissions-deadpool.xml +system_ext/etc/permissions/privapp-permissions-google-se.xml:system_ext/etc/permissions/privapp-permissions-google-se-lineage.xml +system_ext/lib/vendor.amlogic.hardware.hdmicec@1.0.so +system_ext/lib/vendor.amlogic.hardware.remotecontrol@1.0.so +system_ext/lib/vendor.amlogic.hardware.systemcontrol@1.0.so +system_ext/lib/vendor.amlogic.hardware.systemcontrol@1.1.so +-system_ext/priv-app/DeadpoolServiceBtServices/DeadpoolServiceBtServices.apk + +vendor/bin/ddrtest.sh +vendor/bin/esplayer +vendor/bin/hdcp_tx22 +vendor/bin/hdmicecd +vendor/bin/hw/android.hardware.drm@1.3-service.widevine +vendor/bin/hw/android.hardware.dumpstate@1.0-service.droidlogic +vendor/bin/hw/android.hardware.graphics.composer@2.4-service.droidlogic +vendor/bin/hw/android.hardware.health@2.0-service.droidlogic +vendor/bin/hw/android.hardware.keymaster@4.1-service.amlogic +vendor/bin/hw/android.hardware.oemlock@1.0-service.droidlogic +vendor/bin/hw/android.hardware.thermal@2.0-service.droidlogic +vendor/bin/hw/android.hardware.usb.gadget@1.1-service.droidlogic +vendor/bin/hw/android.hardware.wifi@1.0-service.droidlogic +vendor/bin/oemcrypto_test_aml +vendor/bin/remotecfg +vendor/bin/systemcontrol +vendor/bin/tee-supplicant +vendor/bin/tee_preload_fw +vendor/etc/audio_effects.conf +vendor/etc/bluetooth/4343.hcd +vendor/etc/bluetooth/BCM20702.hcd +vendor/etc/bluetooth/BCM20703A2.hcd +vendor/etc/bluetooth/BCM2076.hcd +vendor/etc/bluetooth/BCM4330.hcd +vendor/etc/bluetooth/BCM4345C0.hcd +vendor/etc/bluetooth/BCM4345C5.hcd +vendor/etc/bluetooth/BCM4350.hcd +vendor/etc/bluetooth/BCM4354.hcd +vendor/etc/bluetooth/BCM4359C0.hcd +vendor/etc/bluetooth/BCM4362A1.hcd +vendor/etc/bluetooth/auto_pairing.conf +vendor/etc/bluetooth/bcm43241b4.hcd +vendor/etc/bluetooth/bcm43341b0.hcd +vendor/etc/bluetooth/bcm4335c0.hcd +vendor/etc/bluetooth/bcm43569a2.hcd +vendor/etc/bluetooth/blacklist.conf +vendor/etc/drm/playready/bgroupcert.dat +vendor/etc/drm/playready/zgpriv.dat +vendor/etc/drm/playready/zgpriv_protected.dat +vendor/etc/init/android.hardware.drm@1.3-service.widevine.rc +vendor/etc/init/android.hardware.dumpstate@1.0-service.droidlogic.rc +vendor/etc/init/android.hardware.graphics.allocator@3.0-service.rc +vendor/etc/init/android.hardware.graphics.composer@2.4-service.droidlogic.rc +vendor/etc/init/android.hardware.health@2.0-service.droidlogic.rc +vendor/etc/init/android.hardware.keymaster@4.1-service.amlogic.rc +vendor/etc/init/android.hardware.oemlock@1.0-service.droidlogic.rc +vendor/etc/init/android.hardware.thermal@2.0-service.droidlogic.rc +vendor/etc/init/android.hardware.usb.gadget@1.1-service.droidlogic.rc +vendor/etc/init/android.hardware.wifi@1.0-service.droidlogic.rc +vendor/etc/init/bluetooth.rc +vendor/etc/init/dvb.rc +vendor/etc/init/fs.rc +vendor/etc/init/hdmicecd.rc +vendor/etc/init/irblaster1.rc +vendor/etc/init/sysfs_permissions.rc +vendor/etc/init/systemcontrol.rc +vendor/etc/init/tee-supplicant.rc +vendor/etc/init/tee_preload_fw.rc +vendor/etc/mesondisplay.cfg +vendor/etc/permissions/android.software.cant_save_state.xml +vendor/etc/permissions/droidlogic.software.core.xml +vendor/etc/permissions/droidlogic.software.netflix.xml +vendor/etc/permissions/privapp-permissions-amlogic.xml +vendor/etc/remote.cfg +vendor/etc/remote.tab1 +vendor/etc/remote.tab2 +vendor/etc/remote.tab3 +vendor/etc/seccomp_policy/mediacodec.policy +vendor/etc/seccomp_policy/mediaextractor.policy +vendor/etc/seccomp_policy/mediaswcodec.policy +vendor/etc/thermal_info_config.json +vendor/etc/tvconfig/pq/pq.db +vendor/etc/tvconfig/pq/pq_default.ini +-vendor/etc/vintf/manifest/android.hardware.dumpstate@1.0-service.droidlogic.xml +-vendor/etc/vintf/manifest/android.hardware.graphics.composer@2.4-service.droidlogic.xml +-vendor/etc/vintf/manifest/android.hardware.oemlock@1.0-service.droidlogic.xml +-vendor/etc/vintf/manifest/android.hardware.thermal@2.0-service.droidlogic.xml +-vendor/etc/vintf/manifest/android.hardware.usb.gadget@1.1-service.droidlogic.xml +-vendor/etc/vintf/manifest/android.hardware.wifi@1.0-service.droidlogic.xml +-vendor/etc/vintf/manifest/manifest_android.hardware.drm@1.3-service.widevine.xml +vendor/etc/wifi/buildin/clm_bcm43751a1_ag.blob +vendor/etc/wifi/buildin/config_bcm4339a0_ag.txt +vendor/etc/wifi/buildin/config_bcm43436b0.txt +vendor/etc/wifi/buildin/config_bcm43438a0.txt +vendor/etc/wifi/buildin/config_bcm43438a1.txt +vendor/etc/wifi/buildin/config_bcm43455c0_ag.txt +vendor/etc/wifi/buildin/config_bcm43456c5_ag.txt +vendor/etc/wifi/buildin/config_bcm4356a2_ag.txt +vendor/etc/wifi/buildin/config_bcm4359c0_ag.txt +vendor/etc/wifi/buildin/fw_bcm4339a0_ag.bin +vendor/etc/wifi/buildin/fw_bcm43436b0.bin +vendor/etc/wifi/buildin/fw_bcm43438a0.bin +vendor/etc/wifi/buildin/fw_bcm43455c0_ag.bin +vendor/etc/wifi/buildin/fw_bcm43456c5_ag.bin +vendor/etc/wifi/buildin/fw_bcm4356a2_ag.bin +vendor/etc/wifi/buildin/fw_bcm4356a2_ag_apsta.bin +vendor/etc/wifi/buildin/fw_bcm4356a2_ag_p2p.bin +vendor/etc/wifi/buildin/fw_bcm4358u_ag.bin +vendor/etc/wifi/buildin/fw_bcm4359c0_ag.bin +vendor/etc/wifi/buildin/fw_bcm43751a1_ag.bin +vendor/etc/wifi/buildin/nvram_ap6212.txt +vendor/etc/wifi/buildin/nvram_ap6236.txt +vendor/etc/wifi/buildin/nvram_ap6255.txt +vendor/etc/wifi/buildin/nvram_ap6256.txt +vendor/etc/wifi/buildin/nvram_ap6271s.txt +vendor/etc/wifi/buildin/nvram_ap62x8.txt +vendor/etc/wifi/buildin/nvram_ap6335.txt +vendor/etc/wifi/buildin/nvram_ap6356.txt +vendor/etc/wifi/buildin/nvram_ap6398s.txt +vendor/etc/wifi/p2p_supplicant_overlay.conf +vendor/etc/wifi/wpa_supplicant.conf:vendor/etc/wifi/wpa_supplicant_overlay.conf +-vendor/framework/droidlogic.jar +vendor/lib/android.hardware.graphics.composer@2.1-resources-vendor.so +vendor/lib/android.hardware.graphics.composer@2.2-resources-vendor.so +vendor/lib/egl/libGLES_mali.so +vendor/lib/firmware/video/h264_enc.bin +vendor/lib/firmware/video/video_ucode.bin +vendor/lib/hw/android.hardware.graphics.allocator@3.0-impl-arm.so +vendor/bin/hw/android.hardware.graphics.allocator@3.0-service +vendor/lib/hw/android.hardware.graphics.mapper@3.0-impl-arm.so +vendor/lib/hw/audio.primary.amlogic.so +vendor/lib/hw/camera.amlogic.so +vendor/lib/hw/hdmi_cec.amlogic.so +vendor/lib/hw/hwcomposer.amlogic.so +vendor/lib/hw/memtrack.amlogic.so +vendor/lib/hw/power.amlogic.so +vendor/lib/hw/vulkan.amlogic.so +vendor/lib/libHwAudio_dcvdec.so +vendor/lib/libHwAudio_dtshd.so +vendor/lib/libOmxAudio.so +vendor/lib/libOmxBase.so +vendor/lib/libOmxCore.so +vendor/lib/libOmxVideo.so +vendor/lib/libam_adp.so +vendor/lib/libamadec.so +vendor/lib/libamaudioutils.so +vendor/lib/libamavutils.so +vendor/lib/libamgralloc_ext.so +vendor/lib/libamgralloc_ext_vendor@2.so +vendor/lib/libamlaudiorc.so +vendor/lib/libdatachunkqueue_alt.so +vendor/lib/libdisplaysetting.so +vendor/lib/libdroidaudiospdif.so +vendor/lib/libfaad.so +vendor/lib/libfbc.so +vendor/lib/libfpscalculator_alt.so +vendor/lib/libge2d.so +vendor/lib/libhdmicec.so +vendor/lib/libhdmicec_jni.so +vendor/lib/libicuuc_vendor.so +vendor/lib/libispaaa.so +vendor/lib/libjniuevent.so +vendor/lib/libmad.so +vendor/lib/libmediahal_resman.so +vendor/lib/libmediahal_tsplayer.so +vendor/lib/libmediahal_videodec.so +vendor/lib/libmeson_display_adapter_remote.so +vendor/lib/libmeson_display_service.so +vendor/lib/libms12api.so +vendor/lib/libnano.so +vendor/lib/liboemcrypto.so +vendor/lib/libomx_av_core_alt.so +vendor/lib/libomx_clock_utils_alt.so +vendor/lib/libomx_framework_alt.so +vendor/lib/libomx_timed_task_queue_alt.so +vendor/lib/libomx_worker_peer_alt.so +vendor/lib/libplayready.so +vendor/lib/libpqcontrol.so +vendor/lib/libremotecontrol_jni.so +vendor/lib/libremotecontrolserver.so +vendor/lib/libsecmem.so +vendor/lib/libstagefrighthw.so +vendor/lib/libsystemcontrolservice.so +vendor/lib/libtee_load_video_fw.so +vendor/lib/libteec.so +vendor/lib/libthreadworker_alt.so +vendor/lib/libtvbinder.so +vendor/lib/libvideotunnel.so +vendor/lib/libwifi-hal-aml.so +vendor/lib/libwifi-hal-common-ext.so +vendor/lib/libwvhidl.so +vendor/lib/mediadrm/libplayreadymediadrmplugin.so +vendor/lib/soundfx/libavl.so +vendor/lib/soundfx/libbalance.so +vendor/lib/soundfx/libhpeqwrapper.so +vendor/lib/soundfx/libsrswrapper.so +vendor/lib/soundfx/libtreblebasswrapper.so +vendor/lib/teetz/2c1a33c0-44cc-11e5-bc3b0002a5d5c51b.ta +vendor/lib/teetz/526fc4fc-7ee6-4a12-96e3-83da9565bce8.ta +vendor/lib/teetz/8efb1e1c-37e5-4326-a5d68c33726c7d57.ta +vendor/lib/teetz/9a04f079-9840-4286-ab92e65be0885f95.ta +vendor/lib/teetz/e043cde0-61d0-11e5-9c260002a5d5c51b.ta +vendor/lib/vendor.amlogic.display.meson_display_ipc@1.0.so +vendor/lib/vendor.amlogic.hardware.droidvold@1.0.so +vendor/lib/vendor.amlogic.hardware.hdmicec@1.0.so +vendor/lib/vendor.amlogic.hardware.remotecontrol@1.0.so +vendor/lib/vendor.amlogic.hardware.systemcontrol@1.0.so +vendor/lib/vendor.amlogic.hardware.systemcontrol@1.1.so +vendor/lib/vendor.amlogic.hardware.tvserver@1.0.so +-vendor/priv-app/droidlogic-res/droidlogic-res.apk +vendor/priv-app/droidlogic-res/lib/arm/libjniuevent.so +vendor/priv-app/droidlogic-res/lib/arm/libremotecontrol_jni.so +vendor/usr/keylayout/Vendor_0001_Product_0001.kl +vendor/usr/keylayout/Vendor_000d_Product_3838.kl +vendor/usr/keylayout/Vendor_000d_Product_3839.kl +vendor/usr/keylayout/Vendor_005d_Product_0001.kl +vendor/usr/keylayout/Vendor_0484_Product_5738.kl +vendor/usr/keylayout/Vendor_0508_Product_0110.kl +vendor/usr/keylayout/Vendor_0c45_Product_1109.kl +vendor/usr/keylayout/Vendor_1915_Product_0001.kl +vendor/usr/keylayout/Vendor_7045_Product_1820.kl +vendor/usr/keylayout/Vendor_7545_Product_0021.kl +vendor/usr/keylayout/Vendor_7545_Product_0180.kl diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..911a638 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper for common +setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON}" "${ANDROID_ROOT}" true + +# Warning headers and guards +write_headers "g12a g12b sm1" "TARGET_AMLOGIC_SOC" + +# The standard common blobs +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +# Finish +write_footers + +if [ -s "${MY_DIR}/../../${VENDOR_DEVICE}/${DEVICE}/proprietary-files.txt" ]; then + # Reinitialize the helper for device + setup_vendor "${DEVICE}" "${VENDOR_DEVICE}" "${ANDROID_ROOT}" false + + # Warning headers and guards + write_headers + + # The standard device blobs + write_makefiles "${MY_DIR}/../../${VENDOR_DEVICE}/${DEVICE}/proprietary-files.txt" true + + # Finish + write_footers +fi diff --git a/vendor.prop b/vendor.prop new file mode 100644 index 0000000..8358d57 --- /dev/null +++ b/vendor.prop @@ -0,0 +1,102 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +## Audio +ro.config.media_vol_default=20 +ro.config.media_vol_steps=25 + +## Bluetooth +atv.setup.bt_remote_pairing=true +config.disable_bluetooth=false +persist.bluetooth.bluetooth_audio_hal.disabled=false +ro.vendor.autoconnectbt.btclass=50c +ro.vendor.autoconnectbt.isneed=false +ro.vendor.autoconnectbt.macprefix=00:CD:FF +ro.vendor.autoconnectbt.nameprefix=Amlogic_RC +ro.vendor.autoconnectbt.rssilimit=70 + +## DRM +drm.service.enabled=1 +vendor.drm.service.enable=true + +## FRP +ro.frp.pst=/dev/block/by-name/frp + +## HDMI +mbx.hdmiin.switchfull=false +mbx.hdmiin.videolayer=false +persist.sys.hdmi.keep_awake=false +persist.vendor.sys.cec.power_assist_standby=false +ro.hdmi.device_type=4 +ro.sys.hdmiin.enable=true +ro.vendor.hdmi.auto_otp=false +ro.vendor.platform.has.mbxuimode=true +ro.vendor.platform.has.realoutputmode=true +ro.vendor.platform.hdmi.device_type=4 +ro.vendor.platform.need.display.hdmicec=true + +## LMKD +ro.lmk.kill_heaviest_task=true +ro.lmk.kill_timeout_ms=100 +ro.lmk.use_minfree_levels=true + +# Graphics +ro.hardware.vulkan=amlogic +ro.opengles.version=196610 +ro.surface_flinger.max_graphics_height=1080 +ro.surface_flinger.max_graphics_width=1920 + +## Dalvik +dalvik.vm.heapgrowthlimit=256m +dalvik.vm.heapmaxfree=8m +dalvik.vm.heapminfree=512k +dalvik.vm.heapsize=384m +dalvik.vm.heapstartsize=8m +dalvik.vm.heaptargetutilization=0.75 + +## Media +libplayer.livets.softdemux=1 +libplayer.netts.recalcpts=1 +persist.sys.media.avsync=true +persist.vendor.media.bootvideo=0050 +ro.media.camera_preview.maxsize=1920x1080 +ro.media.camera_preview.limitedrate=1920x1080x30,1280x720x30,640x480x30,320x240x28 +ro.media.camera_preview.usemjpeg=1 +ro.media.maxmem=629145600 +ro.vendor.media.support.ffmpeg.adec=false +ro.vendor.platform.disable.audiorawout=false +ro.vendor.platform.support.dolby=true +ro.vendor.platform.support.dolbyvision=false +ro.vendor.platform.support.dts=true +ro.vendor.sdr2hdr.enable=true +vendor.afbcd.enable=1 +vendor.media.libplayer.curlenable=true +vendor.media.libplayer.seek.fwdsearch=1 +vendor.media.libplayer.modules=vhls_mod,dash_mod,curl_mod,prhls_mod,vm_mod,bluray_mod +vendor.media.support.dolbyvision=false + +## OMX +ro.vendor.media.support.omx2=true +vendor.media.omx2.in_buffer=5 +vendor.ionvideo.enable=1 +vendor.media.omx.use.360omx2=false +vendor.media.omx.out_buffer2_osd=8 +vendor.media.omx.display_mode=3 +vendor.media.sf.omxvideo-optmize=1 + +## OEM Lock +ro.oem_unlock_supported=1 + +## Platform +ro.vendor.platform.is.tv=0 + +## USB +vendor.usb.controller=ff400000.dwc2_a + +## Wi-Fi +ro.carrier=wifi-only +wifi.direct.interface=p2p-dev-wlan0 +wifi.interface=wlan0