Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caeb150e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents 63d6c51c e84123b1
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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);