Merge "Lock down String8.isEmpty() usage" into main am: 358a982b71

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2705824

Change-Id: I5bc53c672684341d978118fb3d802d0fd9cc3680
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libutils/include/utils/String8.h b/libutils/include/utils/String8.h
index c807473..0b92f5b 100644
--- a/libutils/include/utils/String8.h
+++ b/libutils/include/utils/String8.h
@@ -70,7 +70,6 @@
     inline  size_t              size() const;
     inline  size_t              bytes() const;
     inline  bool                empty() const;
-    inline  bool                isEmpty() const;
 
             size_t              length() const;
 
@@ -149,6 +148,14 @@
             status_t            real_append(const char* other, size_t numChars);
 
             const char* mString;
+
+// These symbols are for potential backward compatibility with prebuilts. To be removed.
+#ifdef ENABLE_STRING8_OBSOLETE_METHODS
+public:
+#else
+private:
+#endif
+    inline  bool                isEmpty() const;
 };
 
 // String8 can be trivially moved using memcpy() because moving does not