From e44a41a17b5c2d488442d7805b08231f4b327aca Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 13 May 2015 13:53:07 -0700 Subject: [PATCH] Communicate if we have adoptable disks. Bug: 19993667 Change-Id: I3c3dddab157a11038f7160d24d53e728bde2194f --- main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index ed2a88a..df2e0a8 100644 --- a/main.cpp +++ b/main.cpp @@ -194,6 +194,7 @@ static void coldboot(const char *path) { } static int process_config(VolumeManager *vm) { + bool has_adoptable = false; char hardware[PROPERTY_VALUE_MAX]; property_get("ro.hardware", hardware, ""); std::string fstab_filename(StringPrintf("/fstab.%s", hardware)); @@ -225,6 +226,7 @@ static int process_config(VolumeManager *vm) { if (fs_mgr_is_encryptable(&fstab->recs[i])) { flags |= android::vold::Disk::Flags::kAdoptable; + has_adoptable = true; } if (fs_mgr_is_noemulatedsd(&fstab->recs[i])) { flags |= android::vold::Disk::Flags::kDefaultPrimary; @@ -234,6 +236,6 @@ static int process_config(VolumeManager *vm) { new VolumeManager::DiskSource(sysPattern, nickname, flags))); } } - + property_set("vold.has_adoptable", has_adoptable ? "1" : "0"); return 0; }