diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java index 431f9f0edd60f8fcc37418b94fdf7cda3df57d47..eff92f282d1dd586878858d1269f236e06ce2a2e 100644 --- a/src/main/java/eu/siacs/conversations/entities/Contact.java +++ b/src/main/java/eu/siacs/conversations/entities/Contact.java @@ -662,7 +662,11 @@ public class Contact implements ListItem, Blockable { // Unregister any associated PSTN gateway integration public void unregisterAsPhoneAccount(Context ctx) { if (Build.VERSION.SDK_INT < 23) return; - if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) return; + if (Build.VERSION.SDK_INT >= 33) { + if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELECOM)) return; + } else { + if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) return; + } TelecomManager telecomManager = ctx.getSystemService(TelecomManager.class); telecomManager.unregisterPhoneAccount(phoneAccountHandle());