summaryrefslogtreecommitdiffstats
path: root/Utils.cpp
diff options
context:
space:
mode:
authorYu Ning <yu.ning@intel.com>2016-01-08 17:36:47 +0800
committerPrathmesh Prabhu <pprabhu@google.com>2016-03-08 12:19:41 -0800
commit942d4e830b2057177fd2d47c51b788edd6e94398 (patch)
tree33654832bdc3d291b0766a2c4e4fa4c141a24fe9 /Utils.cpp
parentad8e26297b07f26376bd3125b11ae280304c22e8 (diff)
downloadandroid_system_vold-942d4e830b2057177fd2d47c51b788edd6e94398.tar.gz
android_system_vold-942d4e830b2057177fd2d47c51b788edd6e94398.tar.bz2
android_system_vold-942d4e830b2057177fd2d47c51b788edd6e94398.zip
Support emulator's virtio-blk based SD card
Currently, vold only supports MMC (for SD cards) and SCSI (for USB drives) devices. It does not recognize any device whose major number is not one of those used by MMC and SCSI. Unfortunately, virtio-blk is one such device. It is used by the new Android emulator (a.k.a. qemu2, featuring the "ranchu" virtual board) for SD card emulation. In order to make this virtio-blk based SD card device appear in Android and appear as an SD card (rather than a USB drive), changes have to be made to both vold (wherever the device major number is checked) and ranchu's storage configuration. This CL implements former. This is a stop-gap solution for emulator in nyc. A longer term solution in-tune with upstream kernel is in the pipes. Updated from aosp/master version. BUG:27431753 Change-Id: I5014edec73be7c5b565d91542464c82cbe58992c Signed-off-by: Yu Ning <yu.ning@intel.com> (cherry picked from commit 5b1d1c7dfa13b4dca75213581dc8351b841b76c8)
Diffstat (limited to 'Utils.cpp')
-rw-r--r--Utils.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utils.cpp b/Utils.cpp
index 942945d..9d5f168 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -664,5 +664,9 @@ ScopedDir::~ScopedDir() {
}
}
+bool IsRunningInEmulator() {
+ return property_get_bool("ro.kernel.qemu", 0);
+}
+
} // namespace vold
} // namespace android