libutils: String\d+ make std_string private

This method is still used by prebuilts, but making it private to start
the process of removing it from everywhere.

Test: pass
Bug: 35363681
Change-Id: I4d53f68d10c9abcca32023c4d930e99912afa697
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 0c90a54..45b6eda 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -129,7 +129,7 @@
 }
 
 int BatteryMonitor::readFromFile(const String8& path, std::string* buf) {
-    if (android::base::ReadFileToString(String8::std_string(path), buf)) {
+    if (android::base::ReadFileToString(path.c_str(), buf)) {
         *buf = android::base::Trim(*buf);
     }
     return buf->length();
diff --git a/libutils/include/utils/String16.h b/libutils/include/utils/String16.h
index 07c4de7..f6433a8 100644
--- a/libutils/include/utils/String16.h
+++ b/libutils/include/utils/String16.h
@@ -67,7 +67,10 @@
 
     inline  const char16_t*     string() const;
 
+//TODO(b/35363681): remove
+private:
     static inline std::string   std_string(const String16& str);
+public:
             size_t              size() const;
             void                setTo(const String16& other);
             status_t            setTo(const char16_t* other);
diff --git a/libutils/include/utils/String8.h b/libutils/include/utils/String8.h
index 1d12994..f5f9219 100644
--- a/libutils/include/utils/String8.h
+++ b/libutils/include/utils/String8.h
@@ -64,8 +64,14 @@
     static String8              format(const char* fmt, ...) __attribute__((format (printf, 1, 2)));
     static String8              formatV(const char* fmt, va_list args);
 
+    inline  const char*         c_str() const;
     inline  const char*         string() const;
+
+// TODO(b/35363681): remove
+private:
     static inline std::string   std_string(const String8& str);
+public:
+
     inline  size_t              size() const;
     inline  size_t              bytes() const;
     inline  bool                isEmpty() const;
@@ -259,6 +265,10 @@
     return String8();
 }
 
+inline const char* String8::c_str() const
+{
+    return mString;
+}
 inline const char* String8::string() const
 {
     return mString;