show a prompt with redirection if a phone call cannot be made

This commit is contained in:
tibbi
2021-07-25 18:13:05 +02:00
parent 79b3ad0721
commit fe1958001a
22 changed files with 31 additions and 0 deletions

View File

@ -4,8 +4,10 @@ import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.provider.Settings
import android.telecom.TelecomManager import android.telecom.TelecomManager
import android.view.Menu import android.view.Menu
import android.widget.Toast
import com.simplemobiletools.commons.extensions.isDefaultDialer import com.simplemobiletools.commons.extensions.isDefaultDialer
import com.simplemobiletools.commons.extensions.showErrorToast import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.extensions.telecomManager import com.simplemobiletools.commons.extensions.telecomManager
@ -64,6 +66,14 @@ class DialerActivity : SimpleActivity() {
super.onActivityResult(requestCode, resultCode, resultData) super.onActivityResult(requestCode, resultCode, resultData)
if (requestCode == REQUEST_CODE_SET_DEFAULT_DIALER) { if (requestCode == REQUEST_CODE_SET_DEFAULT_DIALER) {
if (!isDefaultDialer()) { if (!isDefaultDialer()) {
try {
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = Uri.parse("package:$packageName")
startActivity(this)
}
toast(R.string.default_phone_app_prompt, Toast.LENGTH_LONG)
} catch (ignored: Exception) {
}
finish() finish()
} else { } else {
initOutgoingCall() initOutgoingCall()

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Dialer</string> <string name="app_launcher_name">Dialer</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Nejde získat přístup k vašim kontaktům</string> <string name="could_not_access_contacts">Nejde získat přístup k vašim kontaktům</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Schlichtes Telefon</string> <string name="app_name">Schlichtes Telefon</string>
<string name="app_launcher_name">Telefon</string> <string name="app_launcher_name">Telefon</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">kein Zugriff auf Kontakte</string> <string name="could_not_access_contacts">kein Zugriff auf Kontakte</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Απλή Κλήση</string> <string name="app_name">Απλή Κλήση</string>
<string name="app_launcher_name">Κλήση</string> <string name="app_launcher_name">Κλήση</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Αδυναμία πρόσβασης στις επαφές σας</string> <string name="could_not_access_contacts">Αδυναμία πρόσβασης στις επαφές σας</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Marcador Simple</string> <string name="app_name">Marcador Simple</string>
<string name="app_launcher_name">Marcador</string> <string name="app_launcher_name">Marcador</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">No se pudo acceder a tus contactos</string> <string name="could_not_access_contacts">No se pudo acceder a tus contactos</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Puhelin</string> <string name="app_launcher_name">Puhelin</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Ei käyttöoikeutta yhteystietoihin</string> <string name="could_not_access_contacts">Ei käyttöoikeutta yhteystietoihin</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Téléphone</string> <string name="app_launcher_name">Téléphone</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Impossible d\'accéder à vos contacts</string> <string name="could_not_access_contacts">Impossible d\'accéder à vos contacts</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Marcador</string> <string name="app_launcher_name">Marcador</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Non foi posible acceder aos contactos</string> <string name="could_not_access_contacts">Non foi posible acceder aos contactos</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Dialer</string> <string name="app_launcher_name">Dialer</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Tidak dapat mengakses kontak anda</string> <string name="could_not_access_contacts">Tidak dapat mengakses kontak anda</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Telefono</string> <string name="app_launcher_name">Telefono</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Impossibile accedere ai contatti</string> <string name="could_not_access_contacts">Impossibile accedere ai contatti</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simpleダイヤラー</string> <string name="app_name">Simpleダイヤラー</string>
<string name="app_launcher_name">ダイヤラー</string> <string name="app_launcher_name">ダイヤラー</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">コンタクトにアクセスできませんでした</string> <string name="could_not_access_contacts">コンタクトにアクセスできませんでした</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">ഡയലർ</string> <string name="app_launcher_name">ഡയലർ</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">നിങ്ങളുടെ കോൺ‌ടാക്റ്റുകൾ‌ ആക്‌സസ് ചെയ്യാൻ‌ കഴിഞ്ഞില്ല</string> <string name="could_not_access_contacts">നിങ്ങളുടെ കോൺ‌ടാക്റ്റുകൾ‌ ആക്‌സസ് ചെയ്യാൻ‌ കഴിഞ്ഞില്ല</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Eenvoudige Telefoon</string> <string name="app_name">Eenvoudige Telefoon</string>
<string name="app_launcher_name">Telefoon</string> <string name="app_launcher_name">Telefoon</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Kon geen toegang krijgen tot de contacten</string> <string name="could_not_access_contacts">Kon geen toegang krijgen tot de contacten</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Prosty telefon</string> <string name="app_name">Prosty telefon</string>
<string name="app_launcher_name">Telefon</string> <string name="app_launcher_name">Telefon</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Nie można uzyskać dostępu do Twoich kontaktów</string> <string name="could_not_access_contacts">Nie można uzyskać dostępu do Twoich kontaktów</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Marcador</string> <string name="app_launcher_name">Marcador</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Não foi possível aceder aos contactos</string> <string name="could_not_access_contacts">Não foi possível aceder aos contactos</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Телефон</string> <string name="app_launcher_name">Телефон</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Невозможно получить доступ к контактам</string> <string name="could_not_access_contacts">Невозможно получить доступ к контактам</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Jednoduchý telefón</string> <string name="app_name">Jednoduchý telefón</string>
<string name="app_launcher_name">Telefón</string> <string name="app_launcher_name">Telefón</string>
<string name="default_phone_app_prompt">Prosím nastavte apku ako predvolenú na správu hovorov</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Nepodarilo sa dostať ku kontaktom</string> <string name="could_not_access_contacts">Nepodarilo sa dostať ku kontaktom</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Telefon</string> <string name="app_launcher_name">Telefon</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Det gick inte att komma åt dina kontakter</string> <string name="could_not_access_contacts">Det gick inte att komma åt dina kontakter</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Basit Çevirici</string> <string name="app_name">Basit Çevirici</string>
<string name="app_launcher_name">Çevirici</string> <string name="app_launcher_name">Çevirici</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Kişilerinize erişilemedi</string> <string name="could_not_access_contacts">Kişilerinize erişilemedi</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Dialer</string> <string name="app_launcher_name">Dialer</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Could not access your contacts</string> <string name="could_not_access_contacts">Could not access your contacts</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">简易拨号器</string> <string name="app_name">简易拨号器</string>
<string name="app_launcher_name">拨号器</string> <string name="app_launcher_name">拨号器</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">无法访问您的通讯录</string> <string name="could_not_access_contacts">无法访问您的通讯录</string>

View File

@ -1,6 +1,7 @@
<resources> <resources>
<string name="app_name">Simple Dialer</string> <string name="app_name">Simple Dialer</string>
<string name="app_launcher_name">Dialer</string> <string name="app_launcher_name">Dialer</string>
<string name="default_phone_app_prompt">Please make this app the default Phone app</string>
<!-- Contacts --> <!-- Contacts -->
<string name="could_not_access_contacts">Could not access your contacts</string> <string name="could_not_access_contacts">Could not access your contacts</string>