common.mk 11.9 KB
Newer Older
1
2
3
# Allow vendor/extra to override any property by setting it first
$(call inherit-product-if-exists, vendor/extra/product.mk)

Dan Pasanen's avatar
Dan Pasanen committed
4
PRODUCT_BRAND ?= LineageOS
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
5

6
7
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0

8
ifeq ($(PRODUCT_GMS_CLIENTID_BASE),)
9
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
10
11
    ro.com.google.clientidbase=android-google
else
12
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
13
14
15
    ro.com.google.clientidbase=$(PRODUCT_GMS_CLIENTID_BASE)
endif

16
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
17
    ro.build.selinux=1
18

19
# Default notification/alarm sounds
20
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
21
    ro.config.notification_sound=Argon.ogg \
22
    ro.config.alarm_alert=Hassium.ogg
23

24
ifneq ($(TARGET_BUILD_VARIANT),user)
25
# Thank you, please drive thru!
26
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.sys.dun.override=0
27
endif
28

29
30
31
32
ifeq ($(TARGET_BUILD_VARIANT),eng)
# Disable ADB authentication
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=0
else
33
# Enable ADB authentication
34
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=1
35
endif
36

37
# Backup Tool
38
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
39
40
    vendor/lineage/prebuilt/common/bin/backuptool.sh:install/bin/backuptool.sh \
    vendor/lineage/prebuilt/common/bin/backuptool.functions:install/bin/backuptool.functions \
Luca Stefani's avatar
Luca Stefani committed
41
    vendor/lineage/prebuilt/common/bin/50-lineage.sh:system/addon.d/50-lineage.sh \
Dan Pasanen's avatar
Dan Pasanen committed
42
    vendor/lineage/prebuilt/common/bin/blacklist:system/addon.d/blacklist
43

44
45
46
47
48
49
50
ifeq ($(AB_OTA_UPDATER),true)
PRODUCT_COPY_FILES += \
    vendor/lineage/prebuilt/common/bin/backuptool_ab.sh:system/bin/backuptool_ab.sh \
    vendor/lineage/prebuilt/common/bin/backuptool_ab.functions:system/bin/backuptool_ab.functions \
    vendor/lineage/prebuilt/common/bin/backuptool_postinstall.sh:system/bin/backuptool_postinstall.sh
endif

51
52
# Backup Services whitelist
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
53
    vendor/lineage/config/permissions/backup.xml:system/etc/sysconfig/backup.xml
54

55
56
57
58
# Lineage-specific broadcast actions whitelist
PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/lineage-sysconfig.xml:system/etc/sysconfig/lineage-sysconfig.xml

59
60
# init.d support
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
61
62
    vendor/lineage/prebuilt/common/etc/init.d/00banner:system/etc/init.d/00banner \
    vendor/lineage/prebuilt/common/bin/sysinit:system/bin/sysinit
63

64
ifneq ($(TARGET_BUILD_VARIANT),user)
James Sullins's avatar
James Sullins committed
65
66
# userinit support
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
67
    vendor/lineage/prebuilt/common/etc/init.d/90userinit:system/etc/init.d/90userinit
68
endif
James Sullins's avatar
James Sullins committed
69

Sam Mortimer's avatar
Sam Mortimer committed
70
71
72
# Copy all Lineage-specific init rc files
$(foreach f,$(wildcard vendor/lineage/prebuilt/common/etc/init/*.rc),\
	$(eval PRODUCT_COPY_FILES += $(f):system/etc/init/$(notdir $f)))
73

herriojr's avatar
herriojr committed
74
75
# Copy over added mimetype supported in libcore.net.MimeUtils
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
76
    vendor/lineage/prebuilt/common/lib/content-types.properties:system/lib/content-types.properties
herriojr's avatar
herriojr committed
77

78
79
# Enable SIP+VoIP on all targets
PRODUCT_COPY_FILES += \
80
    frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml
81

82
83
84
85
# Enable wireless Xbox 360 controller support
PRODUCT_COPY_FILES += \
    frameworks/base/data/keyboards/Vendor_045e_Product_028e.kl:system/usr/keylayout/Vendor_045e_Product_0719.kl

Luca Stefani's avatar
Luca Stefani committed
86
# This is Lineage!
Steve Kondik's avatar
Steve Kondik committed
87
PRODUCT_COPY_FILES += \
88
    vendor/lineage/config/permissions/org.lineageos.android.xml:system/etc/permissions/org.lineageos.android.xml \
89
90
    vendor/lineage/config/permissions/privapp-permissions-lineage.xml:system/etc/permissions/privapp-permissions-lineage.xml \
    vendor/lineage/config/permissions/privapp-permissions-cm-legacy.xml:system/etc/permissions/privapp-permissions-cm-legacy.xml
Steve Kondik's avatar
Steve Kondik committed
91

92
93
94
95
# Enforce privapp-permissions whitelist
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
    ro.control_privapp_permissions=enforce

96
97
98
99
# Hidden API whitelist
PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/lineage-hiddenapi-package-whitelist.xml:system/etc/permissions/lineage-hiddenapi-package-whitelist.xml

100
101
102
103
# Power whitelist
PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/lineage-power-whitelist.xml:system/etc/sysconfig/lineage-power-whitelist.xml

104
105
106
# Include AOSP audio files
include vendor/lineage/config/aosp_audio.mk

Luca Stefani's avatar
Luca Stefani committed
107
108
# Include Lineage audio files
include vendor/lineage/config/lineage_audio.mk
109

110
111
112
ifneq ($(TARGET_DISABLE_LINEAGE_SDK), true)
# Lineage SDK
include vendor/lineage/config/lineage_sdk_common.mk
113
endif
114

115
116
# TWRP
ifeq ($(WITH_TWRP),true)
Dan Pasanen's avatar
Dan Pasanen committed
117
include vendor/lineage/config/twrp.mk
118
119
endif

120
121
122
123
124
125
126
127
# Do not include art debug targets
PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false

# Strip the local variable table and the local variable type table to reduce
# the size of the system image. This has no bearing on stack traces, but will
# leave less information available via JDWP.
PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true

128
# Bootanimation
Asher Simonds's avatar
Asher Simonds committed
129
130
PRODUCT_PACKAGES += \
    bootanimation.zip
131

Luca Stefani's avatar
Luca Stefani committed
132
# Required Lineage packages
133
PRODUCT_PACKAGES += \
134
    LineageParts \
Steve Kondik's avatar
Steve Kondik committed
135
    Development \
136
    Profiles
137

Luca Stefani's avatar
Luca Stefani committed
138
# Optional packages
139
PRODUCT_PACKAGES += \
140
    LiveWallpapersPicker \
Steve Kondik's avatar
Steve Kondik committed
141
142
    PhotoTable \
    Terminal
143

Luca Stefani's avatar
Luca Stefani committed
144
# Custom Lineage packages
Steve Kondik's avatar
Steve Kondik committed
145
PRODUCT_PACKAGES += \
Steve Kondik's avatar
Steve Kondik committed
146
    AudioFX \
Joey's avatar
Joey committed
147
    Backgrounds \
148
    LineageSettingsProvider \
149
    LineageSetupWizard \
Steve Kondik's avatar
Steve Kondik committed
150
    Eleven \
d34d's avatar
d34d committed
151
    ExactCalculator \
Joey Rizzoli's avatar
Joey Rizzoli committed
152
    Jelly \
Steve Kondik's avatar
Steve Kondik committed
153
    LockClock \
154
    TrebuchetQuickStep \
Gabriele M's avatar
Gabriele M committed
155
    Updater \
Paul Keith's avatar
Paul Keith committed
156
    WeatherProvider
Steve Kondik's avatar
Steve Kondik committed
157

Abhisek Devkota's avatar
Abhisek Devkota committed
158
159
160
161
# Exchange support
PRODUCT_PACKAGES += \
    Exchange2

Joey's avatar
Joey committed
162
163
# Berry styles
PRODUCT_PACKAGES += \
Demon Singur's avatar
Demon Singur committed
164
    LineageBlackTheme \
Joey's avatar
Joey committed
165
166
167
168
    LineageDarkTheme \
    LineageBlackAccent \
    LineageBlueAccent \
    LineageBrownAccent \
Joey's avatar
Joey committed
169
    LineageCyanAccent \
Joey's avatar
Joey committed
170
171
172
173
174
175
176
    LineageGreenAccent \
    LineageOrangeAccent \
    LineagePinkAccent \
    LineagePurpleAccent \
    LineageRedAccent \
    LineageYellowAccent

Luca Stefani's avatar
Luca Stefani committed
177
# Extra tools in Lineage
Sebastian Schmidt's avatar
Sebastian Schmidt committed
178
PRODUCT_PACKAGES += \
Steve Kondik's avatar
Steve Kondik committed
179
    7z \
Tom Marshall's avatar
Tom Marshall committed
180
    awk \
Steve Kondik's avatar
Steve Kondik committed
181
182
183
    bash \
    bzip2 \
    curl \
184
    getcap \
Steve Kondik's avatar
Steve Kondik committed
185
186
    htop \
    lib7z \
187
    libsepol \
188
189
    pigz \
    powertop \
190
    setcap \
191
192
193
194
195
    unrar \
    unzip \
    vim \
    wget \
    zip
Sebastian Schmidt's avatar
Sebastian Schmidt committed
196

197
198
199
200
# Charger
PRODUCT_PACKAGES += \
    charger_res_images

201
# Custom off-mode charger
202
ifeq ($(WITH_LINEAGE_CHARGER),true)
203
PRODUCT_PACKAGES += \
Luca Stefani's avatar
Luca Stefani committed
204
    lineage_charger_res_images \
205
    font_log.png \
Luca Stefani's avatar
Luca Stefani committed
206
    libhealthd.lineage
207
208
endif

209
# Filesystems tools
Scott Mertz's avatar
Scott Mertz committed
210
211
PRODUCT_PACKAGES += \
    fsck.exfat \
212
213
214
215
216
    fsck.ntfs \
    mke2fs \
    mkfs.exfat \
    mkfs.ntfs \
    mount.ntfs
Scott Mertz's avatar
Scott Mertz committed
217

Chirayu Desai's avatar
Chirayu Desai committed
218
219
220
221
222
223
224
225
# Openssh
PRODUCT_PACKAGES += \
    scp \
    sftp \
    ssh \
    sshd \
    sshd_config \
    ssh-keygen \
Chirayu Desai's avatar
Chirayu Desai committed
226
227
228
229
230
    start-ssh

# rsync
PRODUCT_PACKAGES += \
    rsync
Chirayu Desai's avatar
Chirayu Desai committed
231

232
# Storage manager
233
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
234
235
    ro.storage_manager.enabled=true

236
# Media
237
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
238
239
    media.recorder.show_manufacturer_and_model=true

240
# These packages are excluded from user builds
241
242
PRODUCT_PACKAGES_DEBUG += \
    micro_bench \
243
    procmem \
244
245
    procrank \
    strace
Abhisek Devkota's avatar
Abhisek Devkota committed
246
247

# Conditionally build in su
248
ifneq ($(TARGET_BUILD_VARIANT),user)
Abhisek Devkota's avatar
Abhisek Devkota committed
249
250
ifeq ($(WITH_SU),true)
PRODUCT_PACKAGES += \
251
    su
repo Shareef Ali's avatar
repo Shareef Ali committed
252
endif
Abhisek Devkota's avatar
Abhisek Devkota committed
253
endif
254

255
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += vendor/lineage/overlay
Dan Pasanen's avatar
Dan Pasanen committed
256
DEVICE_PACKAGE_OVERLAYS += vendor/lineage/overlay/common
257

Rashed Abdel-Tawab's avatar
Rashed Abdel-Tawab committed
258
259
PRODUCT_VERSION_MAJOR = 16
PRODUCT_VERSION_MINOR = 0
Dan Pasanen's avatar
Dan Pasanen committed
260
PRODUCT_VERSION_MAINTENANCE := 0
261

262
ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true)
Luca Stefani's avatar
Luca Stefani committed
263
    LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE)
264
else
Luca Stefani's avatar
Luca Stefani committed
265
    LINEAGE_VERSION_MAINTENANCE := 0
266
endif
267

Luca Stefani's avatar
Luca Stefani committed
268
# Set LINEAGE_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
269

Luca Stefani's avatar
Luca Stefani committed
270
ifndef LINEAGE_BUILDTYPE
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
271
    ifdef RELEASE_TYPE
Luca Stefani's avatar
Luca Stefani committed
272
273
274
        # Starting with "LINEAGE_" is optional
        RELEASE_TYPE := $(shell echo $(RELEASE_TYPE) | sed -e 's|^LINEAGE_||g')
        LINEAGE_BUILDTYPE := $(RELEASE_TYPE)
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
275
    endif
276
endif
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
277
278

# Filter out random types, so it'll reset to UNOFFICIAL
Luca Stefani's avatar
Luca Stefani committed
279
280
ifeq ($(filter RELEASE NIGHTLY SNAPSHOT EXPERIMENTAL,$(LINEAGE_BUILDTYPE)),)
    LINEAGE_BUILDTYPE :=
281
282
endif

Luca Stefani's avatar
Luca Stefani committed
283
284
285
ifdef LINEAGE_BUILDTYPE
    ifneq ($(LINEAGE_BUILDTYPE), SNAPSHOT)
        ifdef LINEAGE_EXTRAVERSION
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
286
            # Force build type to EXPERIMENTAL
Luca Stefani's avatar
Luca Stefani committed
287
288
289
290
291
            LINEAGE_BUILDTYPE := EXPERIMENTAL
            # Remove leading dash from LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
            # Add leading dash to LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := -$(LINEAGE_EXTRAVERSION)
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
292
293
        endif
    else
Luca Stefani's avatar
Luca Stefani committed
294
        ifndef LINEAGE_EXTRAVERSION
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
295
            # Force build type to EXPERIMENTAL, SNAPSHOT mandates a tag
Luca Stefani's avatar
Luca Stefani committed
296
            LINEAGE_BUILDTYPE := EXPERIMENTAL
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
297
        else
Luca Stefani's avatar
Luca Stefani committed
298
299
300
301
            # Remove leading dash from LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
            # Add leading dash to LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := -$(LINEAGE_EXTRAVERSION)
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
302
        endif
303
304
    endif
else
Luca Stefani's avatar
Luca Stefani committed
305
306
307
    # If LINEAGE_BUILDTYPE is not defined, set to UNOFFICIAL
    LINEAGE_BUILDTYPE := UNOFFICIAL
    LINEAGE_EXTRAVERSION :=
308
309
endif

Luca Stefani's avatar
Luca Stefani committed
310
ifeq ($(LINEAGE_BUILDTYPE), UNOFFICIAL)
311
    ifneq ($(TARGET_UNOFFICIAL_BUILD_ID),)
Luca Stefani's avatar
Luca Stefani committed
312
        LINEAGE_EXTRAVERSION := -$(TARGET_UNOFFICIAL_BUILD_ID)
313
314
315
    endif
endif

Luca Stefani's avatar
Luca Stefani committed
316
ifeq ($(LINEAGE_BUILDTYPE), RELEASE)
317
    ifndef TARGET_VENDOR_RELEASE_BUILD_ID
Luca Stefani's avatar
Luca Stefani committed
318
        LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD)
319
320
    else
        ifeq ($(TARGET_BUILD_VARIANT),user)
Luca Stefani's avatar
Luca Stefani committed
321
322
            ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
                LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
323
            else
Luca Stefani's avatar
Luca Stefani committed
324
                LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
325
            endif
326
        else
Luca Stefani's avatar
Luca Stefani committed
327
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD)
328
329
        endif
    endif
330
else
Luca Stefani's avatar
Luca Stefani committed
331
    ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
332
        ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true)
333
334
335
336
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d_%H%M%S)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
        else
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
        endif
337
    else
338
        ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true)
339
340
341
342
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d_%H%M%S)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
        else
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
        endif
343
    endif
344
endif
345

346
PRODUCT_EXTRA_RECOVERY_KEYS += \
Dan Pasanen's avatar
Dan Pasanen committed
347
    vendor/lineage/build/target/product/security/lineage
348

Luca Stefani's avatar
Luca Stefani committed
349
-include vendor/lineage-priv/keys/keys.mk
350

Luca Stefani's avatar
Luca Stefani committed
351
LINEAGE_DISPLAY_VERSION := $(LINEAGE_VERSION)
352

353
354
ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),)
ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),build/target/product/security/testkey)
Luca Stefani's avatar
Luca Stefani committed
355
    ifneq ($(LINEAGE_BUILDTYPE), UNOFFICIAL)
356
        ifndef TARGET_VENDOR_RELEASE_BUILD_ID
Luca Stefani's avatar
Luca Stefani committed
357
358
359
360
            ifneq ($(LINEAGE_EXTRAVERSION),)
                # Remove leading dash from LINEAGE_EXTRAVERSION
                LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
                TARGET_VENDOR_RELEASE_BUILD_ID := $(LINEAGE_EXTRAVERSION)
361
362
363
364
365
366
            else
                TARGET_VENDOR_RELEASE_BUILD_ID := $(shell date -u +%Y%m%d)
            endif
        else
            TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID)
        endif
Luca Stefani's avatar
Luca Stefani committed
367
368
        ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
            LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
369
        else
Luca Stefani's avatar
Luca Stefani committed
370
            LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
371
        endif
372
373
    endif
endif
374
375
endif

376
-include $(WORKSPACE)/build_env/image-auto-bits.mk
Dan Pasanen's avatar
Dan Pasanen committed
377
-include vendor/lineage/config/partner_gms.mk