Fix CTS tests for devices without telephony feature

Create connection request during some CTS Telecom call
related test cases get stuck due to no sim connection
services available. This happens when the device doesn't
support telephony feature. To fix this bail early when
there are no sim connection services available.

Bug: 317153251
Test: CtsTelecomTestCases on devices without telephony
Change-Id: Iaf0951e66e88563f8490c140750b6ea5253c91e1
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
index 728e121..a9f7c82 100644
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -2549,9 +2549,11 @@
             }
         }
 
-        // Bail early if the caller isn't the sim connection mgr.
-        if (!isCallerConnectionManager) {
-            Log.d(this, "queryRemoteConnectionServices: none; not sim call mgr.");
+        Log.i(this, "queryRemoteConnectionServices, simServices = %s", simServices);
+        // Bail early if the caller isn't the sim connection mgr or no sim connection service
+        // other than caller available.
+        if (!isCallerConnectionManager || simServices.isEmpty()) {
+            Log.d(this, "queryRemoteConnectionServices: not sim call mgr or no simservices.");
             noRemoteServices(callback);
             return;
         }
@@ -2559,8 +2561,6 @@
         final List<ComponentName> simServiceComponentNames = new ArrayList<>();
         final List<IBinder> simServiceBinders = new ArrayList<>();
 
-        Log.i(this, "queryRemoteConnectionServices, simServices = %s", simServices);
-
         for (ConnectionServiceWrapper simService : simServices) {
             final ConnectionServiceWrapper currentSimService = simService;