Offer debug flag to force default primary.
Useful for transforming a secondary SD card slot into a primary SD
card slot without doing a completely different lunch target.
$ adb shell stop
$ adb shell setprop vold.debug.default_primary 1
$ adb shell setprop ro.vold.primary_physical 1
$ adb shell setprop ctl.restart vold
$ adb shell start
Bug: 21017105
Change-Id: I45aac7ab3bb4c5ac3e0140572844883823fc3e4f
diff --git a/main.cpp b/main.cpp
index df2e0a8..fb8ffc4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -228,7 +228,8 @@
flags |= android::vold::Disk::Flags::kAdoptable;
has_adoptable = true;
}
- if (fs_mgr_is_noemulatedsd(&fstab->recs[i])) {
+ if (fs_mgr_is_noemulatedsd(&fstab->recs[i])
+ || property_get_bool("vold.debug.default_primary", false)) {
flags |= android::vold::Disk::Flags::kDefaultPrimary;
}