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