@@ -62,8 +62,6 @@ static AAMPJSBindings* gAAMPJSBindings = nullptr;
6262// BIG CHANGE
6363extern void functionLoadModule (JSGlobalContextRef ref, JSObjectRef globalObjectRef, char * buffer, int len, char * name);
6464
65- static const char * envValue = std::getenv(" NATIVEJS_DUMP_NETWORKMETRIC" );
66-
6765JSContextGroupRef globalContextGroup ()
6866{
6967 static JSContextGroupRef gGroupRef = JSContextGroupCreate ();
@@ -134,13 +132,17 @@ void JavaScriptContext::loadAAMPJSBindingsLib()
134132 if (nullptr == gAAMPJSBindings ->PlayerLibHandle )
135133 {
136134 static const char *aampJSBindingsLib = " libaampjsbindings.so" ;
135+ // This is required for NativeJS Plugin
136+ #if 0
137137 static const char *jscLib = "libJavaScriptCore.so";
138138 jscLibHandle = dlopen(jscLib, RTLD_NOW | RTLD_GLOBAL);
139139 if (!jscLibHandle)
140140 {
141141 std::cout<<"dlopen error for jsc library " << dlerror() << std::endl;
142142 }
143- void *aampJSBindingsLibHandle = dlopen (aampJSBindingsLib, RTLD_NOW | RTLD_GLOBAL );
143+ #endif
144+
145+ void *aampJSBindingsLibHandle = dlopen (aampJSBindingsLib, RTLD_NOW | RTLD_GLOBAL );
144146 if (aampJSBindingsLibHandle)
145147 {
146148 gAAMPJSBindings ->PlayerLibHandle = aampJSBindingsLibHandle;
@@ -165,7 +167,7 @@ void JavaScriptContext::unloadAAMPJSBindingsLib()
165167 if (nullptr != gAAMPJSBindings ->PlayerLibHandle )
166168 {
167169 dlclose (gAAMPJSBindings ->PlayerLibHandle );
168- dlclose (jscLibHandle);
170+ // dlclose(jscLibHandle);
169171
170172 }
171173}
@@ -481,9 +483,7 @@ void JavaScriptContext::onMetricsData (NetworkMetrics *net)
481483 rtString key = net->url ;
482484 mNetworkMetricsData ->set (key, rtValue ((void *)net));
483485
484- if (envValue) {
485- dumpNetworkMetricData (net, this ->getUrl ());
486- }
486+ dumpNetworkMetricData (net, this ->getUrl ());
487487}
488488
489489void JavaScriptContext::dumpNetworkMetricData (NetworkMetrics *metrics, std::string appUrl)
0 commit comments