Kaynağa Gözat

Add board BeagleV Ahead

Change-Id: I520ed10d624cf721957bbf61a33744cb9c0365e7
Mao Han 1 yıl önce
işleme
982fdb0d12

+ 5 - 0
AndroidProducts.mk

@@ -0,0 +1,5 @@
+PRODUCT_MAKEFILES := \
+       $(LOCAL_DIR)/beaglev_ahead.mk
+
+COMMON_LUNCH_CHOICES := \
+       beaglev_ahead-userdebug

+ 29 - 0
BoardConfig.mk

@@ -0,0 +1,29 @@
+include device/thead/th1520/BoardConfigCommon.mk
+
+TARGET_BOARD_PLATFORM := th1520
+
+BOARD_FLASH_BLOCK_SIZE := 512
+
+#Vendor partition definition
+TARGET_COPY_OUT_VENDOR := vendor
+BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_VENDORIMAGE_JOURNAL_SIZE := 0
+BOARD_VENDORIMAGE_EXTFS_INODE_COUNT := 2048
+
+#Userdata partition definition
+#use "mmc part" to get userdata partition size in uboot console
+#0x00854000      0x01d1efde      "userdata"
+#use "mmc info" to get block size
+#(0x01d1efde-0x00854000+1)*512 = 11163123200
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 11163123200
+TARGET_USERIMAGES_USE_F2FS := true
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
+
+#Cache partition definition
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+
+BOARD_BOOTCONFIG += androidboot.hardware=beaglev_ahead
+
+#Recovery
+TARGET_RECOVERY_FSTAB := device/thead/th1520/beaglev_ahead/fstab.beaglev_ahead
+TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888

+ 28 - 0
android.hardware.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<permissions>
+    <!-- Fix cts bug CtsVoiceInteractionTestCases about FEATURE_MICRPHONE missing -->
+    <feature name="android.hardware.microphone" />
+
+    <!-- Fix cts bug CtsSecurityTestCases about FEATURE_SECURITY_MODEL_COMPATIBLE missing -->
+    <feature name="android.hardware.security.model.compatible" />
+
+    <!-- Fix cts bug CtsAppTestCases about FEATURE_SCREEN_PORTRAIT/FEATURE_SCREEN_LANDSCAPE missing -->
+    <feature name="android.hardware.screen.portrait" />
+    <feature name="android.hardware.screen.landscape" />
+ </permissions>
+

+ 42 - 0
android.software.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<permissions>
+    <!-- This is Android and fully CTS compatible.  Basically this is for CTS tests to use. -->
+    <feature name="android.software.cts" />
+    <!-- basic system services -->
+    <feature name="android.software.app_widgets" />
+    <feature name="android.software.voice_recognizers" />
+    <feature name="android.software.backup" />
+    <feature name="android.software.home_screen" />
+    <feature name="android.software.input_methods" />
+    <feature name="android.software.picture_in_picture" />
+    <feature name="android.software.activities_on_secondary_displays" />
+    <feature name="android.software.print" />
+    <feature name="android.software.companion_device_setup" />
+    <feature name="android.software.autofill" />
+    <feature name="android.software.cant_save_state" />
+    <feature name="android.software.secure_lock_screen" />
+
+    <!-- Feature to specify if the device supports adding device admins. -->
+    <feature name="android.software.device_admin" />
+
+    <!-- Feature to specify if the device support managed users. -->
+    <feature name="android.software.managed_users" />
+
+    <!-- Feature to specify if the device supports controls. -->
+    <feature name="android.software.controls" />
+</permissions>

+ 38 - 0
beaglev_ahead.mk

@@ -0,0 +1,38 @@
+#
+# Copyright 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+LOCAL_64ONLY := _64
+
+# Aosp gsi and basic vendor
+$(call inherit-product, device/thead/common/aosp_common.mk)
+
+# T-Head system_ext
+$(call inherit-product-if-exist, device/thead/th1520/th1520_system_ext.mk)
+
+# Riscv patch for system
+$(call inherit-product, device/thead/common/system_riscv_patch.mk)
+
+# AOSP default vendor configs
+$(call inherit-product, device/thead/common/aosp_vendor.mk)
+
+# T-Head beaglev_ahead vendor packages
+$(call inherit-product, device/thead/th1520/beaglev_ahead/device-beaglev_ahead.mk)
+
+PRODUCT_MANUFACTURER := T-Head
+PRODUCT_BRAND := Android
+PRODUCT_NAME := beaglev_ahead
+PRODUCT_DEVICE := beaglev_ahead
+PRODUCT_MODEL := AOSP on BEAGLEV_AHEAD

