From a8a951b50959074e6dbe604c5e0b5b376e316631 Mon Sep 17 00:00:00 2001 From: hmz007 Date: Mon, 8 Jun 2020 14:55:17 +0800 Subject: [PATCH] android: vold: Support to ignore boot device Signed-off-by: hmz007 --- system/vold/VolumeManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system/vold/VolumeManager.cpp b/system/vold/VolumeManager.cpp index dc6fae98ddb..755a3ab9f93 100644 --- a/system/vold/VolumeManager.cpp +++ b/system/vold/VolumeManager.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -212,6 +213,14 @@ void VolumeManager::handleBlockEvent(NetlinkEvent* evt) { if (devType != "disk") return; + char boot_devices[PROPERTY_VALUE_MAX]; + property_get("ro.boot.boot_devices", boot_devices, ""); + if (strlen(boot_devices) > 0 && + eventPath.find(boot_devices) != std::string::npos) { + LOG(DEBUG) << "ignore boot device " << boot_devices; + return; + } + int major = std::stoi(evt->findParam("MAJOR")); int minor = std::stoi(evt->findParam("MINOR")); dev_t device = makedev(major, minor);