Move to modern utility methods from android::base.
Moves away from crufty char* operations to std::string utility
methods, including android::base methods for splitting/parsing.
Rewrite of how Process handles scanning procfs for filesystem
references; now uses fts(3) for more sane traversal.
Replace sscanf() with new FindValue() method, also has unit tests.
Remove some unused methods. Switch almost everyone over to using
modern logging library.
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 67041047
Change-Id: I70dc512f21459d1e25b187f24289002b2c7bc7af
diff --git a/main.cpp b/main.cpp
index 30f60a1..cca738e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -25,9 +25,9 @@
#include "sehandle.h"
#include <android-base/logging.h>
+#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <cutils/klog.h>
-#include <cutils/properties.h>
#include <utils/Trace.h>
#include <stdio.h>
@@ -88,7 +88,7 @@
exit(1);
}
- if (property_get_bool("vold.debug", false)) {
+ if (android::base::GetBoolProperty("vold.debug", false)) {
vm->setDebug(true);
}
@@ -120,8 +120,8 @@
// 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");
- property_set("vold.has_quota", has_quota ? "1" : "0");
+ android::base::SetProperty("vold.has_adoptable", has_adoptable ? "1" : "0");
+ android::base::SetProperty("vold.has_quota", has_quota ? "1" : "0");
// Do coldboot here so it won't block booting,
// also the cold boot is needed in case we have flash drive
@@ -240,7 +240,7 @@
*has_adoptable = true;
}
if (fs_mgr_is_noemulatedsd(rec)
- || property_get_bool("vold.debug.default_primary", false)) {
+ || android::base::GetBoolProperty("vold.debug.default_primary", false)) {
flags |= android::vold::Disk::Flags::kDefaultPrimary;
}