Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19eb4584 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Handle MicroG login mode separately from Google

parent 2aa7090f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -129,7 +129,8 @@ fun serializeAuthSessionForInstallAppLib(session: AuthSession): String {
        AuthSession.Unauthenticated -> GPlayAccountTypes.NOT_CONFIGURED
        is AuthSession.PlayStoreSession -> when (session.loginMode) {
            PlayStoreLoginMode.ANONYMOUS -> GPlayAccountTypes.ANONYMOUS
            PlayStoreLoginMode.GOOGLE, PlayStoreLoginMode.MICROG -> GPlayAccountTypes.GOOGLE
            PlayStoreLoginMode.GOOGLE -> GPlayAccountTypes.GOOGLE
            PlayStoreLoginMode.MICROG -> GPlayAccountTypes.MICROG
        }
    }.name
}
+5 −2
Original line number Diff line number Diff line
@@ -48,17 +48,20 @@ class InstallAppServiceTest {
    }

    @Test
    fun `serializeAuthSessionForInstallAppLib maps google and microg sessions to google`() {
    fun `serializeAuthSessionForInstallAppLib maps google session to google`() {
        assertThat(
            serializeAuthSessionForInstallAppLib(
                AuthSession.PlayStoreSession(PlayStoreLoginMode.GOOGLE)
            )
        ).isEqualTo(GPlayAccountTypes.GOOGLE.name)
    }

    @Test
    fun `serializeAuthSessionForInstallAppLib maps microg session to microg`() {
        assertThat(
            serializeAuthSessionForInstallAppLib(
                AuthSession.PlayStoreSession(PlayStoreLoginMode.MICROG)
            )
        ).isEqualTo(GPlayAccountTypes.GOOGLE.name)
        ).isEqualTo(GPlayAccountTypes.MICROG.name)
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ android {
                create<MavenPublication>("aar") {
                    groupId = "foundation.e.apps"
                    artifactId = "install-app-lib"
                    version = "1.0.0"
                    version = "1.0.1"

                    artifact(layout.buildDirectory.file("outputs/aar/${project.name}-release.aar").get().asFile)

+1 −0
Original line number Diff line number Diff line
@@ -4,5 +4,6 @@ enum class GPlayAccountTypes {
    NO_GOOGLE,
    ANONYMOUS,
    GOOGLE,
    MICROG,
    NOT_CONFIGURED;
}