From 2f159dffb36241233c3dc1ddf0a57a152ccc907d Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 11 Jan 2023 21:33:22 -0500 Subject: [PATCH] Fix for 33 on unregister too --- src/main/java/eu/siacs/conversations/entities/Contact.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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());