| # Copyright 2018-2020 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. |
| # |
| |
| 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 the presence of proprietary blobs |
| ifeq ("$(wildcard $(BLOBS_PATH)/device-vendor.mk)","") |
| define BLOBS_INSTRUCTION |
| |
| |
| Cannot find FP2 binary blobs. |
| |
| Please run |
| |
| python3 $(GET_BLOBS_CMD) |
| |
| and accept the terms of agreement. |
| |
| |
| endef |
| $(error $(BLOBS_INSTRUCTION)) |
| endif |
| |
| # Call the vendor setup |
| $(call inherit-product-if-exists, vendor/fairphone/fp2-common/device-vendor.mk) |
| |
| # camera_detect |
| $(call inherit-product-if-exists, device/fairphone/fp2-common/camera_detect/camera_detect.mk) |
| |
| # setup dalvik vm configs. |
| $(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) |
| |
| # we don't have the calibration data so don't generate persist.img |
| FP2_SKIP_PERSIST_IMG := true |
| |
| # disable network scan for lack of ril support |
| TARGET_DISCARD_NETWORK_SCAN := true |
| |
| # This is needed for the 2016 June official Nexus 5 driver's glsub |
| TARGET_USE_COMPAT_GRALLOC_PERFORM := true |
| |
| # Common definitions to set undefined properties |
| $(call inherit-product, device/qcom/common/common.mk) |
| |
| |
| # Call the proprietary setup |
| $(call inherit-product, $(BLOBS_PATH)/device-vendor.mk) |
| |
| TARGET_USES_QCOM_BSP := true |
| TARGET_USES_QCA_NFC := other |
| |
| ifeq ($(TARGET_USES_QCOM_BSP), true) |
| # Add QC Video Enhancements flag |
| TARGET_ENABLE_QC_AV_ENHANCEMENTS := true |
| endif #TARGET_USES_QCOM_BSP |
| |
| PRODUCT_DEVICE := FP2 |
| PRODUCT_BRAND := Fairphone |
| PRODUCT_MANUFACTURER := Fairphone |
| |
| # The product flavors 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 |
| |
| # 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) |
| HAS_BUILD_NUMBER := true |
| else |
| $(error PRODUCT_FLAVOR must be defined) |
| endif |
| $(warning Build defined as $(BUILD_ID) ($(BUILD_NUMBER))) |
| |
| |
| DEVICE_PACKAGE_OVERLAYS += device/fairphone/fp2-common/overlay |
| |
| # Do not enable data roaming by default |
| PRODUCT_PROPERTY_OVERRIDES := $(filter-out ro.com.android.dataroaming=%,\ |
| $(PRODUCT_PROPERTY_OVERRIDES)) \ |
| ro.com.android.dataroaming=false |
| |
| # Set default alarm sound |
| PRODUCT_PROPERTY_OVERRIDES += \ |
| ro.config.alarm_alert=Cesium.ogg |
| |
| # Allow mediaserver to allocate up to 75% of total RAM |
| PRODUCT_PROPERTY_OVERRIDES += \ |
| ro.media.maxmem=1451891712 |
| |
| # Enable strict operation |
| PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ |
| persist.sys.strict_op_enable=false |
| |
| PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ |
| persist.sys.whitelist=/system/etc/whitelist_appops.xml |
| |
| PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ |
| camera2.portability.force_api=1 |
| |
| |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/fp2-common/rootdir/system/etc/old-apns-conf.xml:system/etc/old-apns-conf.xml \ |
| device/fairphone/fp2-common/rootdir/system/etc/apns-conf.xml:system/etc/apns-conf.xml |
| |
| # MIDI feature |
| PRODUCT_COPY_FILES += \ |
| frameworks/native/data/etc/android.software.midi.xml:system/etc/permissions/android.software.midi.xml |
| |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/whitelist_appops.xml:system/etc/whitelist_appops.xml |
| |
| # WiFi driver |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/wifi/WCNSS_qcom_cfg.ini:system/etc/wifi/WCNSS_qcom_cfg.ini |
| |
| ifneq ($(strip $(FP2_SKIP_PERSIST_IMG)),true) |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/wifi/WCNSS_qcom_wlan_nv.bin:persist/WCNSS_qcom_wlan_nv.bin |
| endif |
| |
| # WiFi |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/wifi/WCNSS_cfg.dat:$(TARGET_COPY_OUT_VENDOR)/firmware/wlan/prima/WCNSS_cfg.dat \ |
| device/fairphone/FP2/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/firmware/wlan/prima/WCNSS_qcom_cfg.ini \ |
| device/fairphone/FP2/wifi/WCNSS_qcom_wlan_nv.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin |
| |
| # Features |
| PRODUCT_COPY_FILES += \ |
| external/ant-wireless/antradio-library/com.dsi.ant.antradio_library.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.dsi.ant.antradio_library.xml \ |
| frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \ |
| frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ |
| frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ |
| frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \ |
| frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \ |
| frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \ |
| frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \ |
| frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ |
| frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.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.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.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \ |
| frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \ |
| frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \ |
| |
| # Media |
| PRODUCT_COPY_FILES += \ |
| 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_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \ |
| frameworks/av/media/libstagefright/data/media_codecs_google_tv.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_tv.xml |
| |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/media/media_codecs_8974.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ |
| device/fairphone/FP2/media/media_codecs_google_video_8974.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video_8974.xml \ |
| device/fairphone/FP2/media/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \ |
| device/fairphone/FP2/media/media_profiles_8974.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml |
| |
| # Audio |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_Bluetooth_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_Bluetooth_cal.acdb \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_General_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_General_cal.acdb \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_Global_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_Global_cal.acdb \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_Handset_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_Handset_cal.acdb \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_Hdmi_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_Hdmi_cal.acdb \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_Headset_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_Headset_cal.acdb \ |
| device/fairphone/FP2/audio/acdbdata/MTP/MTP_Speaker_cal.acdb:$(TARGET_COPY_OUT_SYSTEM)/etc/acdbdata/MTP/MTP_Speaker_cal.acdb |
| |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ |
| device/fairphone/FP2/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ |
| device/fairphone/FP2/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml \ |
| device/fairphone/FP2/audio/mixer_paths_auxpcm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_auxpcm.xml |
| |
| PRODUCT_COPY_FILES += \ |
| frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ |
| frameworks/av/services/audiopolicy/config/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/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ |
| frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml |
| |
| # Seccomp |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/seccomp/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy |
| |
| # Boot animation |
| PRODUCT_COPY_FILES += \ |
| vendor/fairphone/media/bootanimation/fp2.zip:system/media/bootanimation.zip |
| |
| # Display logo image file |
| PRODUCT_PACKAGES += \ |
| libqcomvisualizer \ |
| libqcomvoiceprocessing \ |
| libqcompostprocbundle |
| |
| # battery_monitor |
| PRODUCT_PACKAGES += \ |
| battery_monitor \ |
| battery_shutdown |
| |
| # fstab.qcom |
| PRODUCT_PACKAGES += fstab.qcom |
| |
| # Thermal |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/configs/thermal-engine-8974.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-8974.conf |
| |
| # WiFi |
| PRODUCT_PACKAGES += \ |
| hostapd \ |
| wcnss_service \ |
| wpa_supplicant |
| |
| PRODUCT_PACKAGES += \ |
| p2p_supplicant_overlay.conf \ |
| wpa_supplicant.conf \ |
| wpa_supplicant_overlay.conf |
| |
| # ANT stack |
| PRODUCT_PACKAGES += \ |
| AntHalService \ |
| libantradio \ |
| ANTRadioService \ |
| antradio_app |
| |
| # Radio |
| PRODUCT_PACKAGES += \ |
| libril-wrapper |
| |
| # include an expanded selection of fonts for the SDK. |
| EXTENDED_FONT_FOOTPRINT := true |
| |
| # remove /dev/diag in user version for CTS |
| ifeq ($(TARGET_BUILD_VARIANT),user) |
| PRODUCT_COPY_FILES += device/qcom/common/rootdir/etc/init.qcom.diag.rc.user:root/init.qcom.diag.rc |
| endif |
| |
| # Enable the diagnostics interface by default in userdebug and eng builds |
| ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
| PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ |
| persist.sys.usb.config=diag |
| endif |
| |
| ifeq ($(strip $(FP2_SKIP_BOOT_JARS_CHECK)),) |
| SKIP_BOOT_JARS_CHECK := true |
| endif |
| |
| # display density |
| PRODUCT_PROPERTY_OVERRIDES += \ |
| ro.sf.lcd_density=440 |
| |
| $(call inherit-product, build/target/product/product_launched_with_l_mr1.mk) |
| |
| # APEX |
| PRODUCT_COPY_FILES += \ |
| device/fairphone/FP2/configs/ld.config.txt:$(TARGET_COPY_OUT_SYSTEM)/etc/swcodec/ld.config.txt |
| |
| # Media |
| PRODUCT_PACKAGES += \ |
| audio.a2dp.default \ |
| audio.primary.msm8974 \ |
| audio.r_submix.default \ |
| audio_policy.msm8974 \ |
| libqcompostprocbundle \ |
| libqcomvisualizer \ |
| libqcomvoiceprocessing \ |
| libqcomvoiceprocessingdescriptors \ |
| tinymix |
| |
| # RenderScript |
| PRODUCT_PACKAGES += \ |
| android.hardware.renderscript@1.0-impl |
| |
| # Boot animation |
| TARGET_SCREEN_HEIGHT := 1920 |
| TARGET_SCREEN_WIDTH := 1080 |
| |
| # Bluetooth |
| PRODUCT_PACKAGES += \ |
| android.hardware.bluetooth@1.0-impl \ |
| android.hardware.bluetooth@1.0-service \ |
| libbt-vendor |
| |
| # Camera |
| PRODUCT_PACKAGES += \ |
| android.hardware.camera.provider@2.4-impl \ |
| camera.device@1.0-impl \ |
| camera.msm8974 |
| |
| # FM radio |
| PRODUCT_PACKAGES += \ |
| FM2 \ |
| qcom.fmradio \ |
| init.qcom.fm.sh |
| |
| # Sensors |
| PRODUCT_PACKAGES += \ |
| android.hardware.sensors@1.0-impl |
| |
| # Media |
| PRODUCT_PACKAGES += \ |
| libOmxAacEnc \ |
| libOmxAmrEnc \ |
| libOmxCore \ |
| libOmxEvrcEnc \ |
| libOmxQcelp13Enc \ |
| libOmxVdec \ |
| libOmxVenc \ |
| libc2dcolorconvert \ |
| libstagefright_soft_mpeg2dec \ |
| libstagefrighthw |
| |
| # Telephony |
| PRODUCT_PACKAGES += \ |
| telephony-ext |
| |
| PRODUCT_BOOT_JARS += \ |
| telephony-ext |
| |
| # Display |
| PRODUCT_AAPT_CONFIG := normal |
| PRODUCT_AAPT_PREF_CONFIG := xxhdpi |
| |
| # Graphics |
| PRODUCT_PACKAGES += \ |
| copybit.msm8974 \ |
| gralloc.msm8974 \ |
| hwcomposer.msm8974 \ |
| liboverlay \ |
| memtrack.msm8974 |
| |
| # Tinyxml |
| PRODUCT_PACKAGES += \ |
| libtinyxml |
| |
| # Texture Side |
| PRODUCT_PROPERTY_OVERRIDES += \ |
| sys.max_texture_size=16777216 |
| |
| # HAL Modules |
| |
| # WiFi |
| PRODUCT_PACKAGES += \ |
| android.hardware.wifi@1.0-service.legacy |
| |
| PRODUCT_PACKAGES += \ |
| android.hardware.graphics.allocator@2.0-impl \ |
| android.hardware.graphics.allocator@2.0-service \ |
| android.hardware.graphics.composer@2.1-impl \ |
| android.hardware.graphics.mapper@2.0-impl-2.1 \ |
| android.hardware.memtrack@1.0-impl \ |
| android.hardware.memtrack@1.0-service |
| |
| PRODUCT_PACKAGES += \ |
| android.hardware.audio@2.0-impl \ |
| android.hardware.audio@2.0-service \ |
| android.hardware.audio.effect@2.0-impl |
| |
| # Keystore |
| PRODUCT_PACKAGES += \ |
| android.hardware.keymaster@3.0-impl \ |
| android.hardware.keymaster@3.0-service \ |
| keystore.msm8974 |
| |
| # Lights |
| PRODUCT_PACKAGES += \ |
| android.hardware.light@2.0-service.FP2 |
| |
| # Power |
| PRODUCT_PACKAGES += \ |
| android.hardware.power@1.2-service-qti |
| |
| # USB |
| PRODUCT_PACKAGES += \ |
| android.hardware.usb@1.0-service.basic |
| |
| # Vibrator |
| PRODUCT_PACKAGES += \ |
| android.hardware.vibrator@1.0-impl \ |
| android.hardware.vibrator@1.0-service |
| |
| PRODUCT_PACKAGES += \ |
| libhealthd.FP2 |
| |
| PRODUCT_PACKAGES += xdivert |
| |
| # Ship the sound recorder app for backward compatibility with previous releases |
| PRODUCT_PACKAGES += SoundRecorder |
| |
| # Ramdisk |
| PRODUCT_PACKAGES += \ |
| init.qcom.power.rc |
| |
| # GPS |
| PRODUCT_PACKAGES += \ |
| android.hardware.gnss@1.0-impl \ |
| android.hardware.gnss@1.0-service \ |
| gps.msm8974 \ |
| izat.conf \ |
| flp.conf \ |
| gps.conf \ |
| sap.conf |
| |
| PRODUCT_PACKAGES += senread |
| |
| # Experimental OpenGL ES 3.0 support for Android 7 (and higher) |
| PRODUCT_PACKAGES += \ |
| init.fp.exp_gles3_setup.sh |