diff options
author | Subhash Jadavani <subhashj@codeaurora.org> | 2017-07-06 15:53:24 -0700 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2017-12-20 22:14:52 +0200 |
commit | 18335a5b00d5144655a7b334c03993495e48abcd (patch) | |
tree | 2934bbd39699aaf3b07e5e0e40750611f517fcc6 | |
parent | de540c400f1df774ba19db7e465bf80ad956670a (diff) | |
download | android_system_vold-18335a5b00d5144655a7b334c03993495e48abcd.tar.gz android_system_vold-18335a5b00d5144655a7b334c03993495e48abcd.tar.bz2 android_system_vold-18335a5b00d5144655a7b334c03993495e48abcd.zip |
Treat removable UFS card as SD card
Removable UFS cards are alternative to SD cards and they are detected as
SCSI block devices. Currently these cards shows up "USB disk" as we
consider anything other than SD card as USB disks. As both UFS cards
and USB disks are SCSI block devices, we can't differentiate between
USB disks and UFS cards by MAJOR number of block device. This change
looks for "ufs" string in DEVPATH parameter of uevent to detect if it
is UFS card or not and treat it as SD card.
Change-Id: I88534190d0610ced515c8c3e53aaae1a49480fbf
-rw-r--r-- | VolumeManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 601aee1..0f5739e 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -359,11 +359,12 @@ void VolumeManager::handleBlockEvent(NetlinkEvent *evt) { case NetlinkEvent::Action::kAdd: { for (const auto& source : mDiskSources) { if (source->matches(eventPath)) { - // For now, assume that MMC and virtio-blk (the latter is - // emulator-specific; see Disk.cpp for details) devices are SD, - // and that everything else is USB + // For now, assume that MMC, virtio-blk (the latter is + // emulator-specific; see Disk.cpp for details) and UFS card + // devices are SD, and that everything else is USB int flags = source->getFlags(); if (major == kMajorBlockMmc + || (eventPath.find("ufs") != std::string::npos) || (android::vold::IsRunningInEmulator() && major >= (int) kMajorBlockExperimentalMin && major <= (int) kMajorBlockExperimentalMax)) { |