From 156a33b9a8d34ffdafa00a1915114fc1365772f8 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Thu, 30 May 2019 16:52:28 -0700 Subject: [PATCH] Fix bugs with Remote Connection Services. 1. A previous change was made in ConnectionServiceAdapterServant to add another parameter, requiring the user of SomeArgs. I think this fix is pretty self-explanatory. (facepalm) 2. queryRemoteConnectionServices in ConnectionServiceAdapter had an issue where the callback would not get called if there was more than one IConnectionServiceAdapter instances. This isn't an error condition, but a condition where we don't query telecom for the list of valid remote connection services. We ensure a callback with an empty list is made (this is similar to what Telecom already does). This seems to be an issue inherent with DSDS because there can be multiple SIM ConnectionServices where before there was only one. Test: Run CTS tests. Bug: 133639062 Change-Id: I1c508e97d1f0ea1bc72ad7ebd026c1ad66a52de3 --- .../java/android/telecom/ConnectionServiceAdapter.java | 9 +++++++++ .../android/telecom/ConnectionServiceAdapterServant.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index 3acd83a41396d..04e930ccd9549 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -325,6 +325,15 @@ final class ConnectionServiceAdapter implements DeathRecipient { } catch (RemoteException e) { Log.e(this, e, "Exception trying to query for remote CSs"); } + } else { + try { + // This is not an error condition, so just pass back an empty list. + // This happens when querying from a remote connection service, not the connection + // manager itself. + callback.onResult(Collections.EMPTY_LIST, Collections.EMPTY_LIST); + } catch (RemoteException e) { + Log.e(this, e, "Exception trying to query for remote CSs"); + } } } diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java index b28158913dc41..60b2172fdeca3 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java @@ -477,7 +477,7 @@ final class ConnectionServiceAdapterServant { SomeArgs args = SomeArgs.obtain(); args.arg1 = callback; args.arg2 = callingPackage; - mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, callback).sendToTarget(); + mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, args).sendToTarget(); } @Override