mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-28 18:41:43 +01:00
creating a build meta abstraction for allowing testing classes with build version checks
This commit is contained in:
parent
ea7df9b673
commit
797e0ee706
@ -33,6 +33,7 @@ import im.vector.app.config.analyticsConfig
|
||||
import im.vector.app.core.dispatchers.CoroutineDispatchers
|
||||
import im.vector.app.core.error.DefaultErrorFormatter
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.resources.BuildMeta
|
||||
import im.vector.app.core.time.Clock
|
||||
import im.vector.app.core.time.DefaultClock
|
||||
import im.vector.app.features.analytics.AnalyticsConfig
|
||||
@ -185,4 +186,9 @@ object VectorStaticModule {
|
||||
fun providesAnalyticsConfig(): AnalyticsConfig {
|
||||
return analyticsConfig
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun providesBuildMeta() = BuildMeta()
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2022 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package im.vector.app.core.resources
|
||||
|
||||
import android.os.Build
|
||||
|
||||
data class BuildMeta(
|
||||
val sdkInt: Int = Build.VERSION.SDK_INT
|
||||
)
|
22
vector/src/test/java/im/vector/app/test/fixtures/BuildMetaFixture.kt
vendored
Normal file
22
vector/src/test/java/im/vector/app/test/fixtures/BuildMetaFixture.kt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2022 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package im.vector.app.test.fixtures
|
||||
|
||||
import android.os.Build
|
||||
import im.vector.app.core.resources.BuildMeta
|
||||
|
||||
fun aBuildMeta() = BuildMeta(Build.VERSION_CODES.O)
|
Loading…
Reference in New Issue
Block a user