Always try dialler integration if enabled

Whereas call integration (true self managed) sometimes is blacklisted.

(cherry picked from commit cd0262f178ea098e842ff9f155b56afd6bfc41bd)
This commit is contained in:
Stephen Paul Weber 2024-11-02 21:11:43 -05:00 committed by Arne
parent 781251f550
commit dd24f6c7f7
2 changed files with 6 additions and 8 deletions

View file

@ -394,7 +394,7 @@ public class CallIntegrationConnectionService extends ConnectionService {
private static ArrayList<PhoneAccountHandle> findPhoneAccount(final Context context, final AbstractJingleConnection.Id id) { private static ArrayList<PhoneAccountHandle> findPhoneAccount(final Context context, final AbstractJingleConnection.Id id) {
final var def = CallIntegrationConnectionService.getHandle(context, id.account); final var def = CallIntegrationConnectionService.getHandle(context, id.account);
final var lst = new ArrayList<PhoneAccountHandle>(); final var lst = new ArrayList<PhoneAccountHandle>();
lst.add(def); if (CallIntegration.selfManaged(context)) lst.add(def);
if (Build.VERSION.SDK_INT < 23) return lst; if (Build.VERSION.SDK_INT < 23) return lst;
final var prefs = PreferenceManager.getDefaultSharedPreferences(context); final var prefs = PreferenceManager.getDefaultSharedPreferences(context);
@ -433,7 +433,8 @@ public class CallIntegrationConnectionService extends ConnectionService {
public static boolean addNewIncomingCall( public static boolean addNewIncomingCall(
final Context context, final AbstractJingleConnection.Id id) { final Context context, final AbstractJingleConnection.Id id) {
if (NotificationService.isQuietHours(context, id.getContact().getAccount())) return true; if (NotificationService.isQuietHours(context, id.getContact().getAccount())) return true;
if (CallIntegration.notSelfManaged(context)) { final var phoneAccountHandles = findPhoneAccount(context, id);
if (phoneAccountHandles.isEmpty()) {
Log.d( Log.d(
Config.LOGTAG, Config.LOGTAG,
"not adding incoming call to TelecomManager on Android " "not adding incoming call to TelecomManager on Android "
@ -441,9 +442,8 @@ public class CallIntegrationConnectionService extends ConnectionService {
+ " (" + " ("
+ Build.DEVICE + Build.DEVICE
+ ")"); + ")");
return true; return false;
} }
final var phoneAccountHandles = findPhoneAccount(context, id);
final var bundle = new Bundle(); final var bundle = new Bundle();
bundle.putString( bundle.putString(
TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, TelecomManager.EXTRA_INCOMING_CALL_ADDRESS,

View file

@ -1702,10 +1702,8 @@ public class JingleRtpConnection extends AbstractJingleConnection
ringingTimeoutFuture = ringingTimeoutFuture =
jingleConnectionManager.schedule( jingleConnectionManager.schedule(
this::ringingTimeout, BUSY_TIME_OUT, TimeUnit.SECONDS); this::ringingTimeout, BUSY_TIME_OUT, TimeUnit.SECONDS);
if (CallIntegration.selfManaged(xmppConnectionService)) { if (CallIntegrationConnectionService.addNewIncomingCall(xmppConnectionService, getId())) {
if (CallIntegrationConnectionService.addNewIncomingCall(xmppConnectionService, getId())) { return;
return;
}
} }
xmppConnectionService.getNotificationService().startRinging(id, getMedia()); xmppConnectionService.getNotificationService().startRinging(id, getMedia());
} }