Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07b3c9da authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Fix queryRemoteConnectionServices for call provider + manager

When a PhoneAccount is registered as both call provider and
connection manager (shouldn't normally be the case), we were
not calling back into the ConnectionService for
queryRemoteConnectionService onResult callback.

Test: atest TelecomUnitTests; atest CtsTelecomTestCases
Change-Id: Idc21e567d07263714b101bf3720c118a08758361
parent 55d9ab47
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1743,8 +1743,12 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
            }
            ConnectionServiceWrapper service = mConnectionServiceRepository.getService(
                    handle.getComponentName(), handle.getUserHandle());
            if (service != null) {
            if (service != null && service != this) {
                simServices.add(service);
            } else {
                // This is unexpected, normally PhoneAccounts with CAPABILITY_CALL_PROVIDER are not
                // also CAPABILITY_CONNECTION_MANAGER
                Log.w(this, "call provider also detected as SIM call manager: " + service);
            }
        }

@@ -1761,11 +1765,6 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        Log.i(this, "queryRemoteConnectionServices, simServices = %s", simServices);

        for (ConnectionServiceWrapper simService : simServices) {
            if (simService == this) {
                // Only happens in the unlikely case that a SIM service is also a SIM call manager
                continue;
            }

            final ConnectionServiceWrapper currentSimService = simService;

            currentSimService.mBinder.bind(new BindCallback() {