Make queryRemoteConnectionServices DSDS aware.
The method queryRemoteConnectionServices had the issue that it assumes
there is a single connection manager for the device. This assumption does
not work on a multisim device. Since the ConnectionManager is associated
with a particular carrier, this means that the connection mgr for one
carrier could try to impact calls destined for another carrier.
This change ensures that the calling package is passed into Telecom so
that we can determine which RemoteConnectionServices which are available to
the calling connection manager.
Test: Manual test on DSDS with a connection mgr carrier and another carrier.
Bug: 131856987
Change-Id: I46d80dc68adaab7fd4374f023d7ba4242804c253
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index f99b218..b281589 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -186,8 +186,13 @@
break;
}
case MSG_QUERY_REMOTE_CALL_SERVICES:
- mDelegate.queryRemoteConnectionServices((RemoteServiceCallback) msg.obj,
- null /*Session.Info*/);
+ SomeArgs args2 = (SomeArgs) msg.obj;
+ try {
+ mDelegate.queryRemoteConnectionServices((RemoteServiceCallback) args2.arg1,
+ (String) args2.arg2, null /*Session.Info*/);
+ } finally {
+ args2.recycle();
+ }
break;
case MSG_SET_VIDEO_STATE:
mDelegate.setVideoState((String) msg.obj, msg.arg1, null /*Session.Info*/);
@@ -468,7 +473,10 @@
@Override
public void queryRemoteConnectionServices(RemoteServiceCallback callback,
- Session.Info sessionInfo) {
+ String callingPackage, Session.Info sessionInfo) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = callback;
+ args.arg2 = callingPackage;
mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, callback).sendToTarget();
}