From 3563478f5358924bb2dee5c1a16889840c20b5e7 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Mon, 26 Feb 2024 13:08:05 -0300 Subject: [PATCH] chore: remove redundant arguments --- test-app/app/src/main/java/com/tns/RuntimeHelper.java | 2 +- test-app/runtime/src/main/java/com/tns/Runtime.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test-app/app/src/main/java/com/tns/RuntimeHelper.java b/test-app/app/src/main/java/com/tns/RuntimeHelper.java index 9847f3642..90a64f16e 100644 --- a/test-app/app/src/main/java/com/tns/RuntimeHelper.java +++ b/test-app/app/src/main/java/com/tns/RuntimeHelper.java @@ -148,7 +148,7 @@ public static Runtime initRuntime(Context context) { StaticConfiguration config = new StaticConfiguration(logger, appName, nativeLibDir, rootDir, appDir, classLoader, dexDir, dexThumb, appConfig, isDebuggable); - runtime = Runtime.initializeRuntimeWithConfiguration(config, appDir.toString()); + runtime = Runtime.initializeRuntimeWithConfiguration(config); if (isDebuggable) { try { v8Inspector = new AndroidJsV8Inspector(context.getFilesDir().getAbsolutePath(), context.getPackageName()); diff --git a/test-app/runtime/src/main/java/com/tns/Runtime.java b/test-app/runtime/src/main/java/com/tns/Runtime.java index 4c436b926..fe604a4c6 100644 --- a/test-app/runtime/src/main/java/com/tns/Runtime.java +++ b/test-app/runtime/src/main/java/com/tns/Runtime.java @@ -472,7 +472,7 @@ public void run() { staticConfiguration.logger.write("Worker (id=" + workerId + ")'s Runtime is initializing!"); } - Runtime runtime = initRuntime(dynamicConfiguration, appDir); + Runtime runtime = initRuntime(dynamicConfiguration); if (staticConfiguration.logger.isEnabled()) { staticConfiguration.logger.write("Worker (id=" + workerId + ")'s Runtime initialized!"); @@ -577,11 +577,11 @@ else if (msg.arg1 == MessageType.BubbleUpException) { This method initializes the runtime and should always be called first and through the main thread in order to set static configuration that all following workers can use */ - public static Runtime initializeRuntimeWithConfiguration(StaticConfiguration config, String appDir) { + public static Runtime initializeRuntimeWithConfiguration(StaticConfiguration config) { staticConfiguration = config; WorkThreadScheduler mainThreadScheduler = new WorkThreadScheduler(new MainThreadHandler(Looper.myLooper())); DynamicConfiguration dynamicConfiguration = new DynamicConfiguration(0, mainThreadScheduler, null); - Runtime runtime = initRuntime(dynamicConfiguration, appDir); + Runtime runtime = initRuntime(dynamicConfiguration); return runtime; } @@ -605,10 +605,10 @@ public static void initWorker(String jsFileName, String callingJsDir, int id) { This method deals with initializing the runtime with given configuration Does it for both workers and for the main thread */ - private static Runtime initRuntime(DynamicConfiguration dynamicConfiguration, String appDir) { + private static Runtime initRuntime(DynamicConfiguration dynamicConfiguration) { Runtime runtime = new Runtime(staticConfiguration, dynamicConfiguration); runtime.init(); - runtime.runScript(new File(appDir, "internal/ts_helpers.js")); + runtime.runScript(new File(staticConfiguration.appDir, "internal/ts_helpers.js")); return runtime; }