From c89e258434212c77952280a0d29c9fc581b84372 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Tue, 22 Aug 2023 17:40:28 +0000 Subject: Migrate from android::String path functions to std::filesystem Bug: 295394788 Test: m checkbuild Change-Id: I67d5608dd3e9d81f762d0d4cd81ccc50db77b2af --- Android.bp | 3 +++ FaceDetector_jni.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Android.bp b/Android.bp index 0291f97..1121f27 100644 --- a/Android.bp +++ b/Android.bp @@ -145,6 +145,9 @@ cc_library_shared { "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 +#include #include #include #include @@ -119,9 +120,9 @@ initialize(JNIEnv *_env, jobject _this, { // 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 */ -- cgit v1.2.3