1#
2# Copyright (C) 2017 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# Include all languages
18$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
19
20# Enable updating of APEXes
21$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
22
23PRODUCT_SOONG_NAMESPACES += device/generic/goldfish-opengl # for vulkan
24
25PRODUCT_SHIPPING_API_LEVEL := 31
26PRODUCT_BUILD_BOOT_IMAGE := true
27PRODUCT_USE_DYNAMIC_PARTITIONS := true
28DISABLE_RILD_OEM_HOOK := true
29
30# [b/148163848] Disable product enforcement only for qt-qpr1-dev-plus-aosp
31# branch. It is not merged down to main branch.
32# As qt-qpr1-dev-plus-aosp branch has qt based vendor modules that are not
33# ready for the product enforcement, we may not enable it in this branch.
34PRODUCT_USE_PRODUCT_VNDK_OVERRIDE := false
35OVERRIDE_PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE := false
36
37TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE ?= f2fs
38
39AB_OTA_UPDATER := true
40AB_OTA_PARTITIONS += \
41    odm \
42    odm_dlkm \
43    product \
44    system \
45    system_ext \
46    vbmeta \
47    vbmeta_system \
48    vendor \
49    vendor_dlkm \
50
51# Enable Virtual A/B
52$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk)
53
54# Enable Scoped Storage related changes for f2fs
55ifeq ($(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE),f2fs)
56$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
57endif
58
59# Properties that are not vendor-specific. These will go in the product
60# partition, instead of the vendor partition, and do not need vendor
61# sepolicy
62PRODUCT_PRODUCT_PROPERTIES += \
63    persist.adb.tcp.port=5555 \
64    persist.traced.enable=1 \
65    ro.com.google.locationfeatures=1 \
66
67# Explanation of specific properties:
68#   debug.hwui.swap_with_damage avoids boot failure on M http://b/25152138
69#   ro.opengles.version OpenGLES 3.0
70#   ro.hardware.keystore_desede=true needed for CtsKeystoreTestCases
71PRODUCT_PROPERTY_OVERRIDES += \
72    tombstoned.max_tombstone_count=500 \
73    vendor.bt.rootcanal_test_console=off \
74    debug.hwui.swap_with_damage=0 \
75    ro.carrier=unknown \
76    ro.com.android.dataroaming?=false \
77    ro.hardware.virtual_device=1 \
78    ro.logd.size=1M \
79    ro.opengles.version=196608 \
80    wifi.interface=wlan0 \
81    persist.sys.zram_enabled=1 \
82    ro.hardware.keystore_desede=true \
83    ro.rebootescrow.device=/dev/block/pmem0 \
84
85# Below is a list of properties we probably should get rid of.
86PRODUCT_PROPERTY_OVERRIDES += \
87    wlan.driver.status=ok
88
89ifeq ($(LOCAL_ENABLE_CODEC2),)
90# Codec 2.0 is unstable on x86; disable it
91PRODUCT_PROPERTY_OVERRIDES += \
92    debug.stagefright.ccodec=0
93# Codec 1.0 requires the OMX services
94DEVICE_MANIFEST_FILE += \
95    device/google/cuttlefish/shared/config/android.hardware.media.omx@1.0.xml
96endif
97
98# Enforce privapp permissions control.
99PRODUCT_PROPERTY_OVERRIDES += ro.control_privapp_permissions=enforce
100
101# aes-256-heh default is not supported in standard kernels.
102PRODUCT_PROPERTY_OVERRIDES += ro.crypto.volume.filenames_mode=aes-256-cts
103
104# Copy preopted files from system_b on first boot
105PRODUCT_PROPERTY_OVERRIDES += ro.cp_system_other_odex=1
106
107# DRM service opt-in
108PRODUCT_PROPERTY_OVERRIDES += drm.service.enabled=true
109
110# Packages for various GCE-specific utilities
111#
112PRODUCT_PACKAGES += \
113    socket_vsock_proxy \
114    CuttlefishService \
115    wpa_supplicant.vsoc.conf \
116    vsoc_input_service \
117    rename_netiface \
118    ip_link_add \
119    setup_wifi \
120    tombstone_transmit \
121    tombstone_producer \
122    suspend_blocker \
123    vtpm_manager \
124
125#
126# Packages for AOSP-available stuff we use from the framework
127#
128PRODUCT_PACKAGES += \
129    e2fsck \
130    ip \
131    sleep \
132    tcpdump \
133    wpa_supplicant \
134    wificond \
135
136#
137# Packages for the OpenGL implementation
138#
139
140# SwiftShader provides a software-only implementation that is not thread-safe
141PRODUCT_PACKAGES += \
142    libEGL_swiftshader \
143    libGLESv1_CM_swiftshader \
144    libGLESv2_swiftshader
145
146# GL implementation for virgl
147PRODUCT_PACKAGES += \
148    libGLES_mesa \
149
150# GL/Vk implementation for gfxstream
151PRODUCT_PACKAGES += \
152    vulkan.ranchu \
153    libandroidemu \
154    libOpenglCodecCommon \
155    libOpenglSystemCommon \
156    libGLESv1_CM_emulation \
157    lib_renderControl_enc \
158    libEGL_emulation \
159    libGLESv2_enc \
160    libvulkan_enc \
161    libGLESv2_emulation \
162    libGLESv1_enc
163
164#
165# Packages for the Vulkan implementation
166#
167PRODUCT_PACKAGES += \
168    vulkan.pastel
169
170#
171# Packages for testing
172#
173PRODUCT_PACKAGES += \
174    aidl_lazy_test_server \
175    hidl_lazy_test_server
176
177DEVICE_PACKAGE_OVERLAYS := device/google/cuttlefish/shared/overlay
178# PRODUCT_AAPT_CONFIG and PRODUCT_AAPT_PREF_CONFIG are intentionally not set to
179# pick up every density resources.
180
181#
182# Common manifest for all targets
183#
184DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
185
186#
187# General files
188#
189PRODUCT_COPY_FILES += \
190    device/google/cuttlefish/shared/config/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
191    device/google/cuttlefish/shared/config/camera_v3.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/camera.json \
192    device/google/cuttlefish/shared/config/init.vendor.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.cutf_cvm.rc \
193    device/google/cuttlefish/shared/config/init.product.rc:$(TARGET_COPY_OUT_PRODUCT)/etc/init/init.rc \
194    device/google/cuttlefish/shared/config/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
195    device/google/cuttlefish/shared/config/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
196    device/google/cuttlefish/shared/config/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
197    device/google/cuttlefish/shared/config/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
198    device/google/cuttlefish/shared/config/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \
199    device/google/cuttlefish/shared/permissions/cuttlefish_excluded_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/cuttlefish_excluded_hardware.xml \
200    device/google/cuttlefish/shared/permissions/privapp-permissions-cuttlefish.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/privapp-permissions-cuttlefish.xml \
201    frameworks/av/media/libeffects/data/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
202    frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
203    frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
204    frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
205    frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/primary_audio_policy_configuration.xml \
206    frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
207    frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
208    frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
209    frameworks/av/services/audiopolicy/config/surround_sound_configuration_5_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/surround_sound_configuration_5_0.xml \
210    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \
211    frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
212    frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
213    frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
214    frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
215    frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \
216    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \
217    frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
218    frameworks/native/data/etc/android.hardware.sensor.ambient_temperature.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.ambient_temperature.xml \
219    frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
220    frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
221    frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
222    frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
223    frameworks/native/data/etc/android.hardware.sensor.relative_humidity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.relative_humidity.xml \
224    frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
225    frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
226    frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \
227    frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
228    frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
229    frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \
230    frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
231    frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml \
232    frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \
233    system/bt/vendor_libs/test_vendor_lib/data/controller_properties.json:vendor/etc/bluetooth/controller_properties.json \
234    device/google/cuttlefish/shared/config/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json \
235    device/google/cuttlefish/shared/config/fstab.f2fs:$(TARGET_COPY_OUT_RAMDISK)/fstab.f2fs \
236    device/google/cuttlefish/shared/config/fstab.f2fs:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.f2fs \
237    device/google/cuttlefish/shared/config/fstab.f2fs:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.f2fs \
238    device/google/cuttlefish/shared/config/fstab.ext4:$(TARGET_COPY_OUT_RAMDISK)/fstab.ext4 \
239    device/google/cuttlefish/shared/config/fstab.ext4:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ext4 \
240    device/google/cuttlefish/shared/config/fstab.ext4:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.ext4
241
242# Packages for HAL implementations
243
244#
245# Atrace HAL
246#
247PRODUCT_PACKAGES += \
248    android.hardware.atrace@1.0-service
249
250#
251# Authsecret HAL
252#
253PRODUCT_PACKAGES += \
254    android.hardware.authsecret@1.0-service
255
256#
257# Hardware Composer HAL
258#
259PRODUCT_PACKAGES += \
260    hwcomposer.drm_minigbm \
261    hwcomposer.cutf_cvm_ashmem \
262    hwcomposer.cutf_hwc2 \
263    hwcomposer-stats \
264    android.hardware.graphics.composer@2.2-impl \
265    android.hardware.graphics.composer@2.2-service
266
267#
268# Gralloc HAL
269#
270PRODUCT_PACKAGES += \
271    android.hardware.graphics.allocator@3.0-service.minigbm \
272    android.hardware.graphics.mapper@3.0-impl.minigbm
273
274#
275# Bluetooth HAL and Compatibility Bluetooth library (for older revs).
276#
277PRODUCT_PACKAGES += \
278    android.hardware.bluetooth@1.1-service.sim \
279    android.hardware.bluetooth.audio@2.0-impl
280
281#
282# Audio HAL
283#
284ifeq ($(LOCAL_AUDIO_PRODUCT_PACKAGE),)
285LOCAL_AUDIO_PRODUCT_PACKAGE := \
286    audio.primary.cutf \
287    audio.r_submix.default \
288    android.hardware.audio@6.0-impl \
289    android.hardware.audio.effect@6.0-impl \
290    android.hardware.audio@2.0-service
291endif
292PRODUCT_PACKAGES += $(LOCAL_AUDIO_PRODUCT_PACKAGE)
293
294#
295# Drm HAL
296#
297PRODUCT_PACKAGES += \
298    android.hardware.drm@1.0-impl \
299    android.hardware.drm@1.0-service \
300    android.hardware.drm@1.2-service.clearkey \
301    android.hardware.drm@1.2-service.widevine
302
303#
304# Dumpstate HAL
305#
306ifeq ($(LOCAL_DUMPSTATE_PRODUCT_PACKAGE),)
307    LOCAL_DUMPSTATE_PRODUCT_PACKAGE := android.hardware.dumpstate@1.1-service.example
308endif
309PRODUCT_PACKAGES += $(LOCAL_DUMPSTATE_PRODUCT_PACKAGE)
310
311#
312# Camera
313#
314ifeq ($(LOCAL_CAMERAPROVIDER_PRODUCT_PACKAGE),)
315    LOCAL_CAMERAPROVIDER_PRODUCT_PACKAGE := android.hardware.camera.provider@2.4-service
316endif
317PRODUCT_PACKAGES += \
318    camera.cutf \
319    camera.cutf.jpeg \
320    camera.device@3.2-impl \
321    android.hardware.camera.provider@2.4-impl \
322    $(LOCAL_CAMERAPROVIDER_PRODUCT_PACKAGE)
323
324#
325# Gatekeeper
326#
327PRODUCT_PACKAGES += \
328    android.hardware.gatekeeper@1.0-service.remote
329
330#
331# GPS
332#
333PRODUCT_PACKAGES += \
334    android.hardware.gnss@2.0-service
335
336# Health
337ifeq ($(LOCAL_HEALTH_PRODUCT_PACKAGE),)
338    LOCAL_HEALTH_PRODUCT_PACKAGE := \
339    android.hardware.health@2.1-impl-cuttlefish \
340    android.hardware.health@2.1-service
341endif
342PRODUCT_PACKAGES += $(LOCAL_HEALTH_PRODUCT_PACKAGE)
343
344# Health Storage
345PRODUCT_PACKAGES += \
346    android.hardware.health.storage@1.0-service.cuttlefish
347
348# Identity Credential
349PRODUCT_PACKAGES += \
350    android.hardware.identity-service.example
351
352# Input Classifier HAL
353PRODUCT_PACKAGES += \
354    android.hardware.input.classifier@1.0-service.default
355
356#
357# Sensors
358#
359ifeq ($(LOCAL_SENSOR_PRODUCT_PACKAGE),)
360       LOCAL_SENSOR_PRODUCT_PACKAGE := android.hardware.sensors@2.0-service.mock
361endif
362PRODUCT_PACKAGES += \
363    $(LOCAL_SENSOR_PRODUCT_PACKAGE)
364#
365# Thermal (mock)
366#
367PRODUCT_PACKAGES += \
368    android.hardware.thermal@2.0-service.mock
369
370#
371# Lights
372#
373PRODUCT_PACKAGES += \
374    android.hardware.lights-service.example \
375
376#
377# Keymaster HAL
378#
379PRODUCT_PACKAGES += \
380     android.hardware.keymaster@4.1-service.remote
381
382#
383# Power HAL
384#
385PRODUCT_PACKAGES += \
386    android.hardware.power-service.example
387
388#
389# PowerStats HAL
390#
391PRODUCT_PACKAGES += \
392    android.hardware.power.stats@1.0-service.mock
393
394#
395# NeuralNetworks HAL
396#
397PRODUCT_PACKAGES += \
398    android.hardware.neuralnetworks@1.3-service-sample-all \
399    android.hardware.neuralnetworks@1.3-service-sample-float-fast \
400    android.hardware.neuralnetworks@1.3-service-sample-float-slow \
401    android.hardware.neuralnetworks@1.3-service-sample-minimal \
402    android.hardware.neuralnetworks@1.3-service-sample-quant
403
404#
405# USB
406PRODUCT_PACKAGES += \
407    android.hardware.usb@1.0-service
408
409# Vibrator HAL
410PRODUCT_PACKAGES += \
411    android.hardware.vibrator-service.example
412
413# BootControl HAL
414PRODUCT_PACKAGES += \
415    android.hardware.boot@1.1-impl \
416    android.hardware.boot@1.1-impl.recovery \
417    android.hardware.boot@1.1-service
418
419# WLAN driver configuration files
420PRODUCT_COPY_FILES += \
421    $(LOCAL_PATH)/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
422
423# Recovery mode
424ifneq ($(TARGET_NO_RECOVERY),true)
425
426PRODUCT_COPY_FILES += \
427    device/google/cuttlefish/shared/config/init.recovery.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.cutf_cvm.rc \
428    device/google/cuttlefish/shared/config/cgroups.json:$(TARGET_COPY_OUT_RECOVERY)/root/vendor/etc/cgroups.json \
429    device/google/cuttlefish/shared/config/ueventd.rc:$(TARGET_COPY_OUT_RECOVERY)/root/ueventd.cutf_cvm.rc \
430
431endif
432
433#
434# Shell script Vendor Module Loading
435#
436PRODUCT_COPY_FILES += \
437   $(LOCAL_PATH)/config/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \
438
439# Host packages to install
440PRODUCT_HOST_PACKAGES += socket_vsock_proxy
441
442PRODUCT_EXTRA_VNDK_VERSIONS := 28 29
443
444PRODUCT_SOONG_NAMESPACES += external/mesa3d
445
446# Need this so that the application's loop on reading input can be synchronized
447# with HW VSYNC
448PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.running_without_sync_framework=true
449