aboutsummaryrefslogtreecommitdiff
path: root/androidApp
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-25 22:49:10 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-25 22:49:10 -0600
commitb4785c42aa026a561674257955a7c59b8c964e6f (patch)
tree1c4e3e9f74e92a222e9f0cffae0457befe39741e /androidApp
parent4a85207614840d340167000e4d66649fdd462901 (diff)
downloadetbsa-trackermap-mobile-b4785c42aa026a561674257955a7c59b8c964e6f.tar.gz
etbsa-trackermap-mobile-b4785c42aa026a561674257955a7c59b8c964e6f.tar.bz2
etbsa-trackermap-mobile-b4785c42aa026a561674257955a7c59b8c964e6f.zip
Refactored session handling into a shared SessionManager to prevent mutability and get it run in Native (untested!)
Diffstat (limited to 'androidApp')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
index 1d181dd..cdeb85b 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
@@ -26,6 +26,7 @@ import mx.trackermap.TrackerMap.android.session.LoginViewModel
import mx.trackermap.TrackerMap.android.session.UserInformationViewModel
import mx.trackermap.TrackerMap.android.units.UnitsViewModel
import mx.trackermap.TrackerMap.client.apis.*
+import mx.trackermap.TrackerMap.client.infrastructure.SessionManager
import mx.trackermap.TrackerMap.controllers.GeofencesController
import mx.trackermap.TrackerMap.controllers.ReportController
import mx.trackermap.TrackerMap.controllers.SessionController
@@ -47,6 +48,9 @@ open class TrackerApp : Application() {
val appModule = module {
single { getString(R.string.default_server_url) }
+
+ factory { SessionManager(get()) }
+
factory { SessionApi(get()) }
factory { UsersApi(get()) }
factory { DevicesApi(get()) }