Merge "Get input-port-associations config files from ODM partition" am: caeb150e54 am: c40394448a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2583451

Change-Id: Ibdc3bbcbb2f51288634b974a9e0cf740ad7346be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-06-13 01:00:32 +00:00
committed by Automerger Merge Worker

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);