diff --git a/android/phoenix/src/com/retroarch/browser/ModuleWrapper.java b/android/phoenix/src/com/retroarch/browser/ModuleWrapper.java index 72653b1dc9..77f3ca5497 100644 --- a/android/phoenix/src/com/retroarch/browser/ModuleWrapper.java +++ b/android/phoenix/src/com/retroarch/browser/ModuleWrapper.java @@ -46,31 +46,43 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable(Arrays.asList(supportedExts.split("|"))); + final ConfigFile infoFile = new ConfigFile(infoFilePath); + + // Now read info out of the info file. Make them an empty string if the key doesn't exist. + this.displayName = (infoFile.keyExists("display_name")) ? infoFile.getString("display_name") : ""; + this.coreName = (infoFile.keyExists("corename")) ? infoFile.getString("corename") : ""; + this.systemName = (infoFile.keyExists("systemname")) ? infoFile.getString("systemname") : ""; + this.manufacturer = (infoFile.keyExists("manufacturer")) ? infoFile.getString("manufacturer") : ""; + this.license = (infoFile.keyExists("license")) ? infoFile.getString("license") : ""; + + // Getting supported extensions is a little different. + // We need to split at every '|' character, since it is + // the delimiter for a new extension that the core supports. + // + // Cores that don't have multiple extensions supported + // don't contain the '|' delimiter, so we just create a String array with + // a size of 1, and just directly assign the retrieved extensions to it. + final String supportedExts = infoFile.getString("supported_extensions"); + if (supportedExts != null && supportedExts.contains("|")) + { + this.supportedExtensions = new ArrayList(Arrays.asList(supportedExts.split("|"))); + } + else + { + this.supportedExtensions = new ArrayList(); + this.supportedExtensions.add(supportedExts); + } } - else + else // No info file. { - this.supportedExtensions = new ArrayList(); - this.supportedExtensions.add(supportedExts); + this.displayName = "N/A"; + this.systemName = "N/A"; + this.manufacturer = "N/A"; + this.license = "N/A"; + this.supportedExtensions = new ArrayList(); + this.coreName = coreName; } }