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

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

Merge "init: prevent persist.sys.usb.config initalized as none,adb"

parents 0e49bfa8 bb578203
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -813,7 +813,9 @@ static bool load_properties_from_file(const char* filename, const char* filter,
static void update_sys_usb_config() {
    bool is_debuggable = android::base::GetBoolProperty("ro.debuggable", false);
    std::string config = android::base::GetProperty("persist.sys.usb.config", "");
    if (config.empty()) {
    // b/150130503, add (config == "none") condition here to prevent appending
    // ",adb" if "none" is explicitly defined in default prop.
    if (config.empty() || config == "none") {
        InitPropertySet("persist.sys.usb.config", is_debuggable ? "adb" : "none");
    } else if (is_debuggable && config.find("adb") == std::string::npos &&
               config.length() + 4 < PROP_VALUE_MAX) {