Fix build -.-

This commit is contained in:
Julian Raufelder 2022-01-24 17:09:46 +01:00
parent 7704ab5b87
commit 2613ba5eae
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -6,9 +6,16 @@ import android.content.Intent.ACTION_OPEN_DOCUMENT_TREE
import android.provider.DocumentsContract import android.provider.DocumentsContract
import android.widget.Toast import android.widget.Toast
import com.dropbox.core.android.Auth import com.dropbox.core.android.Auth
import org.cryptomator.data.cloud.onedrive.OnedriveClientFactory import com.microsoft.identity.client.AuthenticationCallback
import org.cryptomator.data.cloud.onedrive.graph.ClientException import com.microsoft.identity.client.IAccount
import org.cryptomator.data.cloud.onedrive.graph.ICallback import com.microsoft.identity.client.IAuthenticationResult
import com.microsoft.identity.client.IMultipleAccountPublicClientApplication
import com.microsoft.identity.client.IPublicClientApplication
import com.microsoft.identity.client.PublicClientApplication
import com.microsoft.identity.client.exception.MsalClientException
import com.microsoft.identity.client.exception.MsalException
import com.microsoft.identity.client.exception.MsalServiceException
import com.microsoft.identity.client.exception.MsalUiRequiredException
import org.cryptomator.data.util.X509CertificateHelper import org.cryptomator.data.util.X509CertificateHelper
import org.cryptomator.domain.Cloud import org.cryptomator.domain.Cloud
import org.cryptomator.domain.CloudType import org.cryptomator.domain.CloudType
@ -210,6 +217,19 @@ class AuthenticateCloudPresenter @Inject constructor( //
} }
} }
private inner class OnedriveAuthStrategy : AuthStrategy {
private var authenticationStarted = false
override fun supports(cloud: CloudModel): Boolean {
return cloud.cloudType() == CloudTypeModel.ONEDRIVE
}
override fun resumed(intent: AuthenticateCloudIntent) {
if (!authenticationStarted) {
startAuthentication(intent.cloud())
}
}
private fun startAuthentication(cloud: CloudModel) { private fun startAuthentication(cloud: CloudModel) {
authenticationStarted = true authenticationStarted = true
@ -315,7 +335,7 @@ class AuthenticateCloudPresenter @Inject constructor( //
.build() .build()
) )
} }
} }
private inner class PCloudAuthStrategy : AuthStrategy { private inner class PCloudAuthStrategy : AuthStrategy {