+ 196 - 0
device-beaglev_ahead.mk

@@ -0,0 +1,196 @@
+# Kernel
+ifeq ($(TARGET_PREBUILT_KERNEL),)
+LOCAL_KERNEL := device/thead/th1520-kernel/kernel-5.10
+else
+LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
+endif
+
+ifeq ($(TARGET_PREBUILT_DTB), )
+LOCAL_DTB := device/thead/th1520-kernel/light-lpi4a-android.dtb
+else
+LOCAL_DTB := $(TARGET_PREBUILT_DTB)
+endif
+
+PRODUCT_COPY_FILES := \
+    $(LOCAL_KERNEL):kernel \
+
+# Load beaglev_ahead feature config
+$(call inherit-product, device/thead/th1520/beaglev_ahead/product_config.mk)
+
+# Install th1520 platform common packages
+$(call inherit-product, device/thead/th1520/th1520-common.mk)
+
+# Install generic packages
+$(call inherit-product, vendor/thead/proprietary/config/generic/generic.mk)
+
+# Install beaglev_ahead proprietary packages
+$(call inherit-product, vendor/thead/proprietary/config/boards/beaglev_ahead/device-vendor.mk)
+
+# Overlay
+DEVICE_PACKAGE_OVERLAYS := device/thead/th1520/beaglev_ahead/overlay
+
+# evb_ligth init files
+PRODUCT_COPY_FILES += \
+    device/thead/th1520/beaglev_ahead/init.beaglev_ahead.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.beaglev_ahead.rc \
+    device/thead/th1520/beaglev_ahead/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.beaglev_ahead.usb.rc \
+    device/thead/th1520/beaglev_ahead/init.connectivity.beaglev_ahead.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.connectivity.beaglev_ahead.rc \
+    device/thead/th1520/beaglev_ahead/ueventd.beaglev_ahead.rc:$(TARGET_COPY_OUT_VENDOR)/etc/ueventd.rc \
+
+# beaglev_ahead fstab files
+PRODUCT_COPY_FILES += \
+    device/thead/th1520/beaglev_ahead/fstab.beaglev_ahead:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.beaglev_ahead \
+    device/thead/th1520/beaglev_ahead/fstab.beaglev_ahead.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.beaglev_ahead \
+    device/thead/th1520/beaglev_ahead/fstab.enableswap:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.enableswap \
+
+# Recovery files
+PRODUCT_COPY_FILES += \
+    device/thead/th1520/beaglev_ahead/init.recovery.beaglev_ahead.rc:recovery/root/init.recovery.beaglev_ahead.rc \
+
+# beaglev_ahead media configurations
+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
+    frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
+    frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
+    $(LOCAL_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
+
+# beaglev_ahead permission configurations
+PRODUCT_COPY_FILES += \
+    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.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
+
+PRODUCT_COPY_FILES += $(LOCAL_PATH)/android.software.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.xml
+PRODUCT_COPY_FILES += $(LOCAL_PATH)/android.hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.xml
+
+# ethernet #
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml
+
+# The device supports verified boot
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml
+
+# USB properties
+PRODUCT_VENDOR_PROPERTIES += \
+   ro.boot.usb_mode=1 \
+   ro.boot.usb_speed=5
+
+# Display lcd denstity
+TARGET_SCREEN_DENSITY := 320
+
+# Enable AVB
+BOARD_AVB_ENABLE := true
+BOARD_BOOTIMAGE_PARTITION_SIZE := 0x2000000
+
+# BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x2800000
+
+# Installs gsi keys into ramdisk, to boot a developer GSI with verified boot.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
+
+# Set Vendor SPL to match platform
+VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
+
+# Set boot SPL
+BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
+
+# 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
+
+#vendor_ramdisk.img
+BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true
+PRODUCT_PACKAGES += \
+    linker.vendor_ramdisk \
+    e2fsck.vendor_ramdisk \
+
+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
+
+# Enable chained vbmeta for boot images
+BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
+BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA2048
+BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
+BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 2
+
+# Fix cts bug CtsThemeHostTestCases about xhdpi assets missing
+PRODUCT_AAPT_PREF_CONFIG := xhdpi
+
+# Enable APK Verity, which depends on fs-verity support in kernel.
+PRODUCT_PROPERTY_OVERRIDES += ro.apk_verity.mode=2
+
+PRODUCT_COPY_FILES += \
+    system/core/libprocessgroup/profiles/cgroups.json:$(TARGET_COPY_OUT_VENDOR)/etc/cgroups.json \
+    system/core/libprocessgroup/profiles/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json
+
+# fastbootd
+PRODUCT_PACKAGES += \
+    fastbootd \
+
+# Dumpstate HAL
+PRODUCT_PACKAGES += \
+    android.hardware.dumpstate@1.1-service.th1520
+
+# Atrace HAL
+PRODUCT_PACKAGES += \
+    android.hardware.atrace@1.0-service.th1520
+
+#
+# OemLock aidl HAL
+#
+PRODUCT_PACKAGES += \
+    android.hardware.oemlock-service.th1520
+
+#
+# Authsecret HAL
+#
+PRODUCT_PACKAGES += \
+    android.hardware.authsecret@1.0-service
+
+#
+# Authsecret AIDL HAL
+#
+PRODUCT_PACKAGES += \
+    android.hardware.authsecret-service.example
+
+# Input Classifier HAL
+PRODUCT_PACKAGES += \
+    android.hardware.input.classifier@1.0-service.default
+
+# Reboot escrow
+PRODUCT_PACKAGES += \
+    android.hardware.rebootescrow-service.default
+
+# Set system properties identifying the chipset
+PRODUCT_VENDOR_PROPERTIES += ro.soc.manufacturer=T-HEAD
+PRODUCT_VENDOR_PROPERTIES += ro.soc.model=TH1520
+
+PRODUCT_PACKAGES_DEBUG += \
+    sg_write_buffer \
+    f2fs_io \
+    check_f2fs
+
+# Use FUSE passthrough
+PRODUCT_PRODUCT_PROPERTIES += \
+    persist.sys.fuse.passthrough.enable=true
+
+# Fix cts bug CtsNativeVerifiedBootTestCases
+PRODUCT_PRODUCT_PROPERTIES += \
+    partition.system.verified.hash_alg=$(BOARD_AVB_VBMETA_SYSTEM_ALGORITHM) \
+    partition.system_ext.verified.hash_alg=$(BOARD_AVB_VBMETA_SYSTEM_ALGORITHM) \
+    partition.vendor.verified.hash_alg=$(BOARD_AVB_VBMETA_SYSTEM_ALGORITHM) \
+    partition.product.verified.hash_alg=$(BOARD_AVB_VBMETA_SYSTEM_ALGORITHM) \
+
+ifeq ($(PRODUCT_BUILD_TYPE), daily)
+DAILY_BUILD_TIME := $(shell date +"%Y-%m-%d:%H:%M:%S")
+PRODUCT_PRODUCT_PROPERTIES += \
+    ro.product.beaglev_ahead.version=RV64.Android.$(PLATFORM_VERSION_LAST_STABLE).alpha.V0.2.daily$(DAILY_BUILD_TIME)
+else
+PRODUCT_PRODUCT_PROPERTIES += \
+    ro.product.beaglev_ahead.version=RV64.Android.$(PLATFORM_VERSION_LAST_STABLE).alpha.V0.2
+endif

+ 11 - 0
fstab.beaglev_ahead

@@ -0,0 +1,11 @@
+# Android fstab file.
+#<src>                         <mnt_point> <type>       <mnt_flags and options>    <fs_mgr_flags>
+/dev/block/by-name/boot        /boot        emmc        defaults                    defaults
+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
+vendor                         /vendor      ext4        ro,barrier=1                wait,slotselect,avb=vbmeta,logical,first_stage_mount
+product                        /product     ext4        ro,barrier=1                wait,slotselect,avb,logical,first_stage_mount
+/dev/block/by-name/userdata    /data        f2fs        noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier	latemount,wait,check,quota,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,fscompress,keydirectory=/metadata/vold/metadata_encryption,checkpoint=fs
+/dev/block/by-name/metadata    /metadata    ext4        nodev,noatime,nosuid        wait,formattable,first_stage_mount,check
+/dev/block/by-name/misc        /misc        emmc        defaults                    defaults
+*/block/mmcblk1*               auto         auto        defaults                    voldmanaged=sdcard1:auto,encryptable=userdata

+ 3 - 0
fstab.beaglev_ahead.ramdisk

@@ -0,0 +1,3 @@
+system /system ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+vendor /vendor ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+

+ 2 - 0
fstab.enableswap

@@ -0,0 +1,2 @@
+# ZRAM
+/dev/block/zram0               none 		swap 		defaults 			zramsize=50%

+ 82 - 0
init.beaglev_ahead.rc

@@ -0,0 +1,82 @@
+import /vendor/etc/init/hw/init.beaglev_ahead.usb.rc
+
+on init
+# boot time fs tune
+    write /sys/block/mmcblk0/queue/iostats 0
+    write /sys/block/mmcblk0/queue/read_ahead_kb 2048
+    write /sys/block/mmcblk0/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
+
+on early-init
+    mount debugfs debugfs /sys/kernel/debug
+    chmod 0755 /sys/kernel/debug
+    insmod /vendor/lib/modules/img_mem.ko
+    insmod /vendor/lib/modules/vha.ko
+    insmod /vendor/lib/modules/pvrsrvkm.ko
+    insmod /vendor/lib/modules/roles.ko
+    insmod /vendor/lib/modules/dwc3.ko usb_mode=${ro.boot.usb_mode} usb_speed=${ro.boot.usb_speed}
+    insmod /vendor/lib/modules/dwc3-thead.ko
+    insmod /vendor/lib/modules/hantrodec.ko
+    insmod /vendor/lib/modules/vc8000.ko
+    insmod /vendor/lib/modules/memalloc.ko
+    insmod /vendor/lib/modules/vidmem.ko
+    insmod /vendor/lib/modules/thead_video.ko
+    insmod /vendor/lib/modules/vi_pre.ko
+    insmod /vendor/lib/modules/vvcam_dec400.ko
+    insmod /vendor/lib/modules/vvcam_dw200.ko
+    insmod /vendor/lib/modules/vvcam_i2c.ko
+    insmod /vendor/lib/modules/vvcam_isp.ko
+    insmod /vendor/lib/modules/vvcam_isp_ry.ko
+    insmod /vendor/lib/modules/vvcam_sensor.ko
+    insmod /vendor/lib/modules/vvcam_soc.ko
+    insmod /vendor/lib/modules/bm_visys.ko
+    insmod /vendor/lib/modules/bm_csi.ko
+    insmod /vendor/lib/modules/galcore.ko
+    chmod 0666 /dev/mem
+    chmod 0666 /dev/vidmem
+    setprop vendor.hwc.drm.primary_display_order DSI-1
+    setprop vendor.hwc.backend_override client
+
+# We need vold early for metadata encryption
+on early-fs
+    start vold
+
+on fs
+    wait /dev/block/platform/soc/${ro.boot.bootdevice}
+    symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
+    mount_all /vendor/etc/fstab.${ro.hardware} --early
+# ZRAM setup
+    write /sys/block/zram0/comp_algorithm lz4
+    write /proc/sys/vm/page-cluster 0
+
+on late-fs
+    exec_start wait_for_keymaster
+    mount_all /vendor/etc/fstab.${ro.hardware} --late
+
+on property:sys.boot_completed=1
+# end boot time fs tune
+    write /sys/block/mmcblk0/queue/iostats 1
+    write /sys/block/mmcblk0/queue/read_ahead_kb 128
+    write /sys/block/mmcblk0/queue/nr_requests 128
+    write /dev/sys/fs/by-name/userdata/data_io_flag 8
+    write /dev/sys/fs/by-name/userdata/node_io_flag 8
+# Enable ZRAM on boot_complete
+    swapon_all /vendor/etc/fstab.enableswap
+    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
+
+on boot
+    setprop ro.hwui.layer_cache_size 48
+# Tweak background writeout
+    write /proc/sys/vm/dirty_expire_centisecs 200
+    write /proc/sys/vm/dirty_background_ratio  5
+
+# 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

+ 89 - 0
init.common.usb.rc

@@ -0,0 +1,89 @@
+on boot
+    mount configfs none /config
+    mkdir /config/usb_gadget/g1 0770 shell shell
+    mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
+    write /config/usb_gadget/g1/bcdUSB 0x0200
+    write /config/usb_gadget/g1/driver_match_existing_only 0
+    write /config/usb_gadget/g1/idVendor 0x18d1
+    write /config/usb_gadget/g1/bcdDevice 0x0223
+    write /config/usb_gadget/g1/strings/0x409/serialnumber "1234567890"
+    write /config/usb_gadget/g1/strings/0x409/manufacturer "T-Head"
+    write /config/usb_gadget/g1/strings/0x409/product "ADB Gadget"
+    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/configs/b.1 0770 shell shell
+    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
+    write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
+    write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
+    write /config/usb_gadget/g1/configs/b.1/MaxPower 500
+    mkdir /dev/usb-ffs 0775 shell shell
+    mkdir /dev/usb-ffs/adb 0770 shell shell
+    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
+    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.configfs 1
+    setprop sys.usb.ffs.aio_compat 1
+    symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
+
+on property:sys.usb.config=none && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/os_desc/use 0
+
+on property:sys.usb.config=mtp && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee1
+    write /config/usb_gadget/g1/os_desc/use 1
+    symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee2
+    write /config/usb_gadget/g1/os_desc/use 1
+    symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
+
+on property:sys.usb.config=rndis && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee3
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee4
+
+on property:sys.usb.config=ptp && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee5
+    write /config/usb_gadget/g1/os_desc/use 1
+    symlink /config/usb_gadget/g1/functions/ffs.ptp /config/usb_gadget/g1/configs/b.1/f1
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee6
+    write /config/usb_gadget/g1/os_desc/use 1
+    symlink /config/usb_gadget/g1/functions/ffs.ptp /config/usb_gadget/g1/configs/b.1/f1
+
+on property:sys.usb.config=adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee7
+
+on property:sys.usb.config=midi && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee8
+
+on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x4ee9
+
+on property:sys.usb.config=accessory && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x2d00
+
+on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x2d01
+
+on property:sys.usb.config=audio_source && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x2d02
+
+on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x2d03
+
+on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x2d04
+
+on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/idProduct 0x2d05

+ 75 - 0
init.connectivity.beaglev_ahead.rc

@@ -0,0 +1,75 @@
+on post-fs-data
+    # bluetooth
+    mkdir /data/vendor/bluetooth 0770 bluetooth bluetooth
+    #wifi
+    mkdir /data/vendor/wifi 0770 wifi wifi
+    mkdir /data/vendor/wifi/wpa 0770 wifi wifi
+    mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
+    mkdir /data/vendor/wifi/hostapd 0770 wifi wifi
+    mkdir /data/vendor/wifi/hostapd/sockets 0770 wifi wifi
+    setprop wifi.interface wlan0
+    setprop wifi.direct.interface p2p0
+
+on boot
+    chown bluetooth net_bt_admin /data/misc/bluetooth
+    mkdir /data/misc/bluedroid 0770 bluetooth net_bt_admin
+    # bluetooth LPM
+    chown bluetooth net_bt_admin /proc/bluetooth/sleep/lpm
+    chown bluetooth net_bt_admin /proc/bluetooth/sleep/btwrite
+
+    chmod 0660 /dev/ttyS4
+    chown bluetooth net_bt_admin /dev/ttyS4
+
+    # rfkill
+    chmod 0660 /sys/class/rfkill/rfkill0/state
+    chmod 0660 /sys/class/rfkill/rfkill0/type
+    chown bluetooth net_bt_admin /sys/class/rfkill/rfkill0/state
+    chown bluetooth net_bt_admin /sys/class/rfkill/rfkill0/type
+    write /sys/class/rfkill/rfkill0/state 0
+
+    # bluetooth MAC address programming
+    chown bluetooth net_bt_admin ro.bt.bdaddr_path
+    chown bluetooth net_bt_admin /system/etc/bluetooth
+    chown bluetooth net_bt_admin /data/misc/bluetooth
+
+service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
+    disabled
+    oneshot
+
+service p2p_supplicant /vendor/bin/hw/wpa_supplicant \
+    -ip2p0 -Dnl80211 -c/data/vendor/wifi/wpa/wpa_supplicant.conf \
+    -m/data/vendor/wifi/wpa/p2p_supplicant.conf \
+    -puse_p2p_group_interface=1p2p_device=1 \
+	-O/data/misc/wifi/sockets \
+    -g@android:wpa_wlan0 -dd
+    #   we will start as root and wpa_supplicant will switch to user wifi
+    #   after setting up the capabilities required for WEXT
+    #   user wifi
+    #   group wifi inet keystore
+    class main
+    socket wpa_wlan0 dgram 660 wifi wifi
+    disabled
+    oneshot
+
+service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
+    -iwlan0 -Dnl80211 -O/data/vendor/wifi/wpa/sockets \
+    -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
+    socket wpa_wlan0 dgram 660 wifi wifi
+    class late_start
+    disabled
+    oneshot
+
+service hostapd /vendor/bin/hw/hostapd
+    interface android.hardware.wifi.hostapd@1.0::IHostapd default
+    interface android.hardware.wifi.hostapd@1.1::IHostapd default
+    interface android.hardware.wifi.hostapd@1.2::IHostapd default
+    class main
+    capabilities NET_ADMIN NET_RAW
+    user wifi
+    group wifi net_raw net_admin
+    disabled
+    oneshot

+ 24 - 0
init.recovery.beaglev_ahead.rc

@@ -0,0 +1,24 @@
+on early-init
+    mount debugfs debugfs /sys/kernel/debug
+    chmod 0755 /sys/kernel/debug
+    insmod /vendor/lib/modules/roles.ko
+    insmod /vendor/lib/modules/dwc3.ko usb_mode=${ro.boot.usb_mode} usb_speed=${ro.boot.usb_speed}
+
+on fs
+    mount_all /vendor/etc/fstab.${ro.hardware}
+
+service console /system/bin/sh
+    class core
+    console
+    disabled
+    user root
+    group shell log readproc
+    seclabel u:r:shell:s0
+    setenv HOSTNAME console
+
+on property:ro.debuggable=1
+    start console
+
+on init
+    setprop sys.usb.configfs 1
+    start console

+ 88 - 0
media_codecs.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright (C) 2021 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+-->
+
+<MediaCodecs>
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="12" />
+    </Settings>
+
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_google_video.xml" />
+    <Include href="media_codecs_hantro_video.xml" />
+</MediaCodecs>

+ 134 - 0
media_codecs_performance.xml

@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+/*
+** Copyright 2021, The Android Open Source Project.
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<!-- TODO update the measured data in this file -->
+<!-- The 'range' values below are based on tests run 2022-01-18 on TH1520 -->
+
+<MediaCodecs>
+    <Encoders>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="411-414" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="411-414" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="113-131" />
+            <Limit name="measured-frame-rate-720x480" range="45-47" />
+            <Limit name="measured-frame-rate-1280x720" range="33-34" />
+            <Limit name="measured-frame-rate-1920x1080" range="15-18" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="113-131" />
+            <Limit name="measured-frame-rate-720x480" range="45-47" />
+            <Limit name="measured-frame-rate-1280x720" range="33-34" />
+            <Limit name="measured-frame-rate-1920x1080" range="15-18" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="21-24" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="400-404" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="400-404" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="17-19" />
+            <Limit name="measured-frame-rate-640x360" range="13-17" />
+            <Limit name="measured-frame-rate-1280x720" range="7-8" />
+            <Limit name="measured-frame-rate-1920x1080" range="3-4" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="17-19" />
+            <Limit name="measured-frame-rate-640x360" range="13-17" />
+            <Limit name="measured-frame-rate-1280x720" range="7-8" />
+            <Limit name="measured-frame-rate-1920x1080" range="3-4" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="196-297" />
+            <Limit name="measured-frame-rate-720x480" range="138-158" />
+            <Limit name="measured-frame-rate-1280x720" range="60-65" />
+            <Limit name="measured-frame-rate-1920x1080" range="27-31" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="1-1000" />
+            <Limit name="measured-frame-rate-352x288" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-720x480" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="1-1000" />
+            <Limit name="measured-frame-rate-720x480" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-720x480" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="1-1000" />
+            <Limit name="measured-frame-rate-640x360" range="1-1000" />
+            <Limit name="measured-frame-rate-1280x720" range="1-1000" />
+            <Limit name="measured-frame-rate-1920x1080" range="1-1000" />
+        </MediaCodec>
+    </Decoders>
+</MediaCodecs>

+ 175 - 0
overlay/frameworks/base/core/res/res/values/config.xml

@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+     for different hardware and product builds. -->
+<resources>
+
+
+    <!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION.
+         Please don't copy them, copy anything else. -->
+
+    <!-- the 5th element "resore-time" indicates the number of milliseconds to delay
+        before automatically restore the default connection.  Set -1 if the connection
+         does not require auto-restore. -->
+    <!-- the 6th element indicates boot-time dependency-met value. -->
+    <string-array translatable="false" name="networkAttributes">
+        <item>"wifi,1,1,1,-1,true"</item>
+	<item>"wifi_p2p,13,1,0,-1,true"</item>
+        <item>"ethernet,9,9,2,-1,true"</item>
+    </string-array>
+
+    <!-- WindowsManager JetPack display features -->
+    <string name="config_display_features" translatable="false">fold-[0,400,800,1280]</string>
+
+    <!-- Package name of the on-device intelligent processor for system UI
+         features. Examples include the search functionality or the app
+         predictor. -->
+    <string name="config_systemUiIntelligence" translatable="false">com.android.system.intelligence/.Ui</string>
+
+    <!-- Package name of the on-device intelligent processor for ambient audio.
+         Ambient audio is the sound surrounding the device captured by the DSP
+         or the microphone. In other words, the device is continuously
+         processing audio data in background. -->
+    <string name="config_systemAmbientAudioIntelligence" translatable="false">com.android.system.intelligence/.AmbientAudio</string>
+
+    <!-- Package name of the on-device intelligent processor for audio. The
+         difference of 'ambient audio' and 'audio' is that in 'audio', the
+         user intentionally and consciously aware that the device is recording
+         or using the microphone.
+         -->
+    <string name="config_systemAudioIntelligence" translatable="false">com.android.system.intelligence/.Audio</string>
+
+     <!-- Package name of the on-device intelligent processor for notification.
+         -->
+    <string name="config_systemNotificationIntelligence" translatable="false">com.android.system.intelligence/.Notification</string>
+
+    <!-- Package name of the on-device intelligent processor for text. Examples
+        include providing autofill functionality based on incoming text
+        messages. -->
+    <string name="config_systemTextIntelligence" translatable="false">com.android.system.intelligence/.Text</string>
+
+    <!-- Package name of the on-device intelligent processor for visual
+         features. Examples include the autorotate feature. -->
+    <string name="config_systemVisualIntelligence" translatable="false">com.android.system.intelligence/.Visual</string>
+
+    <!-- Separate software navigation bar required on this device. -->
+    <bool name="config_showNavigationBar">true</bool>
+
+    <!-- Launcher customization requires AppWidgetService, but otherwise
+         home screen widgets are not supported on TV -->
+    <bool name="config_enableAppWidgetService">true</bool>
+
+    <!-- Enable doze mode -->
+    <bool name="config_enableAutoPowerModes">true</bool>
+    <bool name="config_autoPowerModeUseMotionSensor">false</bool>
+
+    <!-- The package name for the system's translation service.
+     This service must be trusted, as it can be activated without explicit consent of the user.
+     If no service with the specified name exists on the device, translation wil be
+     disabled.
+     Example: "com.android.translation/.TranslationService"
+    -->
+    <string name="config_defaultTranslationService">com.android.translation/.TranslationService</string>
+
+    <!-- The package name for the system's app prediction service.
+         This service must be trusted, as it can be activated without explicit consent of the user.
+         Example: "com.android.intelligence/.AppPredictionService"
+    -->
+    <string name="config_defaultAppPredictionService">com.android.intelligence/.AppPredictionService</string>
+
+    <!-- The package name for the system's content suggestions service.
+         Provides suggestions for text and image selection regions in snapshots of apps and should
+         be able to classify the type of entities in those selections.
+
+         This service must be trusted, as it can be activated without explicit consent of the user.
+         If no service with the specified name exists on the device, content suggestions wil be
+         disabled.
+         Example: "com.android.contentsuggestions/.ContentSuggestionsService"
+    -->
+    <string name="config_defaultContentSuggestionsService">com.android.contentsuggestions/.ContentSuggestionsService</string>
+
+
+    <!-- The package name for the system's content capture service.
+         This service must be trusted, as it can be activated without explicit consent of the user.
+         If no service with the specified name exists on the device, content capture will be
+         disabled.
+         Example: "com.android.contentcapture/.ContentcaptureService"
+    -->
+    <string name="config_defaultContentCaptureService" translatable="false">com.android.contentcapture/.ContentcaptureService</string>
+
+
+    <!-- The package name for the system's augmented autofill service.
+         This service must be trusted, as it can be activated without explicit consent of the user.
+         If no service with the specified name exists on the device, augmented autofill wil be
+         disabled.
+         Example: "com.android.augmentedautofill/.AugmentedAutofillService"
+    -->
+    <string name="config_defaultAugmentedAutofillService" translatable="false">com.android.augmentedautofill/.AugmentedAutofillService</string>
+
+
+    <string name="config_defaultMusicRecognitionService" translatable="false">com.android.musicrecognition/.MusicRecognitionService</string>
+
+    <!-- List of regexpressions describing the interface (if any) that represent tetherable
+         Wifi interfaces.  If the device doesn't want to support tethering over Wifi this
+         should be empty.  An example would be "softap.*" -->
+    <string-array translatable="false" name="config_tether_wifi_regexs">
+        <item>"wlan0"</item>
+    </string-array>
+
+    <!--  Maximum number of supported users -->
+    <integer name="config_multiuserMaximumUsers">4</integer>
+    <!--  Whether Multiuser UI should be shown -->
+    <bool name="config_enableMultiUserUI">true</bool>
+
+    <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering.
+
+         Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
+         [1,7,0] for TYPE_WIFI, TYPE_BLUETOOTH, and TYPE_MOBILE.
+
+         This list is also modified by code within the framework, including:
+
+             - TYPE_ETHERNET (9) is prepended to this list, and
+
+             - the return value of TelephonyManager.getTetherApnRequired()
+               determines how the array is further modified:
+
+                   * TRUE (DUN REQUIRED).
+                     TYPE_MOBILE is removed (if present).
+                     TYPE_MOBILE_HIPRI is removed (if present).
+                     TYPE_MOBILE_DUN is appended (if not already present).
+
+                   * FALSE (DUN NOT REQUIRED).
+                     TYPE_MOBILE_DUN is removed (if present).
+                     If both of TYPE_MOBILE{,_HIPRI} are not present:
+                        TYPE_MOBILE is appended.
+                        TYPE_MOBILE_HIPRI is appended.
+
+         For other changes applied to this list, now and in the future, see
+         com.android.server.connectivity.tethering.TetheringConfiguration.
+
+         Note also: the order of this is important. The first upstream type
+         for which a satisfying network exists is used.
+    -->
+    <integer-array translatable="false" name="config_tether_upstream_types">
+        <item>1</item>
+        <item>9</item>
+    </integer-array>
+
+</resources>

+ 7 - 0
overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <integer name="def_screen_off_timeout">2147483647</integer>
+    <bool name="def_lockscreen_disabled">true</bool>
+    <bool name="def_stay_on_while_plugged_in">true</bool>
+    <bool name="def_show_ime_with_hard_keyboard">true</bool>
+</resources>

+ 12 - 0
product_config.mk

@@ -0,0 +1,12 @@
+FEATURE_BLUETOOTH := false
+FEATURE_WIFI := false
+FEATURE_CAMERA := false
+FEATURE_LOCATION_GPS := false
+FEATURE_SENSOR := false
+FEATURE_NFC := false
+FEATURE_FINGERPRINT := false
+FEATURE_MICROPHONE := true
+FEATURE_TELEPHONY := false
+FEATURE_USB_HOST := true
+FEATURE_USB_ACCESSORY := true
+

+ 27 - 0
ueventd.beaglev_ahead.rc

@@ -0,0 +1,27 @@
+/dev/dri/card0             0666   system     system
+/dev/ion                   0666   system     system
+/dev/pvr_sync              0666   system     system
+/dev/hantrodec             0666   system     system
+/dev/vc8000                0666   system     system
+/dev/vha0                  0666   system     system
+/dev/vidmem                0660   system     system
+/dev/galcore               0666   system     system
+
+# obsolete device nodes, for backwards compatibility
+/dev/dbgdrv                0666   system     system
+/dev/pvrsrvkm              0666   system     system
+/dev/sw_sync               0666   system     system
+
+# camera nodes
+/dev/video*                0660   system     camera
+/dev/vipre*                0660   system     camera
+/dev/vivcam*               0660   system     camera
+/dev/vivdw200              0660   system     camera
+/dev/vivisp*               0660   system     camera
+/dev/vivisp_ry*            0660   system     camera
+/dev/vivsoc*               0660   system     camera
+/dev/bm_csi*               0660   system     camera
+/dev/bm_visys*             0660   system     camera
+/dev/i2c-8                 0660   system     camera
+/dev/i2c-9                 0660   system     camera
+/dev/dec*                  0660   system     camera