From 3f07847d630bc2dc730a09990c5c39940f9f1626 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Wed, 1 Apr 2020 22:14:17 +0000 Subject: Introducing sargo_car ... ...the new member of "Android Automotive on Phones Family". Bug: 151345745 Test: . ./build/envsetup.sh && lunch sargo_car && m && ./vendor/google/tools/flashall -w Change-Id: I24e323985cd259cd4e0cbd09fc65c207c420ddef --- AndroidProducts.mk | 6 +- sargo_car/aosp_sargo_car.mk | 132 ++++++++++++++++++++ sargo_car/audio_effects.xml | 98 +++++++++++++++ sargo_car/device-common.mk | 137 +++++++++++++++++++++ sargo_car/device-sargo-car.mk | 42 +++++++ sargo_car/manifest.xml | 57 +++++++++ .../services/Car/service/res/values/config.xml | 26 ++++ 7 files changed, 496 insertions(+), 2 deletions(-) create mode 100644 sargo_car/aosp_sargo_car.mk create mode 100644 sargo_car/audio_effects.xml create mode 100644 sargo_car/device-common.mk create mode 100644 sargo_car/device-sargo-car.mk create mode 100644 sargo_car/manifest.xml create mode 100644 sargo_car/overlay/packages/services/Car/service/res/values/config.xml diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 1a31316..3478704 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -18,10 +18,12 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/blueline_car/aosp_blueline_car.mk \ $(LOCAL_DIR)/flame_car/aosp_flame_car.mk \ $(LOCAL_DIR)/coral_car/aosp_coral_car.mk \ - $(LOCAL_DIR)/crosshatch_car/aosp_crosshatch_car.mk + $(LOCAL_DIR)/crosshatch_car/aosp_crosshatch_car.mk \ + $(LOCAL_DIR)/bonito_car/aosp_bonito_car.mk COMMON_LUNCH_CHOICES := \ aosp_blueline_car-userdebug \ aosp_flame_car-userdebug \ aosp_coral_car-userdebug \ - aosp_crosshatch_car-userdebug + aosp_crosshatch_car-userdebug \ + aosp_bonito_car-userdebug diff --git a/sargo_car/aosp_sargo_car.mk b/sargo_car/aosp_sargo_car.mk new file mode 100644 index 0000000..b538ce4 --- /dev/null +++ b/sargo_car/aosp_sargo_car.mk @@ -0,0 +1,132 @@ +# +# Copyright 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DEVICE_FRAMEWORK_MANIFEST_FILE += device/google_car/sargo_car/manifest.xml + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) + +# mainline_system.mk sets 'PRODUCT_ENFORCE_RRO_TARGETS := *' +# but this breaks sargo_car. So undo it here. +PRODUCT_ENFORCE_RRO_TARGETS := + +# Enable mainline checking +# TODO(b/138706293): Enable mainline checking later +# PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk) + +# +# All components inherited here go to product image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk) + +# Auto modules +PRODUCT_PACKAGES += \ + android.hardware.broadcastradio@2.0-service \ + android.hardware.automotive.vehicle@2.0-service + +PRODUCT_PACKAGES += \ + android.hardware.automotive.audiocontrol@1.0-service + +# Car init.rc +PRODUCT_COPY_FILES += \ + packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc \ + packages/services/Car/car_product/init/init.car.rc:root/init.car.rc + +# Override heap growth limit due to high display density on device +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.heapgrowthlimit=256m + +PRODUCT_PACKAGE_OVERLAYS += device/google_car/sargo_car/overlay + +# Pre-create users +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + android.car.number_pre_created_users=1 \ + android.car.number_pre_created_guests=1 + +# Enable landscape +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml + +# Vendor Interface Manifest +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml + +TARGET_USES_CAR_FUTURE_FEATURES := true + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/car_core_hardware.xml:system/etc/permissions/car_core_hardware.xml \ + frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \ + frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \ + frameworks/native/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \ + frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ + frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \ + frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \ + frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml + +# broadcast radio feature + PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml + +# EVS v1.1 +PRODUCT_PACKAGES += android.automotive.evs.manager@1.1 \ + android.hardware.automotive.evs@1.1-sample \ + evs_app +PRODUCT_PRODUCT_PROPERTIES += persist.automotive.evs.mode=0 + +# Automotive display service +PRODUCT_PACKAGES += android.frameworks.automotive.display@1.0-service + +# +# All components inherited here go to vendor image +# +# TODO(b/136525499): move *_vendor.mk into the vendor makefile later +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk) + +$(call inherit-product, device/google_car/sargo_car/device-sargo-car.mk) +$(call inherit-product-if-exists, vendor/google_devices/bonito/proprietary/device-vendor.mk) + + +PRODUCT_COPY_FILES += $(LOCAL_PATH)/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml + +# STOPSHIP deal with Qualcomm stuff later +# PRODUCT_RESTRICT_VENDOR_FILES := all + +# TODO: line below was set on aosp_sargo.mk, but it's not included on other _car +# projects +# PRODUCT_PACKAGES += com.android.vndk.current.on_vendor + +PRODUCT_MANUFACTURER := Google +PRODUCT_BRAND := Android +PRODUCT_NAME := aosp_sargo_car +PRODUCT_DEVICE := sargo +PRODUCT_MODEL := AOSP on sargo diff --git a/sargo_car/audio_effects.xml b/sargo_car/audio_effects.xml new file mode 100644 index 0000000..5bb453c --- /dev/null +++ b/sargo_car/audio_effects.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sargo_car/device-common.mk b/sargo_car/device-common.mk new file mode 100644 index 0000000..830de03 --- /dev/null +++ b/sargo_car/device-common.mk @@ -0,0 +1,137 @@ +# +# Copyright (C) 2020 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# NOTE: this file was copied from google/device/bonito/device-common.mk, with the +# following changes +# - removed LOCAL_PATH +# - added auto-specific settings at the end + +TARGET_USERIMAGES_USE_F2FS := true + +# define hardware platform +PRODUCT_PLATFORM := sdm670 + +# Enable updating of APEXes +$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) + +# Enable userspace reboot +$(call inherit-product, $(SRC_TARGET_DIR)/product/userspace_reboot.mk) + +include device/google/bonito/device-audio-mfg.mk +include device/google/bonito/device.mk + +# Bug 77867216 +PRODUCT_PROPERTY_OVERRIDES += audio.adm.buffering.ms=3 +PRODUCT_PROPERTY_OVERRIDES += vendor.audio.adm.buffering.ms=3 +PRODUCT_PROPERTY_OVERRIDES += audio_hal.period_multiplier=2 +PRODUCT_PROPERTY_OVERRIDES += af.fast_track_multiplier=1 + +# Set c2 codec in default +PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.ccodec=4 +PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank=512 + +# Setting vendor SPL +VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) + +# Set boot SPL +BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) + +# MIDI feature +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml + +# Audio low latency feature +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml + +# Pro audio feature +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml + +# Enable AAudio MMAP/NOIRQ data path. +# 1 is AAUDIO_POLICY_NEVER means only use Legacy path. +# 2 is AAUDIO_POLICY_AUTO means try MMAP then fallback to Legacy path. +# 3 is AAUDIO_POLICY_ALWAYS means only use MMAP path. +PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_policy=2 +# 1 is AAUDIO_POLICY_NEVER means only use SHARED mode +# 2 is AAUDIO_POLICY_AUTO means try EXCLUSIVE then fallback to SHARED mode. +# 3 is AAUDIO_POLICY_ALWAYS means only use EXCLUSIVE mode. +PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_exclusive_policy=2 + +# Increase the apparent size of a hardware burst from 1 msec to 2 msec. +# A "burst" is the number of frames processed at one time. +# That is an increase from 48 to 96 frames at 48000 Hz. +# The DSP will still be bursting at 48 frames but AAudio will think the burst is 96 frames. +# A low number, like 48, might increase power consumption or stress the system. +PRODUCT_PROPERTY_OVERRIDES += aaudio.hw_burst_min_usec=2000 + +# Set lmkd options +PRODUCT_PRODUCT_PROPERTIES += \ + ro.config.low_ram = false \ + ro.lmk.log_stats = true \ + +# A2DP offload enabled for compilation +AUDIO_FEATURE_ENABLED_A2DP_OFFLOAD := true + +# A2DP offload supported +PRODUCT_PROPERTY_OVERRIDES += \ +ro.bluetooth.a2dp_offload.supported=true + +# A2DP offload disabled (UI toggle property) +PRODUCT_PROPERTY_OVERRIDES += \ +persist.bluetooth.a2dp_offload.disabled=false + +# A2DP offload DSP supported encoder list +PRODUCT_PROPERTY_OVERRIDES += \ +persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac + +# Modem loging file +PRODUCT_COPY_FILES += \ + device/google/bonito/init.logging.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).logging.rc + +# Dumpstate HAL +PRODUCT_PACKAGES += \ + android.hardware.dumpstate@1.0-service.bonito + +# Enable retrofit dynamic partitions for all bonito +# and sargo targets +PRODUCT_USE_DYNAMIC_PARTITIONS := true +PRODUCT_RETROFIT_DYNAMIC_PARTITIONS := true +PRODUCT_PACKAGES += \ + android.hardware.boot@1.0-impl.recovery \ + bootctrl.sdm710 \ + bootctrl.sdm710.recovery \ + check_dynamic_partitions \ + +AB_OTA_POSTINSTALL_CONFIG += \ + RUN_POSTINSTALL_product=true \ + POSTINSTALL_PATH_product=bin/check_dynamic_partitions \ + FILESYSTEM_TYPE_product=ext4 \ + POSTINSTALL_OPTIONAL_product=false \ + +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_color_management=true +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.protected_contents=true + +# Set thermal warm reset +PRODUCT_PRODUCT_PROPERTIES += \ + ro.thermal_warmreset = true \ + +############################## +### Auto-specific settings ### +############################## + +# Sepolicy for EVS +BOARD_SEPOLICY_DIRS += packages/services/Car/evs/sepolicy diff --git a/sargo_car/device-sargo-car.mk b/sargo_car/device-sargo-car.mk new file mode 100644 index 0000000..54e836d --- /dev/null +++ b/sargo_car/device-sargo-car.mk @@ -0,0 +1,42 @@ +# +# Copyright 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +PRODUCT_HARDWARE := sargo + +$(call inherit-product, packages/services/Car/car_product/build/car.mk) +include device/google_car/sargo_car/device-common.mk +include packages/services/Car/computepipe/products/computepipe.mk + +PRODUCT_COPY_FILES += \ + device/google/bonito/init.insmod.sargo.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/init.insmod.cfg + +DEVICE_PACKAGE_OVERLAYS += device/google/bonito/sargo/overlay + +# Audio XMLs +PRODUCT_COPY_FILES += \ + device/google/bonito/mixer_paths_intcodec_s4.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_intcodec_s4.xml \ + device/google/bonito/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ + device/google/bonito/audio_platform_info_intcodec_s4.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_intcodec_s4.xml + +PRODUCT_COPY_FILES += \ + device/google/bonito/nfc/libnfc-nxp.sargo.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nxp.conf + +PRODUCT_PACKAGES += \ + NoCutoutOverlay + +# TODO: property below is set on other _car projects, but it doesn't seem to be +# needed - looks like 250 is already the default value +# PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density=250 diff --git a/sargo_car/manifest.xml b/sargo_car/manifest.xml new file mode 100644 index 0000000..c8bafd3 --- /dev/null +++ b/sargo_car/manifest.xml @@ -0,0 +1,57 @@ + + + + + android.hardware.automotive.vehicle + hwbinder + 2.0 + + IVehicle + default + + + + android.hardware.automotive.audiocontrol + hwbinder + 1.0 + + IAudioControl + default + + + + + android.hardware.broadcastradio + hwbinder + 2.0 + + IBroadcastRadio + amfm + dab + + + + android.automotive.computepipe.registry + + IPipeQuery + router + + + IPipeRegistration + router + + + diff --git a/sargo_car/overlay/packages/services/Car/service/res/values/config.xml b/sargo_car/overlay/packages/services/Car/service/res/values/config.xml new file mode 100644 index 0000000..8116e7b --- /dev/null +++ b/sargo_car/overlay/packages/services/Car/service/res/values/config.xml @@ -0,0 +1,26 @@ + + + + + + + + false + -- cgit v1.2.3