mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 11:25:34 -04:00
Clean up and removed loggings
This commit is contained in:
parent
1e7566bf78
commit
d66e2001da
@ -46,20 +46,6 @@ class ServiceModule {
|
||||
fun providesIpAddressCallbacks(service: Service): IpAddressCallbacks =
|
||||
service as IpAddressCallbacks
|
||||
|
||||
// @Provides
|
||||
// @ServiceScope
|
||||
// fun providesLibrary(): Library = Library()
|
||||
|
||||
// @Provides
|
||||
// @ServiceScope
|
||||
// fun providesJNIKiwixServer(jniKiwixLibrary: Library): JNIKiwixServer =
|
||||
// KiwixServer(jniKiwixLibrary)
|
||||
|
||||
// @Provides
|
||||
// @ServiceScope
|
||||
// fun providesKiwixLibraryFactory(): Library =
|
||||
// LibraryFactory()
|
||||
|
||||
@Provides
|
||||
@ServiceScope
|
||||
fun providesHotspotNotificationManager(
|
||||
|
@ -18,14 +18,9 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.nav.destination.library
|
||||
|
||||
import android.util.Log
|
||||
import org.kiwix.kiwixlib.Library
|
||||
import javax.inject.Inject
|
||||
|
||||
private const val TAG = "LibraryFactory"
|
||||
class LibraryFactory @Inject constructor() : Library() {
|
||||
fun createKiwixLibrary(): Library {
|
||||
Log.d(TAG, "createKiwixLibrary: instance check of Library from factory: { ${Library()} } ")
|
||||
return Library()
|
||||
}
|
||||
fun createKiwixLibrary(): Library = Library()
|
||||
}
|
||||
|
@ -33,15 +33,13 @@ class KiwixServer @Inject constructor(kiwixLibraryFactory: LibraryFactory) {
|
||||
|
||||
fun createKiwixServer(selectedBooksPath: ArrayList<String>): JNIKiwixServer? {
|
||||
kiwixLibrary = libFactory.createKiwixLibrary()
|
||||
// kiwixLibrary.addBook(selectedBooksPath)
|
||||
for (path in selectedBooksPath) {
|
||||
try {
|
||||
var isBookAdded: Boolean = kiwixLibrary.addBook(path)
|
||||
} catch (e: JNIKiwixException) {
|
||||
Log.v(TAG, "Couldn't add book $path")
|
||||
Log.v(TAG, "Couldn't add book with path:{ $path }")
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "createKiwixServer: Library instance check in JNIKiwixServer: $kiwixLibrary ")
|
||||
return JNIKiwixServer(kiwixLibrary)
|
||||
}
|
||||
}
|
||||
|
@ -71,27 +71,10 @@ public class WebServerHelper {
|
||||
private boolean startAndroidWebServer(ArrayList<String> selectedBooksPath) {
|
||||
if (!isServerStarted) {
|
||||
int DEFAULT_PORT = 8080;
|
||||
//Library kiwixLibrary = kiwixServer.getKiwixLibrary();
|
||||
Log.d(TAG, "startAndroidWebServer: KiwixServer instance check: { " + kiwixServer + " }");
|
||||
//Log.d(TAG,
|
||||
// "startAndroidWebServer: library instance check in WSH: { " + kiwixLibrary + " }");
|
||||
ServerUtils.port = DEFAULT_PORT;
|
||||
//for (String path : selectedBooksPath) {
|
||||
// try {
|
||||
// boolean isBookAdded = kiwixLibrary.addBook(path);
|
||||
// Log.d(TAG, "startAndroidWebServer: LibName102: { "
|
||||
// + kiwixLibrary
|
||||
// + " }");
|
||||
// Log.v(TAG, "isBookAdded: " + isBookAdded + path);
|
||||
// } catch (JNIKiwixException e) {
|
||||
// Log.v(TAG, "Couldn't add book " + path);
|
||||
// }
|
||||
//}
|
||||
server = kiwixServer.createKiwixServer(selectedBooksPath);
|
||||
//server = kiwixServer.createKiwixServer();
|
||||
server.setPort(ServerUtils.port);
|
||||
updateServerState(server.start());
|
||||
Log.d(TAG, "startAndroidWebServer: checking server instance:{ " + server + " }");
|
||||
Log.d(TAG, "Server status" + isServerStarted);
|
||||
}
|
||||
return isServerStarted;
|
||||
|
@ -139,7 +139,6 @@ class ZimHostFragment : BaseFragment(), ZimHostCallbacks, ZimHostContract.View {
|
||||
|
||||
startServerButton.setOnClickListener {
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P || checkCoarseLocationAccessPermission()) {
|
||||
// bindService()
|
||||
startStopServer()
|
||||
}
|
||||
}
|
||||
@ -212,7 +211,6 @@ class ZimHostFragment : BaseFragment(), ZimHostCallbacks, ZimHostContract.View {
|
||||
}
|
||||
|
||||
private fun stopServer() {
|
||||
// unbindService()
|
||||
requireActivity().startService(createHotspotIntent(ACTION_STOP_SERVER))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user