Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up dokka to generate SDK documentation and cleanup the API #5744

Merged
merged 81 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4d49cca
Configure Dokka plugin to generate Kdoc
bmarty Apr 8, 2022
dc092f8
Add missing `internal` keyword.
bmarty Apr 11, 2022
83570dc
Move TextContent class to `api` package
bmarty Apr 12, 2022
b4dbb38
Internal + add some doc
bmarty Apr 12, 2022
73d22d0
Move SpacePeekResult to api package, and cleanup
bmarty Apr 8, 2022
7711eb5
Move `SignInvitationResult` and `RoomAliasDescription` to api package
bmarty Apr 8, 2022
567f298
Remove unused code.
bmarty Apr 12, 2022
24d044b
Move `DeviceTrustLevel`, `DeviceTrustResult` and `UserTrustResult` to…
bmarty Apr 11, 2022
1684ba1
Move `ElementToDecrypt` to api package
bmarty Apr 8, 2022
3895ac8
Move `SyncService` to api package
bmarty Apr 11, 2022
a3575fb
Move `PrivateKeysInfo` to api package
bmarty Apr 11, 2022
03dba3b
Move `SavedKeyBackupKeyInfo` to api package
bmarty Apr 11, 2022
0cb7703
Move content data class to api package
bmarty Apr 11, 2022
ccce552
Move `md5()` extension to api package
bmarty Apr 11, 2022
627a129
Move `awaitCallback()` extension to api package
bmarty Apr 11, 2022
d4ff273
Move `TermsResponse` to api package
bmarty Apr 11, 2022
c9bbf6c
Move `RecoveryKey` functions to api package
bmarty Apr 11, 2022
f4fba2d
Check usage of `import org.matrix.android.sdk.internal` app side
bmarty Apr 11, 2022
0720196
Move `CryptoDeviceInfo` to api package
bmarty Apr 11, 2022
b1f4aa9
Move `Fingerprint` to api package
bmarty Apr 11, 2022
d8eac14
`MoshiProvider` is now internal. Create MatrixJsonParser to expose it…
bmarty Apr 11, 2022
1bc6bec
Move `Base64` facility to api package
bmarty Apr 12, 2022
4b74010
Move `ImportRoomKeysResult` to api package
bmarty Apr 11, 2022
229547f
Move `KeysVersionResult` to api package
bmarty Apr 11, 2022
36fd570
Move `KeysBackupVersionTrust` to api package
bmarty Apr 11, 2022
97c1929
Move `KeysBackupLastVersionResult` to api package
bmarty Apr 11, 2022
e6fc723
Move `KeysVersion` to api package
bmarty Apr 11, 2022
7644bd4
Move `IncomingRequestCancellation` to api package
bmarty Apr 11, 2022
e9161dd
Move `IncomingSecretShareRequest` to api package
bmarty Apr 11, 2022
af2825e
Move `DeviceInfo` to api package
bmarty Apr 11, 2022
e6bc630
Move `MegolmBackupCreationInfo` to api package
bmarty Apr 11, 2022
4799326
Move `IncomingRoomKeyRequest` to api package
bmarty Apr 11, 2022
897c711
Move `OutgoingRoomKeyRequest` to api package
bmarty Apr 11, 2022
a054080
Move `OlmDecryptionResult` to api package
bmarty Apr 11, 2022
ed8097e
Create Settings module to add interface for LightweightSettingsStorage
bmarty Apr 12, 2022
c519674
Move `DevicesListResponse` to api package
bmarty Apr 11, 2022
9190b8b
Move `DefaultBaseAuth` to api package
bmarty Apr 11, 2022
47dad42
Move `RoomKeyShareRequest` to api package
bmarty Apr 11, 2022
363524b
Move `ForwardedRoomKeyContent` to api package
bmarty Apr 11, 2022
f8d0a22
Remove `combineLatest` from SDK, and cleanup
bmarty Apr 11, 2022
1402416
Move `MXUsersDevicesMap` to api package
bmarty Apr 11, 2022
3735ac3
Add entry to keyBackupService to expose `deriveKey`, which becomes in…
bmarty Apr 11, 2022
16c8296
`toQrCodeData()` is now internal
bmarty Apr 11, 2022
02cc9d6
Move `InitialSyncStrategy` to api package
bmarty Apr 11, 2022
0f6b47e
Move `NewSessionListener` to api package
bmarty Apr 11, 2022
74e475d
Move `CryptoConstants` to api package
bmarty Apr 11, 2022
1403557
Move `LocalizedFlowDataLoginTerms` to api package
bmarty Apr 11, 2022
814ba43
Move `andThen` extension to app module
bmarty Apr 11, 2022
0107836
Extract `GossipingDefaultContent` to its own file
bmarty Apr 11, 2022
e8bfbdd
Move `GossipingToDeviceObject` to api package
bmarty Apr 11, 2022
e915413
Move `SecretShareRequest` to api package
bmarty Apr 11, 2022
c0aafab
Move to the other package about crypto
bmarty Apr 11, 2022
4e88b7f
Move `CryptoCrossSigningKey` to api package
bmarty Apr 11, 2022
5c6b370
Add `explicit-api` compiler option for hte SDK module. Disabled for now.
bmarty Apr 11, 2022
b5654d5
Move `InteractiveAuthenticationFlow` to api package
bmarty Apr 11, 2022
d4d74d3
Move `ThreePidCredentials` to its own file and make it internal
bmarty Apr 11, 2022
d0a4075
Move `TaggedEventsContent` to api package
bmarty Apr 11, 2022
90e6c07
Split into several files
bmarty Apr 11, 2022
c11194d
Move `GossipingRequestState` and `OutgoingGossipingRequestState` to a…
bmarty Apr 11, 2022
2b7144c
Make it clear in the generated doc that some class must not be used.
bmarty Apr 12, 2022
1123650
Move `MXEventDecryptionResult` to api package
bmarty Apr 12, 2022
a479e18
internal
bmarty Apr 12, 2022
f56ea8b
Move `KeysBackupVersionTrustSignature` to api package
bmarty Apr 12, 2022
851708c
Add some todos
bmarty Apr 12, 2022
cc1fc29
Move `MegolmBackupAuthData` to api package
bmarty Apr 12, 2022
6682170
Move `MXDeviceInfo` to api package
bmarty Apr 12, 2022
d07f269
Move `MXEncryptEventContentResult` to api package
bmarty Apr 12, 2022
7eaef93
`DeviceKeys` is now internal, removing unused code.
bmarty Apr 12, 2022
ed94d3f
Move `EncryptedFileInfo` and `EncryptedFileKey` to api package
bmarty Apr 12, 2022
89f20e1
Move `RoomKeyRequestBody` to api package
bmarty Apr 12, 2022
b6eafbe
Move `SendToDeviceObject` to api package
bmarty Apr 12, 2022
150c643
Move `UnsignedDeviceInfo` to api package
bmarty Apr 12, 2022
7327047
Rename .java to .kt
bmarty Apr 12, 2022
7514edb
Convert RuntimeJsonAdapterFactory to Kotlin
bmarty Apr 12, 2022
4e48c07
Make RuntimeJsonAdapterFactory internal and cleanup
bmarty Apr 12, 2022
23d2a29
Global import optimization
bmarty Apr 12, 2022
bfbcef6
Run ktlintFormat
bmarty Apr 12, 2022
a0eb4c1
Add changelog files
bmarty Apr 12, 2022
38bbbd6
Restore the correct copyright
bmarty Apr 12, 2022
c8aefd5
Update issue hint
bmarty Apr 13, 2022
e30c68f
Remove dokka dependencies classpath for this specific module, it's al…
bmarty Apr 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ buildscript {
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'
classpath "com.likethesalad.android:stem-plugin:2.0.0"
classpath 'org.owasp:dependency-check-gradle:7.0.4.1'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.10"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need this while it is already defined in the matrix-sdk-android/build.gradle. I also tested it and works fine without it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you are right. I will keep this one and remove the line in the matrix sdk build.gradle file, if ever we need to generate documentation for another module (such as matrix-sdk-android-flow for instance)

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/5744.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Setup Dokka to be able to generate documentation of the SDK module. Run `./gradlew matrix-sdk-android:dokkaHtml` to do it.
3 changes: 3 additions & 0 deletions changelog.d/5744.sdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
A lot of classes which were exposed to the clients and were located in the package `org.matrix.android.sdk.internal` have been moved to the package `org.matrix.android.sdk.api`.
All the classes which are in the package `org.matrix.android.sdk.internal` should now be declared `internal`.
Some unused code and classes have been removed.
6 changes: 5 additions & 1 deletion dependencies_groups.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ ext.groups = [
'com.fasterxml',
'com.fasterxml.jackson',
'com.fasterxml.jackson.core',
'com.fasterxml.jackson.dataformat',
'com.fasterxml.jackson.module',
'com.fasterxml.woodstox',
'com.gabrielittner.threetenbp',
'com.getkeepsafe.relinker',
'com.github.bumptech.glide',
Expand Down Expand Up @@ -157,12 +160,14 @@ ext.groups = [
'org.codehaus',
'org.codehaus.groovy',
'org.codehaus.mojo',
'org.codehaus.woodstox',
'org.eclipse.ee4j',
'org.ec4j.core',
'org.glassfish.jaxb',
'org.hamcrest',
'org.jacoco',
'org.jetbrains',
'org.jetbrains.dokka',
'org.jetbrains.intellij.deps',
'org.jetbrains.kotlin',
'org.jetbrains.kotlinx',
Expand Down Expand Up @@ -208,4 +213,3 @@ ext.groups = [
]
]
]

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import kotlinx.coroutines.channels.produce
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.consumeAsFlow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.isActive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
import org.matrix.android.sdk.api.session.crypto.crosssigning.PrivateKeysInfo
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo
import org.matrix.android.sdk.api.session.group.GroupSummaryQueryParams
import org.matrix.android.sdk.api.session.group.model.GroupSummary
import org.matrix.android.sdk.api.session.identity.ThreePid
Expand All @@ -39,9 +42,6 @@ import org.matrix.android.sdk.api.session.user.model.User
import org.matrix.android.sdk.api.session.widgets.model.Widget
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.api.util.toOptional
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceInfo
import org.matrix.android.sdk.internal.crypto.store.PrivateKeysInfo

class FlowSession(private val session: Session) {

Expand Down
5 changes: 5 additions & 0 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'realm-android'
apply plugin: "org.jetbrains.dokka"

buildscript {
repositories {
Expand Down Expand Up @@ -73,6 +74,10 @@ android {

kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += [
// Disabled for now, there are too many errors. Could be handled in another dedicated PR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// '-Xexplicit-api=strict', // or warning
]
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ import org.matrix.android.sdk.api.auth.UIABaseAuth
import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor
import org.matrix.android.sdk.api.auth.UserPasswordAuth
import org.matrix.android.sdk.api.auth.registration.RegistrationFlowResponse
import org.matrix.android.sdk.api.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.api.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupAuthData
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupCreationInfo
import org.matrix.android.sdk.api.session.crypto.verification.IncomingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.OutgoingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationMethod
Expand All @@ -42,10 +46,6 @@ import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
import org.matrix.android.sdk.api.session.room.roomSummaryQueryParams
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupAuthData
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import java.util.UUID
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.matrix.android.sdk.internal.di.MatrixModule
import org.matrix.android.sdk.internal.di.MatrixScope
import org.matrix.android.sdk.internal.di.NetworkModule
import org.matrix.android.sdk.internal.raw.RawModule
import org.matrix.android.sdk.internal.settings.SettingsModule
import org.matrix.android.sdk.internal.util.system.SystemModule

@Component(modules = [
Expand All @@ -34,6 +35,7 @@ import org.matrix.android.sdk.internal.util.system.SystemModule
NetworkModule::class,
AuthModule::class,
RawModule::class,
SettingsModule::class,
SystemModule::class
])
@MatrixScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.matrix.android.sdk.api.session.crypto.attachments.toElementToDecrypt
import org.matrix.android.sdk.api.session.crypto.model.EncryptedFileInfo
import org.matrix.android.sdk.api.session.crypto.model.EncryptedFileKey
import org.matrix.android.sdk.internal.crypto.attachments.MXEncryptedAttachments
import org.matrix.android.sdk.internal.crypto.attachments.toElementToDecrypt
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileInfo
import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileKey
import java.io.ByteArrayOutputStream
import java.io.InputStream

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ import org.junit.runners.MethodSorters
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersion
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersionResult
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupCreationInfo
import org.matrix.android.sdk.api.session.crypto.model.ImportRoomKeysResult
import org.matrix.android.sdk.api.session.crypto.model.OlmDecryptionResult
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.failure.JoinRoomFailure
Expand All @@ -43,12 +49,6 @@ import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.common.TestMatrixCallback
import org.matrix.android.sdk.internal.crypto.algorithms.olm.OlmDecryptionResult
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersion
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersionResult
import org.matrix.android.sdk.internal.crypto.model.ImportRoomKeysResult
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent

@RunWith(JUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent
import org.matrix.android.sdk.api.session.events.model.content.RoomKeyContent
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import org.matrix.android.sdk.internal.crypto.model.event.RoomKeyContent

@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
Expand Down Expand Up @@ -90,7 +90,7 @@ class PreShareKeysTest : InstrumentedTest {
// Just send a real message as test
val sentEvent = testHelper.sendTextMessage(aliceSession.getRoom(e2eRoomID)!!, "Allo", 1).first()

assertEquals("Unexpected megolm session", megolmSessionId, sentEvent.root.content.toModel<EncryptedEventContent>()?.sessionId,)
assertEquals("Unexpected megolm session", megolmSessionId, sentEvent.root.content.toModel<EncryptedEventContent>()?.sessionId)
testHelper.waitWithLatch { latch ->
testHelper.retryPeriodicallyWithLatch(latch) {
bobSession.getRoom(e2eRoomID)?.getTimelineEvent(sentEvent.eventId)?.root?.getClearType() == EventType.MESSAGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.matrix.android.sdk.api.auth.registration.RegistrationFlowResponse
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.timeline.Timeline
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
Expand All @@ -40,7 +41,6 @@ import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.OlmSessionWrapper
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import org.matrix.android.sdk.internal.crypto.store.db.deserializeFromRealm
import org.matrix.android.sdk.internal.crypto.store.db.serializeForRealm
import org.matrix.olm.OlmSession
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.crypto.crosssigning
import org.amshove.kluent.shouldBeNull
import org.amshove.kluent.shouldBeTrue
import org.junit.Test
import org.matrix.android.sdk.api.util.fromBase64

@Suppress("SpellCheckingInspection")
class ExtensionsKtTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ import org.matrix.android.sdk.api.auth.UIABaseAuth
import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor
import org.matrix.android.sdk.api.auth.UserPasswordAuth
import org.matrix.android.sdk.api.auth.registration.RegistrationFlowResponse
import org.matrix.android.sdk.api.session.crypto.crosssigning.isCrossSignedVerified
import org.matrix.android.sdk.api.session.crypto.crosssigning.isVerified
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.api.session.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.MXUsersDevicesMap
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.content.EncryptionEventContent
import org.matrix.android.sdk.api.session.events.model.toContent
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.send.SendState
Expand All @@ -33,8 +35,6 @@ import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.session.room.timeline.TimelineSettings
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.internal.crypto.model.event.EncryptionEventContent
import java.util.concurrent.CountDownLatch

@RunWith(AndroidJUnit4::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor
import org.matrix.android.sdk.api.auth.UserPasswordAuth
import org.matrix.android.sdk.api.auth.registration.RegistrationFlowResponse
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.session.crypto.crosssigning.DeviceTrustLevel
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersion
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupCreationInfo
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.api.session.crypto.model.GossipingRequestState
import org.matrix.android.sdk.api.session.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.api.session.crypto.model.OutgoingGossipingRequestState
import org.matrix.android.sdk.api.session.crypto.verification.IncomingSasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.SasVerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationMethod
import org.matrix.android.sdk.api.session.crypto.verification.VerificationService
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTransaction
import org.matrix.android.sdk.api.session.crypto.verification.VerificationTxState
import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.GossipingRequestState
import org.matrix.android.sdk.internal.crypto.OutgoingGossipingRequestState
import org.matrix.android.sdk.internal.crypto.crosssigning.DeviceTrustLevel
import org.matrix.android.sdk.internal.crypto.keysbackup.model.MegolmBackupCreationInfo
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersion
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume

Expand Down Expand Up @@ -112,7 +112,7 @@ class KeyShareTests : InstrumentedTest {

var outGoingRequestId: String? = null

commonTestHelper.waitWithLatch { latch ->
commonTestHelper.waitWithLatch { latch ->
commonTestHelper.retryPeriodicallyWithLatch(latch) {
aliceSession2.cryptoService().getOutgoingRoomKeyRequests()
.filter { req ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ import org.matrix.android.sdk.api.NoOpMatrixCallback
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent
import org.matrix.android.sdk.api.session.events.model.content.WithHeldCode
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.common.CommonTestHelper
import org.matrix.android.sdk.common.CryptoTestHelper
import org.matrix.android.sdk.common.MockOkHttpInterceptor
import org.matrix.android.sdk.common.SessionTestParams
import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.model.event.EncryptedEventContent
import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode

@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ import org.matrix.android.sdk.internal.crypto.model.OlmInboundGroupSessionWrappe
/**
* Data class to store result of [KeysBackupTestHelper.createKeysBackupScenarioWithPassword]
*/
data class KeysBackupScenarioData(val cryptoTestData: CryptoTestData,
val aliceKeys: List<OlmInboundGroupSessionWrapper2>,
val prepareKeysBackupDataResult: PrepareKeysBackupDataResult,
val aliceSession2: Session) {
internal data class KeysBackupScenarioData(
val cryptoTestData: CryptoTestData,
val aliceKeys: List<OlmInboundGroupSessionWrapper2>,
val prepareKeysBackupDataResult: PrepareKeysBackupDataResult,
val aliceSession2: Session
) {
fun cleanUp(testHelper: CommonTestHelper) {
cryptoTestData.cleanUp(testHelper)
testHelper.signOutAndClose(aliceSession2)
Expand Down
Loading