feat: route provider sessions to ABSDK and simulation
This commit is contained in:
@@ -45,6 +45,15 @@ android {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
excludes += "/META-INF/DEPENDENCIES"
|
||||
excludes += "/META-INF/LICENSE*"
|
||||
excludes += "/META-INF/NOTICE*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
@@ -55,6 +64,8 @@ dependencies {
|
||||
implementation(project(":domain"))
|
||||
implementation(project(":android:core:designsystem"))
|
||||
implementation(project(":android:core:session"))
|
||||
implementation(project(":absdk-bridge"))
|
||||
implementation(project(":runtime:simulation"))
|
||||
debugImplementation(project(":testing:fakes"))
|
||||
|
||||
implementation(platform(libs.compose.bom))
|
||||
@@ -73,6 +84,7 @@ dependencies {
|
||||
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.kotlinx.coroutines.test)
|
||||
testImplementation(project(":testing:fakes"))
|
||||
androidTestImplementation(platform(libs.compose.bom))
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.test.runner)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.flagship.abox.manager.di
|
||||
|
||||
import com.flagship.abox.manager.domain.SessionGateway
|
||||
import com.flagship.abox.manager.testing.fakes.FakeSessionGateway
|
||||
import com.flagship.abox.manager.ui.provider.Availability
|
||||
import com.flagship.abox.manager.ui.provider.ProviderAvailability
|
||||
import com.flagship.abox.manager.ui.provider.UnavailableReason
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
object DebugSessionModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideRemoteSessionGateway(fake: FakeSessionGateway): SessionGateway = fake
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideProviderAvailability(): ProviderAvailability = ProviderAvailability(
|
||||
abox = Availability.Simulation,
|
||||
compatible = Availability.Disabled(UnavailableReason.PROTOCOL_PENDING),
|
||||
)
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.flagship.abox.manager.di
|
||||
import android.content.Context
|
||||
import androidx.datastore.core.DataStore
|
||||
import androidx.datastore.preferences.core.Preferences
|
||||
import com.flagship.abox.manager.absdk.bridge.AbsdkBridge
|
||||
import com.flagship.abox.manager.absdk.bridge.CleartextAbsdkTransport
|
||||
import com.flagship.abox.manager.domain.CredentialStore
|
||||
import com.flagship.abox.manager.domain.LocalSessionGateway
|
||||
import com.flagship.abox.manager.domain.ProviderProfileStore
|
||||
@@ -11,9 +13,12 @@ import com.flagship.abox.manager.domain.SessionGateway
|
||||
import com.flagship.abox.manager.session.credential.AndroidKeystoreCredentialCipher
|
||||
import com.flagship.abox.manager.session.credential.CredentialCipher
|
||||
import com.flagship.abox.manager.session.credential.KeystoreCredentialStore
|
||||
import com.flagship.abox.manager.session.gateway.LocalSessionGatewayImpl
|
||||
import com.flagship.abox.manager.session.profile.ProviderProfileStoreImpl
|
||||
import com.flagship.abox.manager.session.profile.sessionDataStore
|
||||
import com.flagship.abox.manager.simulation.SimulationSessionGateway
|
||||
import com.flagship.abox.manager.ui.provider.Availability
|
||||
import com.flagship.abox.manager.ui.provider.ProviderAvailability
|
||||
import com.flagship.abox.manager.ui.provider.UnavailableReason
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
@@ -49,7 +54,25 @@ object SessionModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideLocalSessionGateway(): LocalSessionGateway = LocalSessionGatewayImpl()
|
||||
@OptIn(CleartextAbsdkTransport::class)
|
||||
fun provideAbsdkBridge(): AbsdkBridge = AbsdkBridge.create()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideRemoteSessionGateway(
|
||||
bridge: AbsdkBridge,
|
||||
): SessionGateway = bridge
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideLocalSessionGateway(): LocalSessionGateway = SimulationSessionGateway()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideProviderAvailability(): ProviderAvailability = ProviderAvailability(
|
||||
abox = Availability.Enabled,
|
||||
compatible = Availability.Disabled(UnavailableReason.PROTOCOL_PENDING),
|
||||
)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.flagship.abox.manager.di
|
||||
|
||||
import com.flagship.abox.manager.domain.SessionGateway
|
||||
import com.flagship.abox.manager.session.gateway.UnavailableRemoteSessionGateway
|
||||
import com.flagship.abox.manager.ui.provider.Availability
|
||||
import com.flagship.abox.manager.ui.provider.ProviderAvailability
|
||||
import com.flagship.abox.manager.ui.provider.UnavailableReason
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
object ReleaseSessionModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideRemoteSessionGateway(): SessionGateway = UnavailableRemoteSessionGateway()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideProviderAvailability(): ProviderAvailability = ProviderAvailability(
|
||||
abox = Availability.Disabled(UnavailableReason.TRANSPORT_SECURITY_PENDING),
|
||||
compatible = Availability.Disabled(UnavailableReason.PROTOCOL_PENDING),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user