Merge main from android.googlesource.com

Change-Id: I8f84b00b66149765b764202c440e6cd99e8e2822
diff --git a/Parcel.cpp b/Parcel.cpp
index a20d98c..99389d7 100644
--- a/Parcel.cpp
+++ b/Parcel.cpp
@@ -596,7 +596,7 @@
 
 status_t Parcel::writeString16(const String16& str)
 {
-    return writeString16(str.string(), str.size());
+    return writeString16(str.c_str(), str.size());
 }
 
 status_t Parcel::writeString16(const char16_t* str, size_t len)
diff --git a/ProcessState.cpp b/ProcessState.cpp
index 1431ee9..7b49675 100644
--- a/ProcessState.cpp
+++ b/ProcessState.cpp
@@ -38,6 +38,8 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <mutex>
+
 #define DEFAULT_BINDER_VM_SIZE ((1 * 1024 * 1024) - sysconf(_SC_PAGE_SIZE) * 2)
 #define DEFAULT_MAX_BINDER_THREADS 0
 #define DEFAULT_ENABLE_ONEWAY_SPAM_DETECTION 1
@@ -301,9 +303,9 @@
 {
     if (mThreadPoolStarted) {
         String8 name = makeBinderThreadName();
-        ALOGV("Spawning new pooled thread, name=%s\n", name.string());
+        ALOGV("Spawning new pooled thread, name=%s\n", name.c_str());
         sp<Thread> t = new PoolThread(isMain);
-        t->run(name.string());
+        t->run(name.c_str());
     }
 }
 
@@ -358,7 +360,7 @@
 }
 
 void ProcessState::giveThreadPoolName() {
-    androidSetThreadName( makeBinderThreadName().string() );
+    androidSetThreadName( makeBinderThreadName().c_str() );
 }
 
 static int open_driver()
diff --git a/TextOutput.h b/TextOutput.h
index 9611ddb..ec4000b 100644
--- a/TextOutput.h
+++ b/TextOutput.h
@@ -137,7 +137,7 @@
 
 inline TextOutput& operator<<(TextOutput& to, const String16& val)
 {
-    to << String8(val).string();
+    to << String8(val).c_str();
     return to;
 }