Merge "Migrate from android::String path functions to std::filesystem" into main am: 58a352c5d7 am: 9433200ff0 am: 3e5a44cc29

Original change: https://android-review.googlesource.com/c/platform/external/neven/+/2722493

Change-Id: Ie5e396544ad35ec5d4549e5a0146fa2e28d4f97f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Android.bp b/Android.bp
index 0291f97..1121f27 100644
--- a/Android.bp
+++ b/Android.bp
@@ -145,6 +145,9 @@
         "libcutils",
     ],
 
+    whole_static_libs: [
+        "libc++fs",
+    ],
 
     required: [
         "RFFspeed_501.bmd",
diff --git a/FaceDetector_jni.cpp b/FaceDetector_jni.cpp
index 650cbf0..1741195 100644
--- a/FaceDetector_jni.cpp
+++ b/FaceDetector_jni.cpp
@@ -15,6 +15,7 @@
  */
 
 #include <assert.h>
+#include <filesystem>
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
@@ -119,9 +120,9 @@
 {
     // load the configuration file
     const char* root = getenv("ANDROID_ROOT");
-    String8 path(root);
-    path.appendPath("usr/share/bmd/RFFstd_501.bmd");
-    // path.appendPath("usr/share/bmd/RFFspeed_501.bmd");
+    std::filesystem::path path(root);
+    path /= "usr/share/bmd/RFFstd_501.bmd";
+    // path /= "usr/share/bmd/RFFspeed_501.bmd";
 
     const int MAX_FILE_SIZE = 65536;
     void* initData = malloc( MAX_FILE_SIZE ); /* enough to fit entire file */