blob: 42d2eb464ba0766788edcace3873bf7e5bc1a5aa [file] [log] [blame]
# Copyright 2018-2019 Fairphone B.V.
#
# 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.
#
# For PRODUCT_COPY_FILES, the first instance takes precedence.
# Stop here if we already tried to download the blobs and notified how to
# download them.
ifeq ("$(BLOBS_MISSING_NOTIFIED)","TRUE")
$(error)
endif
BLOBS_PATH = $(abspath device/fairphone/fp2-proprietary)
GET_BLOBS_CMD = vendor/fairphone/tools/bin/get_blobs.py --device FP2 --build-id $(BUILD_ID) --blobs-dir $(BLOBS_PATH)
CHECK_BLOBS_EXIST = $(wildcard $(BLOBS_PATH)/device-vendor.mk)
# Download the blobs if they don't exist.
ifeq ("$(CHECK_BLOBS_EXIST)","")
$(shell python3 $(GET_BLOBS_CMD) >&2)
endif
# Prompt the user if something went wrong.
ifeq ("$(CHECK_BLOBS_EXIST)","")
define BLOBS_INSTRUCTION
Cannot find FP2 binary blobs.
Please run
python3 $(GET_BLOBS_CMD)
and accept the terms of agreement.
endef
BLOBS_MISSING_NOTIFIED = TRUE
$(error $(BLOBS_INSTRUCTION))
endif
# Call the vendor setup
$(call inherit-product-if-exists, vendor/fairphone/fp2-common/device-vendor.mk)
# Call the proprietary setup
$(call inherit-product, $(BLOBS_PATH)/device-vendor.mk)
# This is needed for the 2016 June official Nexus 5 driver's glsub
TARGET_USE_COMPAT_GRALLOC_PERFORM := true
# Define the build number based on the product flavour and on the build manifest
# revision
ifneq (,$(strip $(PRODUCT_FLAVOR)))
_BUILD_MANIFEST_REV := $(shell (git -C $(TOPDIR).repo/manifests rev-parse --short=8 HEAD))
BUILD_NUMBER := $(PRODUCT_FLAVOR)-$(_BUILD_MANIFEST_REV)
else
$(error PRODUCT_FLAVOR must be defined)
endif
$(warning Build defined as $(BUILD_ID) ($(BUILD_NUMBER)))
# APN configuration
PRODUCT_COPY_FILES += \
device/fairphone/fp2-common/rootdir/system/etc/apns-conf.xml:system/etc/apns-conf.xml \
device/fairphone/fp2-common/rootdir/system/etc/old-apns-conf.xml:system/etc/old-apns-conf.xml
# Fairphone Common framework
$(call inherit-product, vendor/fairphone/frameworks/common/common.mk)
# camera_detect
$(call inherit-product, device/fairphone/fp2-common/camera_detect/camera_detect.mk)
# Experimental OpenGL ES 3.0 support for Android 7 (and higher)
PRODUCT_PACKAGES += \
init.fp.exp_gles3_setup.sh
# TODO Clean everything up below this line
CYNGN_TARGET := true
# Inherit from those products. Most specific first.
$(warning Pulling in full basic telephony)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
## Use the latest approved GMS identifiers unless running a signed build
# ifneq ($(SIGN_BUILD),true)
# PRODUCT_BUILD_PROP_OVERRIDES += \
# BUILD_FINGERPRINT=Fairphone/FP2/FP2:7.1.2/N2G47H/FP2-gms-17.09.3:user/release-keys
# PRIVATE_BUILD_DESC="FP2-user no clue what to put here"
# endif
# PRODUCT_NAME := aosp_FP2
# From FP2.mk
DEVICE_PACKAGE_OVERLAYS += device/fairphone/fp2-common/overlay
# PRODUCT_PACKAGE_OVERLAYS += device/fairphone/fp2-common/overlay
# TODO move to device?
LOCAL_TEMP := device/fairphone/FP2
# Media
PRODUCT_COPY_FILES += \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/media/media_codecs_8974.xml:system/etc/media_codecs.xml \
$(LOCAL_TEMP)/media/media_codecs_performance.xml:system/etc/media_codecs_performance.xml \
$(LOCAL_TEMP)/media/media_profiles_8974.xml:system/etc/media_profiles.xml
# IPC router
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/configs/sec_config:system/etc/sec_config
# Audio
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_Bluetooth_cal.acdb:system/etc/acdbdata/MTP/MTP_Bluetooth_cal.acdb \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_General_cal.acdb:system/etc/acdbdata/MTP/MTP_General_cal.acdb \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_Global_cal.acdb:system/etc/acdbdata/MTP/MTP_Global_cal.acdb \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_Handset_cal.acdb:system/etc/acdbdata/MTP/MTP_Handset_cal.acdb \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_Hdmi_cal.acdb:system/etc/acdbdata/MTP/MTP_Hdmi_cal.acdb \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_Headset_cal.acdb:system/etc/acdbdata/MTP/MTP_Headset_cal.acdb \
$(LOCAL_TEMP)/audio/acdbdata/MTP/MTP_Speaker_cal.acdb:system/etc/acdbdata/MTP/MTP_Speaker_cal.acdb
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/audio/audio_effects.conf:system/vendor/etc/audio_effects.conf \
$(LOCAL_TEMP)/audio/audio_policy.conf:system/etc/audio_policy.conf \
$(LOCAL_TEMP)/audio/mixer_paths.xml:system/etc/mixer_paths.xml \
$(LOCAL_TEMP)/audio/mixer_paths_auxpcm.xml:system/etc/mixer_paths_auxpcm.xml
PRODUCT_PACKAGES += \
audio.a2dp.default \
audio.primary.msm8974 \
audio.r_submix.default \
audio.usb.default \
audio_policy.msm8974 \
audiod \
libbthost_if \
libqcompostprocbundle \
libqcomvisualizer \
libqcomvoiceprocessing \
libqcomvoiceprocessingdescriptors \
tinymix
# Boot animation
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
# Media
PRODUCT_PACKAGES += \
libOmxAacEnc \
libOmxAmrEnc \
libOmxCore \
libOmxEvrcEnc \
libOmxQcelp13Enc \
libOmxVdec \
libOmxVenc \
libc2dcolorconvert \
libdivxdrmdecrypt \
libstagefrighthw
PRODUCT_PACKAGES += \
ebtables \
ethertypes \
libbson \
libcnefeatureconfig \
libnl_2 \
libtinyxml \
libxml2
# Data
PRODUCT_PACKAGES += \
librmnetctl
# USB
PRODUCT_PACKAGES += \
init.qcom.usb.sh
# Dalvik/HWUI
$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-2048-dalvik-heap.mk)
$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-2048-hwui-memory.mk)
# Display
PRODUCT_AAPT_CONFIG := normal
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
# Graphics
PRODUCT_PACKAGES += \
copybit.msm8974 \
gralloc.msm8974 \
hwcomposer.msm8974 \
liboverlay \
memtrack.msm8974
# Features
PRODUCT_COPY_FILES += \
external/ant-wireless/antradio-library/com.dsi.ant.antradio_library.xml:system/etc/permissions/com.dsi.ant.antradio_library.xml \
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.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.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:system/etc/permissions/android.hardware.sensor.stepcounter.xml \
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:system/etc/permissions/android.hardware.sensor.stepdetector.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.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.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.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.software.midi.xml:system/etc/permissions/android.software.midi.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml
# Ramdisk
PRODUCT_PACKAGES += \
fstab.qcom \
init.qcom.power.rc \
init.qcom.rc \
init.qcom.usb.rc \
ueventd.qcom.rc
PRODUCT_PACKAGES += \
init.qcom.bt.sh
# Power
PRODUCT_PACKAGES += \
power.msm8974
# Thermal
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/configs/thermal-engine-8974.conf:system/etc/thermal-engine-8974.conf
# Input device files
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/configs/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl
# Wifi
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/wifi/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \
$(LOCAL_TEMP)/wifi/WCNSS_qcom_cfg.ini:system/etc/wifi/WCNSS_qcom_cfg.ini \
$(LOCAL_TEMP)/wifi/WCNSS_qcom_wlan_nv.bin:system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin
PRODUCT_PACKAGES += \
hostapd \
wcnss_service \
wpa_supplicant
PRODUCT_PACKAGES += \
hostapd.accept \
hostapd.deny \
hostapd_default.conf \
p2p_supplicant_overlay.conf \
wpa_supplicant.conf \
wpa_supplicant_overlay.conf
# ANT stack
PRODUCT_PACKAGES += \
AntHalService \
com.dsi.ant.antradio_library \
libantradio
# GPS
PRODUCT_PACKAGES += \
gps.msm8974
PRODUCT_COPY_FILES += \
$(LOCAL_TEMP)/gps/flp.conf:system/etc/flp.conf \
$(LOCAL_TEMP)/gps/gps.conf:system/etc/gps.conf \
$(LOCAL_TEMP)/gps/izat.conf:system/etc/izat.conf \
$(LOCAL_TEMP)/gps/quipc.conf:system/etc/quipc.conf \
$(LOCAL_TEMP)/gps/sap.conf:system/etc/sap.conf
# Lights
PRODUCT_PACKAGES += \
lights.msm8974
# Keystore
PRODUCT_PACKAGES += \
keystore.msm8974
# FM radio
PRODUCT_PACKAGES += \
FM2 \
FMRecord \
qcom.fmradio \
init.qcom.fm.sh
# Camera
PRODUCT_PACKAGES += \
camera.msm8974 \
libqomx_core \
libmmcamera_interface \
libmmjpeg_interface \
mm-jpeg-interface-test \
mm-qcamera-app \
Camera2
# Stagefright FFMPEG plugin
#PRODUCT_PACKAGES += \
# libffmpeg_extractor \
# libffmpeg_omx \
# media_codecs_ffmpeg.xml
#PRODUCT_PROPERTY_OVERRIDES += \
# media.sf.omx-plugin=libffmpeg_omx.so \
# media.sf.extractor-plugin=libffmpeg_extractor.so
# The product flavours will set PRODUCT_NAME and PRODUCT_MODEL to something else
# but really, we are not allowed to change it because it was certified like this.
# To not break the build system and still have some properties set with the fancy
# flavour name, we only override the variables in the generated build.prop file.
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_MODEL=FP2 PRODUCT_NAME=FP2
PRODUCT_MANUFACTURER := Fairphone
PRODUCT_BRAND := Fairphone
PRODUCT_DEVICE := FP2
$(call inherit-product, build/target/product/product_launched_with_l_mr1.mk)