Get input-port-associations config files from ODM partition

1.For fold devices, some necessary config files must be configured in
   vendor partition.These config files will effect some phones that has
   the same Soc.
2.Odm partition is intended for hardware SKUs. For GSI, odm partition
   can keep the logic of original design manufacturers.
3.Add getting input-port-associations.xml from odm partition.

Bug: 276181381
Change-Id: I4486398b19749ada67f53645bc97cf6d8482c3c7
Signed-off-by: liupengle <liupenglei@xiaomi.corp-partner.google.com>
This commit is contained in:
liupengle
2023-05-09 14:27:59 +08:00
committed by Penglei Liu
parent 3aa1e30014
commit e84123b1c2

View File

@@ -3105,12 +3105,17 @@ public class InputManagerService extends IInputManager.Stub
}
/**
* Ports are highly platform-specific, so only allow these to be specified in the vendor
* Ports are highly platform-specific, so allow these to be specified in the odm/vendor
* directory.
*/
private static Map<String, Integer> loadStaticInputPortAssociations() {
final File baseDir = Environment.getVendorDirectory();
final File confFile = new File(baseDir, PORT_ASSOCIATIONS_PATH);
File baseDir = Environment.getOdmDirectory();
File confFile = new File(baseDir, PORT_ASSOCIATIONS_PATH);
if (!confFile.exists()) {
baseDir = Environment.getVendorDirectory();
confFile = new File(baseDir, PORT_ASSOCIATIONS_PATH);
}
try (final InputStream stream = new FileInputStream(confFile)) {
return ConfigurationProcessor.processInputPortAssociations(stream);