Home | History | Annotate | Download | only in marlin
      1 #
      2 # Copyright (C) 2016 The Android Open-Source Project
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #      http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 #
     16 
     17 # This file includes all definitions that apply to ALL marlin and sailfish devices
     18 #
     19 # Everything in this directory will become public
     20 
     21 ifeq ($(TARGET_PREBUILT_KERNEL),)
     22     LOCAL_KERNEL := device/google/marlin-kernel/Image.gz-dtb
     23 else
     24 LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
     25 endif
     26 
     27 PRODUCT_SHIPPING_API_LEVEL := 24
     28 
     29 PRODUCT_COPY_FILES += \
     30     $(LOCAL_KERNEL):kernel
     31 
     32 DEVICE_PACKAGE_OVERLAYS += device/google/marlin/overlay
     33 
     34 # Input device files
     35 PRODUCT_COPY_FILES += \
     36     device/google/marlin/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \
     37     device/google/marlin/qpnp_pon.kl:system/usr/keylayout/qpnp_pon.kl \
     38     device/google/marlin/uinput-fpc.kl:system/usr/keylayout/uinput-fpc.kl \
     39     device/google/marlin/uinput-fpc.idc:system/usr/idc/uinput-fpc.idc \
     40     device/google/marlin/synaptics_dsxv26.idc:system/usr/idc/synaptics_dsxv26.idc
     41 
     42 # copy customized media_profiles and media_codecs xmls for msm8996
     43 PRODUCT_COPY_FILES += device/google/marlin/media_profiles.xml:system/etc/media_profiles.xml \
     44                       device/google/marlin/media_codecs.xml:system/etc/media_codecs.xml \
     45                       device/google/marlin/media_codecs_performance.xml:system/etc/media_codecs_performance.xml
     46 
     47 # Override heap growth limit due to high display density on device
     48 PRODUCT_PROPERTY_OVERRIDES += \
     49     dalvik.vm.heapgrowthlimit=256m \
     50     ro.telephony.default_cdma_sub=0
     51 
     52 $(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
     53 $(call inherit-product, device/google/marlin/common/common64.mk)
     54 
     55 #Android EGL implementation
     56 PRODUCT_PACKAGES += libGLES_android
     57 PRODUCT_PACKAGES += SSRestartDetector
     58 
     59 # graphics
     60 PRODUCT_PROPERTY_OVERRIDES += \
     61     ro.opengles.version=196610
     62 
     63 # HWUI common settings
     64 PRODUCT_PROPERTY_OVERRIDES += \
     65     ro.hwui.gradient_cache_size=1 \
     66     ro.hwui.drop_shadow_cache_size=6 \
     67     ro.hwui.r_buffer_cache_size=8 \
     68     ro.hwui.texture_cache_flushrate=0.4 \
     69     ro.hwui.text_small_cache_width=1024 \
     70     ro.hwui.text_small_cache_height=1024 \
     71     ro.hwui.text_large_cache_width=2048 \
     72     ro.hwui.text_large_cache_height=1024
     73 
     74 # For android_filesystem_config.h
     75 PRODUCT_PACKAGES += fs_config_files \
     76                     fs_config_dirs
     77 
     78 # Audio configuration
     79 USE_XML_AUDIO_POLICY_CONF := 1
     80 PRODUCT_COPY_FILES += \
     81     device/google/marlin/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
     82     device/google/marlin/audio_effects.conf:system/etc/audio_effects.conf \
     83     device/google/marlin/mixer_paths.xml:system/etc/mixer_paths.xml \
     84     device/google/marlin/mixer_paths_tasha_t50.xml:system/etc/mixer_paths_tasha_t50.xml \
     85     device/google/marlin/aanc_tuning_mixer.txt:system/etc/aanc_tuning_mixer.txt \
     86     device/google/marlin/sound_trigger_mixer_paths.xml:system/etc/sound_trigger_mixer_paths.xml \
     87     device/google/marlin/sound_trigger_mixer_paths_tasha_t50.xml:system/etc/sound_trigger_mixer_paths_tasha_t50.xml \
     88     device/google/marlin/sound_trigger_platform_info.xml:system/etc/sound_trigger_platform_info.xml \
     89     device/google/marlin/audio_platform_info.xml:system/etc/audio_platform_info.xml \
     90     device/google/marlin/audio_platform_info_tasha_t50.xml:system/etc/audio_platform_info_tasha_t50.xml \
     91     device/google/marlin/audio_policy_configuration.xml:system/etc/audio_policy_configuration.xml \
     92     device/google/marlin/audio_policy_volumes_drc.xml:system/etc/audio_policy_volumes_drc.xml \
     93     frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:system/etc/a2dp_audio_policy_configuration.xml \
     94     frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \
     95     frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \
     96     frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \
     97     frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:system/etc/permissions/android.hardware.vulkan.level.xml \
     98     frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:system/etc/permissions/android.hardware.vulkan.version.xml
     99 
    100 # Audio effects
    101 PRODUCT_PACKAGES += \
    102     libqcomvisualizer \
    103     libqcomvoiceprocessing \
    104     libqcomvoiceprocessingdescriptors \
    105     libqcompostprocbundle
    106 
    107 PRODUCT_PACKAGES += \
    108     sound_trigger.primary.msm8996
    109 
    110 # set audio fluence, ns, aec property
    111 PRODUCT_PROPERTY_OVERRIDES += \
    112     ro.qc.sdk.audio.fluencetype=fluencepro \
    113     persist.audio.fluence.voicecall=true \
    114     persist.audio.fluence.speaker=true \
    115     persist.audio.fluence.voicecomm=true \
    116     persist.audio.fluence.voicerec=false
    117 
    118 # WLAN driver configuration files
    119 PRODUCT_COPY_FILES += \
    120     device/google/marlin/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf     \
    121     device/google/marlin/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf     \
    122     device/google/marlin/WCNSS_cfg.dat:system/etc/firmware/wlan/qca_cld/WCNSS_cfg.dat \
    123     device/google/marlin/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini
    124 
    125 # MIDI feature
    126 PRODUCT_COPY_FILES += \
    127     frameworks/native/data/etc/android.software.midi.xml:system/etc/permissions/android.software.midi.xml
    128 
    129 # Audio low latency feature
    130 PRODUCT_COPY_FILES += \
    131     frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml
    132 
    133 # Pro audio feature
    134 PRODUCT_COPY_FILES += \
    135     frameworks/native/data/etc/android.hardware.audio.pro.xml:system/etc/permissions/android.hardware.audio.pro.xml
    136 
    137 # Camera
    138 PRODUCT_COPY_FILES += \
    139     frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
    140     frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
    141     frameworks/native/data/etc/android.hardware.camera.full.xml:system/etc/permissions/android.hardware.camera.full.xml \
    142     frameworks/native/data/etc/android.hardware.camera.raw.xml:system/etc/permissions/android.hardware.camera.raw.xml
    143 
    144 # Wi-Fi
    145 PRODUCT_PACKAGES += \
    146     libwpa_client \
    147     hostapd \
    148     wpa_supplicant \
    149     wpa_supplicant.conf
    150 
    151 # Listen configuration file
    152 PRODUCT_COPY_FILES += \
    153     device/google/marlin/listen_platform_info.xml:system/etc/listen_platform_info.xml
    154 
    155 #ANT+ stack
    156 PRODUCT_PACKAGES += \
    157     AntHalService \
    158     libantradio \
    159     antradio_app \
    160     libvolumelistener
    161 
    162 # Sensor features
    163 PRODUCT_COPY_FILES += \
    164     frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
    165     frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
    166     frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \
    167     frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
    168     frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
    169     frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \
    170     frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:system/etc/permissions/android.hardware.sensor.stepcounter.xml \
    171     frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:system/etc/permissions/android.hardware.sensor.stepdetector.xml \
    172     frameworks/native/data/etc/android.hardware.sensor.hifi_sensors.xml:system/etc/permissions/android.hardware.sensor.hifi_sensors.xml
    173 
    174 # Other hardware-specific features
    175 PRODUCT_COPY_FILES += \
    176     frameworks/native/data/etc/android.hardware.vr.high_performance.xml:system/etc/permissions/android.hardware.vr.high_performance.xml
    177 
    178 # For SPN display
    179 PRODUCT_COPY_FILES += \
    180     device/google/marlin/spn-conf.xml:system/etc/spn-conf.xml
    181 
    182 # Common sensor packages
    183 TARGET_USES_NANOHUB_SENSORHAL := true
    184 NANOHUB_SENSORHAL_LID_STATE_ENABLED := true
    185 NANOHUB_SENSORHAL_SENSORLIST := $(LOCAL_PATH)/sensorhal/sensorlist.cpp
    186 PRODUCT_PACKAGES += context_hub.default
    187 
    188 PRODUCT_PACKAGES += \
    189     nanoapp_cmd
    190 
    191 # sensor utilities (only for userdebug and eng builds)
    192 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
    193 PRODUCT_PACKAGES += \
    194     nanotool \
    195     sensortest
    196 endif
    197 
    198 PRODUCT_COPY_FILES += \
    199     device/google/marlin/sec_config:system/etc/sec_config
    200 
    201 PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/bootdevice/by-name/system
    202 
    203 #FEATURE_OPENGLES_EXTENSION_PACK support string config file
    204 PRODUCT_COPY_FILES += \
    205     frameworks/native/data/etc/android.hardware.opengles.aep.xml:system/etc/permissions/android.hardware.opengles.aep.xml
    206 
    207 # MSM IRQ Balancer configuration file
    208 PRODUCT_COPY_FILES += \
    209     device/google/marlin/msm_irqbalance.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance.conf
    210 
    211 # init launched script
    212 PRODUCT_COPY_FILES += \
    213     device/google/marlin/init.qcom.qseecomd.sh:system/bin/init.qcom.qseecomd.sh \
    214     device/google/marlin/init.radio.sh:system/bin/init.radio.sh \
    215     device/google/marlin/init.power.sh:system/bin/init.power.sh \
    216     device/google/marlin/init.mid.sh:system/bin/init.mid.sh \
    217     device/google/marlin/init.foreground.sh:system/bin/init.foreground.sh
    218 
    219 # Reduce client buffer size for fast audio output tracks
    220 PRODUCT_PROPERTY_OVERRIDES += \
    221     af.fast_track_multiplier=1
    222 
    223 # Low latency audio buffer size in frames
    224 PRODUCT_PROPERTY_OVERRIDES += \
    225     audio_hal.period_size=192
    226 
    227 PRODUCT_PROPERTY_OVERRIDES += \
    228     persist.camera.gyro.android=4 \
    229     persist.camera.tof.direct=1 \
    230     persist.camera.tnr.preview=1 \
    231     persist.camera.tnr.video=1
    232 
    233 # Set bluetooth soc to rome
    234 PRODUCT_PROPERTY_OVERRIDES += \
    235     qcom.bluetooth.soc=rome
    236 
    237 PRODUCT_PROPERTY_OVERRIDES += \
    238     persist.cne.feature=1 \
    239     persist.radio.data_ltd_sys_ind=1 \
    240     persist.radio.is_wps_enabled=true \
    241     persist.radio.RATE_ADAPT_ENABLE=1 \
    242     persist.radio.ROTATION_ENABLE=1 \
    243     persist.radio.sw_mbn_update=1 \
    244     persist.radio.videopause.mode=1 \
    245     persist.radio.VT_ENABLE=1 \
    246     persist.radio.VT_HYBRID_ENABLE=1 \
    247     persist.radio.data_con_rprt=true \
    248     persist.rcs.supported=1 \
    249     rild.libpath=/vendor/lib64/libril-qc-qmi-1.so
    250 
    251 PRODUCT_PROPERTY_OVERRIDES += \
    252     persist.data.mode=concurrent
    253 
    254 # Enable SM log mechanism by default
    255 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
    256 PRODUCT_PROPERTY_OVERRIDES += \
    257     persist.radio.smlog_switch=1
    258 endif
    259 
    260 # Set snapshot timer to 3 second
    261 PRODUCT_PROPERTY_OVERRIDES += \
    262     persist.radio.snapshot_enabled=1 \
    263     persist.radio.snapshot_timer=3
    264 
    265 # IMS over WiFi
    266 PRODUCT_PROPERTY_OVERRIDES += \
    267     persist.data.iwlan.enable=true
    268 
    269 # LTE, CDMA, GSM/WCDMA
    270 PRODUCT_PROPERTY_OVERRIDES += \
    271     ro.telephony.default_network=10 \
    272     telephony.lteOnCdmaDevice=1
    273 
    274 PRODUCT_AAPT_CONFIG += xlarge large
    275 PRODUCT_CHARACTERISTICS := nosdcard
    276 
    277 # Enable camera EIS
    278 # eis.enable: enables electronic image stabilization
    279 # is_type: sets image stabilization type
    280 PRODUCT_PROPERTY_OVERRIDES += \
    281     persist.camera.eis.enable=1 \
    282     persist.camera.is_type=4
    283 
    284 # Fingerprint
    285 PRODUCT_PACKAGES += \
    286     fingerprintd
    287 
    288 PRODUCT_COPY_FILES += \
    289     frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml
    290 
    291 # Modem debugger
    292 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
    293 PRODUCT_COPY_FILES += \
    294     device/google/marlin/init.common.diag.rc.userdebug:root/init.common.diag.rc
    295 
    296 # Subsystem ramdump
    297 PRODUCT_PROPERTY_OVERRIDES += \
    298     persist.sys.ssr.enable_ramdumps=1
    299 else
    300 PRODUCT_COPY_FILES += \
    301     device/google/marlin/init.common.diag.rc.user:root/init.common.diag.rc
    302 endif
    303 
    304 # Subsystem silent restart
    305 PRODUCT_PROPERTY_OVERRIDES += \
    306     persist.sys.ssr.restart_level=venus,AR6320,slpi,modem,adsp
    307 
    308 PRODUCT_COPY_FILES += \
    309     device/google/marlin/thermal-engine-marlin.conf:system/etc/thermal-engine.conf
    310 
    311 $(call inherit-product-if-exists, hardware/qcom/msm8996/msm8996.mk)
    312 $(call inherit-product-if-exists, vendor/qcom/gpu/msm8996/msm8996-gpu-vendor.mk)
    313 
    314 # TODO:
    315 # setup dm-verity configs.
    316 # PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/platform/soc/7464900.sdhci/by-name/system
    317 # $(call inherit-product, build/target/product/verity.mk)
    318 
    319 #Property of the BDA module path for loading BDA
    320 PRODUCT_PROPERTY_OVERRIDES += \
    321     ro.bt.bdaddr_path=/sys/module/bdaddress/parameters/bdaddress
    322 
    323 # Needed for encryption
    324 PRODUCT_PACKAGES += \
    325     keystore.msm8996 \
    326     gatekeeper.msm8996
    327 
    328 # Use the A/B updater.
    329 AB_OTA_UPDATER := true
    330 PRODUCT_PACKAGES += \
    331     update_engine \
    332     update_verifier
    333 
    334 # Enable update engine sideloading by including the static version of the
    335 # boot_control HAL and its dependencies.
    336 PRODUCT_STATIC_BOOT_CONTROL_HAL := \
    337     bootctrl.msm8996 \
    338     librecovery_updater_msm \
    339     libsparse_static
    340 PRODUCT_PACKAGES += \
    341     update_engine_sideload
    342 
    343 # Tell the system to enable copying odexes from other partition.
    344 PRODUCT_PACKAGES += \
    345 	cppreopts.sh
    346 
    347 PRODUCT_PROPERTY_OVERRIDES += \
    348     ro.cp_system_other_odex=1
    349 
    350 # Script that copies preloads directory from system_other to data partition
    351 PRODUCT_COPY_FILES += \
    352     device/google/marlin/preloads_copy.sh:system/bin/preloads_copy.sh
    353 
    354 PRODUCT_PACKAGES_DEBUG += \
    355     update_engine_client
    356 
    357 # A/B updater updatable partitions list. Keep in sync with the partition list
    358 # with "_a" and "_b" variants in the device. Note that the vendor can add more
    359 # more partitions to this list for the bootloader and radio.
    360 AB_OTA_PARTITIONS += \
    361     boot \
    362     system
    363 
    364 # NFC packages
    365 PRODUCT_PACKAGES += \
    366     NfcNci \
    367     Tag
    368 
    369 # NFC/camera interaction workaround - DO NOT COPY TO NEW DEVICES
    370 PRODUCT_PROPERTY_OVERRIDES += \
    371     ro.camera.notify_nfc=1
    372 
    373 PRODUCT_COPY_FILES += \
    374     device/google/marlin/nfc/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \
    375     device/google/marlin/nfc/libpn551_fw.so:$(TARGET_COPY_OUT_VENDOR)/firmware/libpn551_fw.so
    376 
    377 # Bootloader HAL used for A/B updates.
    378 PRODUCT_PACKAGES += \
    379     bootctrl.msm8996
    380 PRODUCT_PACKAGES_DEBUG += \
    381     bootctl
    382 
    383 # Storage: for factory reset protection feature
    384 PRODUCT_PROPERTY_OVERRIDES += \
    385     ro.frp.pst=/dev/block/platform/soc/624000.ufshc/by-name/frp
    386 
    387 PRODUCT_PROPERTY_OVERRIDES += \
    388     sdm.debug.disable_rotator_split=1 \
    389     qdcm.only_pcc_for_trans=1 \
    390     qdcm.diagonal_matrix_mode=1
    391 
    392 # Enable low power video mode for 4K encode
    393 PRODUCT_PROPERTY_OVERRIDES += \
    394     vidc.debug.perf.mode=2
    395 
    396 # OEM Unlock reporting
    397 ADDITIONAL_DEFAULT_PROPERTIES += \
    398     ro.oem_unlock_supported=1
    399 
    400 # Setup dm-verity configs
    401 PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/bootdevice/by-name/system
    402 PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/bootdevice/by-name/vendor
    403 $(call inherit-product, build/target/product/verity.mk)
    404 
    405 # Partitions (listed in the file) to be wiped under recovery.
    406 TARGET_RECOVERY_WIPE := \
    407     device/google/marlin/recovery.wipe.common
    408 
    409 # GPS configuration file
    410 PRODUCT_COPY_FILES += \
    411     device/google/marlin/gps.conf:system/etc/gps.conf
    412 
    413 # Default permission grant exceptions
    414 PRODUCT_COPY_FILES += \
    415     device/google/marlin/default-permissions.xml:system/etc/default-permissions/default-permissions.xml
    416 
    417 # A/B OTA dexopt package
    418 PRODUCT_PACKAGES += otapreopt_script
    419 
    420 # A/B OTA dexopt update_engine hookup
    421 AB_OTA_POSTINSTALL_CONFIG += \
    422     RUN_POSTINSTALL_system=true \
    423     POSTINSTALL_PATH_system=system/bin/otapreopt_script \
    424     FILESYSTEM_TYPE_system=ext4 \
    425     POSTINSTALL_OPTIONAL_system=true
    426 
    427 #Reduce cost of scrypt for FBE CE decryption
    428 PRODUCT_PROPERTY_OVERRIDES += \
    429     ro.crypto.scrypt_params=13:3:1
    430 
    431 # Add minidebug info to the system server to support diagnosing native crashes.
    432 ifneq (,$(filter user userdebug, $(TARGET_BUILD_VARIANT)))
    433     # System server and some of its services.
    434     # Note: we cannot use PRODUCT_SYSTEM_SERVER_JARS, as it has not been expanded at this point.
    435     $(call add-product-dex-preopt-module-config,services,--generate-mini-debug-info)
    436     $(call add-product-dex-preopt-module-config,wifi-service,--generate-mini-debug-info)
    437 endif
    438 
    439 # b/28423767
    440 $(call add-product-sanitizer-module-config,rmt_storage,never)
    441 
    442 # b/30302693
    443 $(call add-product-sanitizer-module-config,surfaceflinger libsigchain,never)
    444 
    445 # b/28992626
    446 # For Hangouts, make ASAN-lite only sanitize 32-bit.
    447 ifeq (true,$(SANITIZE_LITE))
    448   SANITIZE_ARCH := 32
    449 endif
    450 
    451 # b/30349163
    452 # Set Marlin/Sailfish default log size on userdebug/eng build to 1M
    453 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
    454 PRODUCT_PROPERTY_OVERRIDES += ro.logd.size=1M
    455 endif
    456 
    457 # b/30022738
    458 # Work around janky screenrecord performance by disabling hardware composer
    459 # virtual displays
    460 PRODUCT_PROPERTY_OVERRIDES += \
    461     debug.sf.disable_hwc_vds=1
    462 
    463 # b/32109329
    464 # Workaround for audio glitches
    465 PRODUCT_PROPERTY_OVERRIDES += \
    466     audio.adm.buffering.ms=3
    467