Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be73c527 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Fix buildCommonTypesStructureFile.py script

The PFW script buildCommonTypesStructureFile.py got broken
by the change which had moved many enums to audio-hal-enums.h
header. This change makes necessary adjustments to restore
its functionality and preserve the generated PFW config file
contents.

Bug: 142480271
Bug: 172641529
Test: m
Test: atest libmedia_helper_tests
Test: diff vendor/etc/parameter-framework contents for a device
Change-Id: I15db2ce6bf9c408b96b6921a45093e2849826e24
Merged-In: I15db2ce6bf9c408b96b6921a45093e2849826e24
parent dc6be0d5
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -126,9 +126,9 @@ def parseAndroidAudioFile(androidaudiobaseheaderFile):
    ignored_values = ['CNT', 'MAX', 'ALL', 'NONE']

    criteria_pattern = re.compile(
        r"\s*(?P<type>(?:"+'|'.join(component_type_mapping_table.keys()) + "))_" \
        r"(?P<literal>(?!" + '|'.join(ignored_values) + ")\w*)\s*=\s*" \
        r"(?P<values>(?:0[xX])?[0-9a-fA-F]+)")
        r"\s*V\((?P<type>(?:"+'|'.join(component_type_mapping_table.keys()) + "))_" \
        r"(?P<literal>(?!" + '|'.join(ignored_values) + ")\w*)\s*,\s*" \
        r"(?:AUDIO_DEVICE_BIT_IN \| )?(?P<values>(?:0[xX])[0-9a-fA-F]+|[0-9]+)")

    logging.info("Checking Android Header file {}".format(androidaudiobaseheaderFile))

@@ -164,6 +164,13 @@ def parseAndroidAudioFile(androidaudiobaseheaderFile):

            logging.debug("type:{}, literal:{}, values:{}.".format(component_type_name, component_type_literal, component_type_numerical_value))

    if "stub" not in all_component_types["OutputDevicesMask"]:
        all_component_types["OutputDevicesMask"]["stub"] = 0x40000000
        logging.info("added stub output device mask")
    if "stub" not in all_component_types["InputDevicesMask"]:
        all_component_types["InputDevicesMask"]["stub"] = 0x40000000
        logging.info("added stub input device mask")

    # Transform input source in inclusive criterion
    shift = len(all_component_types['OutputDevicesMask'])
    if shift > 32: