init: Factor GetBlockDeviceInfo() out of GetBlockDeviceSymlinks()
Later code will want to use GetBlockDeviceInfo(), so factor it out to
a helper function. This change is intended to be a no-op.
Bug: 316324155
Test: Build & boot
Change-Id: If5d63f39efcd84a07eb8c6fa4f28bda45c4cbe5c
diff --git a/init/devices.h b/init/devices.h
index 6da1232..82cb56e 100644
--- a/init/devices.h
+++ b/init/devices.h
@@ -116,6 +116,12 @@
std::string dir_name_ = "/dev";
};
+struct BlockDeviceInfo {
+ std::string str;
+ std::string type;
+ bool is_boot_device;
+};
+
class DeviceHandler : public UeventHandler {
public:
friend class DeviceHandlerTester;
@@ -136,6 +142,7 @@
private:
void ColdbootDone() override;
+ BlockDeviceInfo GetBlockDeviceInfo(const std::string& uevent_path) const;
bool FindPlatformDevice(std::string path, std::string* platform_device_path) const;
std::tuple<mode_t, uid_t, gid_t> GetDevicePermissions(
const std::string& path, const std::vector<std::string>& links) const;