mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Add documentation to the class Matrix
This commit is contained in:
parent
15366f8d2a
commit
7040369529
1 changed files with 28 additions and 0 deletions
|
@ -73,24 +73,52 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
|
||||||
ProcessLifecycleOwner.get().lifecycle.addObserver(backgroundDetectionObserver)
|
ProcessLifecycleOwner.get().lifecycle.addObserver(backgroundDetectionObserver)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the User Agent used for any request that the SDK is making to the homeserver.
|
||||||
|
* There is no way to change the user agent at the moment
|
||||||
|
*/
|
||||||
fun getUserAgent() = userAgentHolder.userAgent
|
fun getUserAgent() = userAgentHolder.userAgent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the AuthenticationService
|
||||||
|
*/
|
||||||
fun authenticationService() = authenticationService
|
fun authenticationService() = authenticationService
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the RawService
|
||||||
|
*/
|
||||||
fun rawService() = rawService
|
fun rawService() = rawService
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the LightweightSettingsStorage
|
||||||
|
*/
|
||||||
fun lightweightSettingsStorage() = lightweightSettingsStorage
|
fun lightweightSettingsStorage() = lightweightSettingsStorage
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the HomeServerHistoryService
|
||||||
|
*/
|
||||||
fun homeServerHistoryService() = homeServerHistoryService
|
fun homeServerHistoryService() = homeServerHistoryService
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the legacy session importer, useful if you want to migrate an app, which was using the legacy Matrix Android Sdk
|
||||||
|
*/
|
||||||
fun legacySessionImporter() = legacySessionImporter
|
fun legacySessionImporter() = legacySessionImporter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the worker factory. The returned value has to be provided to `WorkConfiguration.Builder()`
|
||||||
|
*/
|
||||||
fun workerFactory(): WorkerFactory = matrixWorkerFactory
|
fun workerFactory(): WorkerFactory = matrixWorkerFactory
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register an API interceptor, to be able to be notified when the specified API got a response
|
||||||
|
*/
|
||||||
fun registerApiInterceptorListener(path: ApiPath, listener: ApiInterceptorListener) {
|
fun registerApiInterceptorListener(path: ApiPath, listener: ApiInterceptorListener) {
|
||||||
apiInterceptor.addListener(path, listener)
|
apiInterceptor.addListener(path, listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Un-register an API interceptor
|
||||||
|
*/
|
||||||
fun unregisterApiInterceptorListener(path: ApiPath, listener: ApiInterceptorListener) {
|
fun unregisterApiInterceptorListener(path: ApiPath, listener: ApiInterceptorListener) {
|
||||||
apiInterceptor.removeListener(path, listener)
|
apiInterceptor.removeListener(path, listener)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue