Remove Google integration
This commit is contained in:
@@ -39,7 +39,6 @@ dependencies {
|
||||
|
||||
implementation(libs.koin.android)
|
||||
|
||||
implementation(project(":libs:g-services"))
|
||||
implementation(project(":libs:owncloud"))
|
||||
implementation(project(":libs:nextcloud"))
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package de.mm20.launcher2.accounts
|
||||
|
||||
enum class AccountType {
|
||||
Google,
|
||||
Nextcloud,
|
||||
Owncloud,
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package de.mm20.launcher2.accounts
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import de.mm20.launcher2.gservices.GoogleApiHelper
|
||||
import de.mm20.launcher2.nextcloud.NextcloudApiHelper
|
||||
import de.mm20.launcher2.owncloud.OwncloudClient
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@@ -27,17 +26,11 @@ internal class AccountsRepositoryImpl(
|
||||
) : AccountsRepository {
|
||||
private val scope = CoroutineScope(Job() + Dispatchers.Default)
|
||||
|
||||
private val googleApiHelper = GoogleApiHelper.getInstance(context)
|
||||
private val nextcloudApiHelper = NextcloudApiHelper(context)
|
||||
private val owncloudApiHelper = OwncloudClient(context)
|
||||
|
||||
override fun signin(context: Activity, accountType: AccountType) {
|
||||
when (accountType) {
|
||||
AccountType.Google -> {
|
||||
scope.launch {
|
||||
googleApiHelper.login(context)
|
||||
}
|
||||
}
|
||||
AccountType.Nextcloud ->
|
||||
scope.launch {
|
||||
nextcloudApiHelper.login(context)
|
||||
@@ -51,9 +44,6 @@ internal class AccountsRepositoryImpl(
|
||||
|
||||
override fun signout(accountType: AccountType) {
|
||||
when (accountType) {
|
||||
AccountType.Google -> {
|
||||
googleApiHelper.logout()
|
||||
}
|
||||
AccountType.Nextcloud -> {
|
||||
scope.launch {
|
||||
nextcloudApiHelper.logout()
|
||||
@@ -67,7 +57,6 @@ internal class AccountsRepositoryImpl(
|
||||
|
||||
override fun isSupported(accountType: AccountType): Boolean {
|
||||
return when (accountType) {
|
||||
AccountType.Google -> googleApiHelper.isAvailable()
|
||||
AccountType.Nextcloud -> true
|
||||
AccountType.Owncloud -> true
|
||||
}
|
||||
@@ -75,9 +64,6 @@ internal class AccountsRepositoryImpl(
|
||||
|
||||
override suspend fun getCurrentlySignedInAccount(accountType: AccountType): Account? {
|
||||
return when (accountType) {
|
||||
AccountType.Google -> {
|
||||
getGoogleAccount()
|
||||
}
|
||||
AccountType.Nextcloud -> {
|
||||
getNextcloudAccount()
|
||||
}
|
||||
@@ -87,12 +73,6 @@ internal class AccountsRepositoryImpl(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getGoogleAccount(): Account? {
|
||||
return googleApiHelper.getAccount()?.let {
|
||||
Account(it.name, AccountType.Google)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getNextcloudAccount(): Account? {
|
||||
return nextcloudApiHelper.getLoggedInUser()?.let {
|
||||
Account(it.displayName, AccountType.Nextcloud)
|
||||
|
||||
Reference in New Issue
Block a user