From 366cb5a00a44ed8e6d9fcaa263be61edc21900b0 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 20 Apr 2017 03:09:42 -0700 Subject: [PATCH] Remove unused PersistentDirectory JSC config Reviewed By: amnn Differential Revision: D4921075 fbshipit-source-id: 8e0a0caadc882a0e3ffb6f66c2bc7336c7d64849 --- ReactAndroid/src/main/jni/xreact/jni/OnLoad.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ReactAndroid/src/main/jni/xreact/jni/OnLoad.cpp b/ReactAndroid/src/main/jni/xreact/jni/OnLoad.cpp index 7be58ad9f..b275df571 100644 --- a/ReactAndroid/src/main/jni/xreact/jni/OnLoad.cpp +++ b/ReactAndroid/src/main/jni/xreact/jni/OnLoad.cpp @@ -34,7 +34,7 @@ namespace react { namespace { -static std::string getApplicationDir(const char* methodName) { +static std::string getApplicationCacheDir(void) { // Get the Application Context object auto getApplicationClass = findClassLocal( "com/facebook/react/common/ApplicationHolder"); @@ -46,7 +46,7 @@ static std::string getApplicationDir(const char* methodName) { // Get getCacheDir() from the context auto getDirMethod = findClassLocal("android/app/Application") - ->getMethod(methodName, + ->getMethod("getCacheDir", "()Ljava/io/File;" ); auto dirObj = getDirMethod(application); @@ -57,14 +57,6 @@ static std::string getApplicationDir(const char* methodName) { return getAbsolutePathMethod(dirObj)->toStdString(); } -static std::string getApplicationCacheDir() { - return getApplicationDir("getCacheDir"); -} - -static std::string getApplicationPersistentDir() { - return getApplicationDir("getFilesDir"); -} - static JSValueRef nativePerformanceNow( JSContextRef ctx, JSObjectRef function, @@ -95,7 +87,6 @@ class JSCJavaScriptExecutorHolder : public HybridClass initHybrid(alias_ref, ReadableNativeArray* jscConfigArray) { // See JSCJavaScriptExecutor.Factory() for the other side of this hack. folly::dynamic jscConfigMap = jscConfigArray->consume()[0]; - jscConfigMap["PersistentDirectory"] = getApplicationPersistentDir(); return makeCxxInstance( std::make_shared(getApplicationCacheDir(), std::move(jscConfigMap))); }