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

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

Change-Id: Iafdd35b374b25b5011cd168571c10560b952a4fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-06-13 00:17:31 +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);