Loading init/devices.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <unistd.h> #include <chrono> #include <filesystem> #include <memory> #include <string> #include <thread> Loading Loading @@ -439,6 +440,13 @@ void DeviceHandler::HandleDevice(const std::string& action, const std::string& d } } unlink(devpath.c_str()); if (android::base::StartsWith(devpath, "/dev/dm-user/")) { std::error_code ec; if (std::filesystem::is_empty("/dev/dm-user/", ec)) { rmdir("/dev/dm-user"); } } } } Loading Loading @@ -496,6 +504,8 @@ void DeviceHandler::HandleUevent(const Uevent& uevent) { } else if (StartsWith(uevent.subsystem, "usb")) { // ignore other USB events return; } else if (uevent.subsystem == "misc" && StartsWith(uevent.device_name, "dm-user/")) { devpath = "/dev/dm-user/" + uevent.device_name.substr(8); } else { devpath = "/dev/" + Basename(uevent.path); } Loading Loading
init/devices.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <unistd.h> #include <chrono> #include <filesystem> #include <memory> #include <string> #include <thread> Loading Loading @@ -439,6 +440,13 @@ void DeviceHandler::HandleDevice(const std::string& action, const std::string& d } } unlink(devpath.c_str()); if (android::base::StartsWith(devpath, "/dev/dm-user/")) { std::error_code ec; if (std::filesystem::is_empty("/dev/dm-user/", ec)) { rmdir("/dev/dm-user"); } } } } Loading Loading @@ -496,6 +504,8 @@ void DeviceHandler::HandleUevent(const Uevent& uevent) { } else if (StartsWith(uevent.subsystem, "usb")) { // ignore other USB events return; } else if (uevent.subsystem == "misc" && StartsWith(uevent.device_name, "dm-user/")) { devpath = "/dev/dm-user/" + uevent.device_name.substr(8); } else { devpath = "/dev/" + Basename(uevent.path); } Loading