More libbase updates.
These can't be submitted from aosp because they only exist internally.
Change-Id: Id08c7c2c51135053427ef5ae7dc3d86a3dac0a16
diff --git a/init/init.cpp b/init/init.cpp
index c1e9c01..36066b2 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -42,14 +42,14 @@
#include <selinux/label.h>
#include <selinux/android.h>
+#include <base/file.h>
+#include <base/stringprintf.h>
#include <cutils/android_reboot.h>
#include <cutils/fs.h>
#include <cutils/iosched_policy.h>
#include <cutils/list.h>
#include <cutils/sockets.h>
#include <private/android_filesystem_config.h>
-#include <utils/file.h>
-#include <utils/stringprintf.h>
#include "devices.h"
#include "init.h"
@@ -63,6 +63,9 @@
#include "ueventd.h"
#include "watchdogd.h"
+using android::base::ReadFileToString;
+using android::base::StringPrintf;
+
struct selabel_handle *sehandle;
struct selabel_handle *sehandle_prop;
@@ -809,10 +812,10 @@
{
static const char android_dir[] = "/proc/device-tree/firmware/android";
- std::string file_name = android::StringPrintf("%s/compatible", android_dir);
+ std::string file_name = StringPrintf("%s/compatible", android_dir);
std::string dt_file;
- android::ReadFileToString(file_name, &dt_file);
+ ReadFileToString(file_name, &dt_file);
if (!dt_file.compare("android,firmware")) {
ERROR("firmware/android is not compatible with 'android,firmware'\n");
return;
@@ -827,12 +830,12 @@
if (dp->d_type != DT_REG || !strcmp(dp->d_name, "compatible"))
continue;
- file_name = android::StringPrintf("%s/%s", android_dir, dp->d_name);
+ file_name = StringPrintf("%s/%s", android_dir, dp->d_name);
- android::ReadFileToString(file_name, &dt_file);
+ ReadFileToString(file_name, &dt_file);
std::replace(dt_file.begin(), dt_file.end(), ',', '.');
- std::string property_name = android::StringPrintf("ro.boot.%s", dp->d_name);
+ std::string property_name = StringPrintf("ro.boot.%s", dp->d_name);
if (property_set(property_name.c_str(), dt_file.c_str())) {
ERROR("Could not set property %s to value %s", property_name.c_str(), dt_file.c_str());
}