1
0
mirror of https://github.com/vector-im/riotX-android synced 2025-10-06 00:02:48 +02:00

lifting the release build type to the application module

This commit is contained in:
Adam Brown
2022-08-09 14:42:16 +01:00
parent b72a174edf
commit a947a53e14
4 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
/*
* 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.di
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import im.vector.app.core.debug.DebugNavigator
import im.vector.app.core.debug.DebugReceiver
import im.vector.app.core.debug.FlipperProxy
import im.vector.app.core.debug.LeakDetector
import okhttp3.Interceptor
import org.matrix.android.sdk.api.Matrix
@InstallIn(SingletonComponent::class)
@Module
object DebugModule {
@Provides
fun providesDebugNavigator() = object : DebugNavigator {
override fun openDebugMenu(context: Context) {
// no op
}
}
@Provides
fun providesDebugReceiver() = object : DebugReceiver {
override fun register(context: Context) {
// no op
}
override fun unregister(context: Context) {
// no op
}
}
@Provides
fun providesFlipperProxy() = object : FlipperProxy {
override fun init(matrix: Matrix) {
// no op
}
override fun networkInterceptor(): Interceptor? = null
}
@Provides
fun providesLeakDetector() = object : LeakDetector {
override fun enable(enable: Boolean) {
// no op
}
}
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright (c) 2021 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.di
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.DefaultVectorOverrides
import im.vector.app.features.VectorFeatures
import im.vector.app.features.VectorOverrides
@InstallIn(SingletonComponent::class)
@Module
object FeaturesModule {
@Provides
fun providesFeatures(): VectorFeatures {
return DefaultVectorFeatures()
}
@Provides
fun providesOverrides(): VectorOverrides {
return DefaultVectorOverrides()
}
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright 2019 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.
*/
@file:Suppress("UNUSED_PARAMETER")
package im.vector.app.receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
/**
* No Op version
*/
class DebugReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
// No op
}
companion object {
fun getIntentFilter(context: Context) = IntentFilter()
}
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<share-target android:targetClass="im.vector.app.features.share.IncomingShareActivity">
<data android:mimeType="*/*" />
<category android:name="im.vector.app.SHORTCUT_SHARE" />
</share-target>
</shortcuts>