remove viber fallback

This commit is contained in:
lucky 2022-02-16 08:38:07 +03:00
parent e8001df6ee
commit f7bed719e3
7 changed files with 10 additions and 16 deletions

View file

@ -10,8 +10,8 @@ android {
applicationId "me.lucky.red"
minSdk 29
targetSdk 32
versionCode 7
versionName "1.0.6"
versionCode 8
versionName "1.0.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View file

@ -11,22 +11,19 @@ import androidx.annotation.RequiresPermission
class CallRedirectionService : CallRedirectionService() {
companion object {
private const val PREFIX = "vnd.android.cursor.item/vnd"
private const val SIGNAL_MIMETYPE = "$PREFIX.org.thoughtcrime.securesms.call"
private const val TELEGRAM_MIMETYPE = "$PREFIX.org.telegram.messenger.android.call"
private const val THREEMA_MIMETYPE = "$PREFIX.ch.threema.app.call"
private const val WHATSAPP_MIMETYPE = "$PREFIX.com.whatsapp.voip.call"
private const val VIBER_MIMETYPE = "$PREFIX.com.viber.voip.call"
private const val PREFIX = "vnd.android.cursor.item"
private const val SIGNAL_MIMETYPE = "$PREFIX/vnd.org.thoughtcrime.securesms.call"
private const val TELEGRAM_MIMETYPE = "$PREFIX/vnd.org.telegram.messenger.android.call"
private const val THREEMA_MIMETYPE = "$PREFIX/vnd.ch.threema.app.call"
private const val WHATSAPP_MIMETYPE = "$PREFIX/vnd.com.whatsapp.voip.call"
private val MIMETYPES = mapOf(
SIGNAL_MIMETYPE to 0,
TELEGRAM_MIMETYPE to 1,
THREEMA_MIMETYPE to 2,
WHATSAPP_MIMETYPE to 48,
VIBER_MIMETYPE to 49,
)
private val FALLBACK_MIMETYPES = arrayOf(
WHATSAPP_MIMETYPE,
VIBER_MIMETYPE,
)
}
@ -76,7 +73,6 @@ class CallRedirectionService : CallRedirectionService() {
TELEGRAM_MIMETYPE -> R.string.destination_telegram
THREEMA_MIMETYPE -> R.string.destination_threema
WHATSAPP_MIMETYPE -> R.string.fallback_destination_whatsapp
VIBER_MIMETYPE -> R.string.fallback_destination_viber
else -> return
})
}

View file

@ -9,7 +9,6 @@
<string name="redirection_delay_description">Задержка до того, как звонок будет перенаправлен.</string>
<string name="popup_position">Позиция всплывающего окна</string>
<string name="fallback">Обратная совместимость</string>
<string name="fallback_description">Перенаправлять в WhatsApp/Viber, если другие недоступны.</string>
<string name="fallback_description">Перенаправлять в WhatsApp, если другие недоступны.</string>
<string name="fallback_destination_whatsapp">WhatsApp</string>
<string name="fallback_destination_viber">Viber</string>
</resources>

View file

@ -9,7 +9,6 @@
<string name="redirection_delay_description">Delay before a call will be redirected.</string>
<string name="popup_position">Popup position</string>
<string name="fallback">Fallback</string>
<string name="fallback_description">Redirect to WhatsApp/Viber if no other available.</string>
<string name="fallback_description">Redirect to WhatsApp if no other available.</string>
<string name="fallback_destination_whatsapp">WhatsApp</string>
<string name="fallback_destination_viber">Viber</string>
</resources>