diff --git a/main.cpp b/main.cpp
index 9cbcf88..68477ac 100644
--- a/main.cpp
+++ b/main.cpp
@@ -39,7 +39,7 @@
 #include <dirent.h>
 #include <fs_mgr.h>
 
-static int process_config(VolumeManager *vm);
+static int process_config(VolumeManager *vm, bool* has_adoptable);
 static void coldboot(const char *path);
 static void parse_args(int argc, char** argv);
 
@@ -106,7 +106,9 @@
         exit(1);
     }
 
-    if (process_config(vm)) {
+    bool has_adoptable;
+
+    if (process_config(vm, &has_adoptable)) {
         PLOG(ERROR) << "Error reading configuration... continuing anyways";
     }
 
@@ -131,6 +133,10 @@
         exit(1);
     }
 
+    // This call should go after listeners are started to avoid
+    // a deadlock between vold and init (see b/34278978 for details)
+    property_set("vold.has_adoptable", has_adoptable ? "1" : "0");
+
     // Eventually we'll become the monitoring thread
     while(1) {
         sleep(1000);
@@ -207,7 +213,7 @@
     }
 }
 
-static int process_config(VolumeManager *vm) {
+static int process_config(VolumeManager *vm, bool* has_adoptable) {
     std::string path(android::vold::DefaultFstabPath());
     fstab = fs_mgr_read_fstab(path.c_str());
     if (!fstab) {
@@ -216,7 +222,7 @@
     }
 
     /* Loop through entries looking for ones that vold manages */
-    bool has_adoptable = false;
+    *has_adoptable = false;
     for (int i = 0; i < fstab->num_entries; i++) {
         if (fs_mgr_is_voldmanaged(&fstab->recs[i])) {
             if (fs_mgr_is_nonremovable(&fstab->recs[i])) {
@@ -230,7 +236,7 @@
 
             if (fs_mgr_is_encryptable(&fstab->recs[i])) {
                 flags |= android::vold::Disk::Flags::kAdoptable;
-                has_adoptable = true;
+                *has_adoptable = true;
             }
             if (fs_mgr_is_noemulatedsd(&fstab->recs[i])
                     || property_get_bool("vold.debug.default_primary", false)) {
@@ -241,6 +247,5 @@
                     new VolumeManager::DiskSource(sysPattern, nickname, flags)));
         }
     }
-    property_set("vold.has_adoptable", has_adoptable ? "1" : "0");
     return 0;
 }
