function updateConfigFilesFrom (sourceConfig, configMunger, locations) {
    events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);

    // First cleanup current config and merge project's one into own
    // Overwrite platform config.xml with defaults.xml.
    fs.cpSync(locations.defaultConfigXml, locations.configXml);

    // Then apply config changes from global munge to all config files
    // in project (including project's config)
    configMunger.reapply_global_munge().save_all();

    events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
    // Merge changes from app's config.xml into platform's one
    const config = new ConfigParser(locations.configXml);
    xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
        config.doc.getroot(), 'android', /* clobber= */true);

    config.write();
    return config;
}
Updates config files in project based on app's config.xml and config munge,
  generated by plugins.

@param   {ConfigParser}   sourceConfig  A project's configuration that will
  be merged into platform's config.xml
@param   {ConfigChanges}  configMunger  An initialized ConfigChanges instance
  for this platform.
@param   {Object}         locations     A map of locations for this platform

@return  {ConfigParser}                 An instance of ConfigParser, that
  represents current project's configuration. When returned, the
  configuration is already dumped to appropriate config.xml file.