OSDN Git Service

Communicate if we have adoptable disks.
authorJeff Sharkey <jsharkey@android.com>
Wed, 13 May 2015 20:53:07 +0000 (13:53 -0700)
committerJeff Sharkey <jsharkey@android.com>
Wed, 13 May 2015 20:53:07 +0000 (13:53 -0700)
Bug: 19993667
Change-Id: I3c3dddab157a11038f7160d24d53e728bde2194f

main.cpp

index ed2a88a..df2e0a8 100644 (file)
--- 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;
 }