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

Commit 62102e74 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Treblize input device config file location"

parents 8782b571 7ead73ed
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <ctype.h>

#include <input/InputDevice.h>
#include <input/InputEventLabels.h>

namespace android {

@@ -87,11 +88,16 @@ String8 getInputDeviceConfigurationFilePathByName(
        const String8& name, InputDeviceConfigurationFileType type) {
    // Search system repository.
    String8 path;
    path.setTo(getenv("ANDROID_ROOT"));

    // Treblized input device config files will be located /odm/usr or /vendor/usr.
    char *rootsForPartition[] {"/odm", "/vendor", getenv("ANDROID_ROOT")};
    for (size_t i = 0; i < size(rootsForPartition); i++) {
        path.setTo(rootsForPartition[i]);
        path.append("/usr/");
        appendInputDeviceConfigurationFileRelativePath(path, name, type);
#if DEBUG_PROBE
    ALOGD("Probing for system provided input device configuration file: path='%s'", path.string());
        ALOGD("Probing for system provided input device configuration file: path='%s'",
              path.string());
#endif
        if (!access(path.string(), R_OK)) {
#if DEBUG_PROBE
@@ -99,6 +105,7 @@ String8 getInputDeviceConfigurationFilePathByName(
#endif
            return path;
        }
    }

    // Search user repository.
    // TODO Should only look here if not in safe mode.