OSDN Git Service

Offer debug flag to force default primary.
authorJeff Sharkey <jsharkey@android.com>
Tue, 19 May 2015 22:54:15 +0000 (15:54 -0700)
committerJeff Sharkey <jsharkey@android.com>
Tue, 19 May 2015 22:54:15 +0000 (15:54 -0700)
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

main.cpp

index df2e0a8..fb8ffc4 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -228,7 +228,8 @@ static int process_config(VolumeManager *vm) {
                 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;
             }