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

Commit d64bfbd2 authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by Gerrit - the friendly Code Review server
Browse files

hal: Update platform config params after parsing each kv pair

Existing code parses platform specific config_params from platform
info xml and sends all kvpairs together at the end of config_params
tag. This limits the functionality as we cannot add multiple entries
with the same key. This is because the last parsed kv pair overwrites
the existing key in the hashMap.

Example: With the following xml entries, operator_info for only sprint
entry gets updated in platform data.
<config_params>
    <param key="operator_info" value="tmus;aa;bb;cc"/>
    <param key="operator_info" value="sprint;xx;yy;zz"/>
    ...
</config_params>

Fix this by setting platform data for config params after parsing each
kv pair instead of sending all params together at the end of tag.

Change-Id: Ic4e08be0c25dc8ce07e1bd0fc0de7c4be0e84960
parent 29deabae
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -653,6 +653,8 @@ static void process_config_params(const XML_Char **attr)
    }
    }


    str_parms_add_str(my_data.kvpairs, (char*)attr[1], (char*)attr[3]);
    str_parms_add_str(my_data.kvpairs, (char*)attr[1], (char*)attr[3]);
    if (my_data.caller == PLATFORM)
        platform_set_parameters(my_data.platform, my_data.kvpairs);
done:
done:
    return;
    return;
}
}
@@ -1387,9 +1389,6 @@ static void end_tag(void *userdata __unused, const XML_Char *tag_name)
        section = ROOT;
        section = ROOT;
    } else if (strcmp(tag_name, "config_params") == 0) {
    } else if (strcmp(tag_name, "config_params") == 0) {
        section = ROOT;
        section = ROOT;
        if (my_data.caller == PLATFORM) {
            platform_set_parameters(my_data.platform, my_data.kvpairs);
        }
    } else if (strcmp(tag_name, "operator_specific") == 0) {
    } else if (strcmp(tag_name, "operator_specific") == 0) {
        section = ROOT;
        section = ROOT;
    } else if (strcmp(tag_name, "interface_names") == 0) {
    } else if (strcmp(tag_name, "interface_names") == 0) {