Skip to content

Commit

Permalink
aospdtgen: Make brand and model props optional
Browse files Browse the repository at this point in the history
Change-Id: I2f6210ac09f81093f51fa793073a4e8c83b7a51c
  • Loading branch information
SebaUbuntu committed May 16, 2022
1 parent 7a8fb33 commit 14cb0d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions aospdtgen/templates/lineage_device.mk.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ $(call inherit-product, device/{{ device_info.manufacturer }}/{{ device_info.cod

PRODUCT_DEVICE := {{ device_info.codename }}
PRODUCT_NAME := lineage_{{ device_info.codename }}
{% if device_info.brand %}
PRODUCT_BRAND := {{ device_info.brand }}
{% endif %}
{% if device_info.model %}
PRODUCT_MODEL := {{ device_info.model }}
{% endif %}
PRODUCT_MANUFACTURER := {{ device_info.manufacturer }}

PRODUCT_GMS_CLIENTID_BASE := {{ device_info.gms_clientid_base }}
Expand Down
4 changes: 2 additions & 2 deletions aospdtgen/utils/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def __init__(self, buildprop: BuildProp):
# Parse props
self.codename = self.get_prop(DEVICE_CODENAME)
self.manufacturer = self.get_prop(DEVICE_MANUFACTURER).split()[0].lower()
self.brand = self.get_prop(DEVICE_BRAND)
self.model = self.get_prop(DEVICE_MODEL)
self.brand = self.get_prop(DEVICE_BRAND, raise_exception=False)
self.model = self.get_prop(DEVICE_MODEL, raise_exception=False)
self.build_fingerprint = self.get_prop(BUILD_FINGERPRINT)
self.build_description = self.get_prop(BUILD_DESCRIPTION, default=fingerprint_to_description(self.build_fingerprint))

Expand Down

0 comments on commit 14cb0d6

Please sign in to comment.