Merge "Make queryRemoteConnectionServices DSDS aware." into qt-dev
This commit is contained in:
@@ -1937,6 +1937,8 @@ public abstract class ConnectionService extends Service {
|
||||
return;
|
||||
}
|
||||
|
||||
String callingPackage = getOpPackageName();
|
||||
|
||||
mAdapter.queryRemoteConnectionServices(new RemoteServiceCallback.Stub() {
|
||||
@Override
|
||||
public void onResult(
|
||||
@@ -1965,7 +1967,7 @@ public abstract class ConnectionService extends Service {
|
||||
}
|
||||
}.prepare());
|
||||
}
|
||||
});
|
||||
}, callingPackage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -316,11 +316,11 @@ final class ConnectionServiceAdapter implements DeathRecipient {
|
||||
/**
|
||||
* Retrieves a list of remote connection services usable to place calls.
|
||||
*/
|
||||
void queryRemoteConnectionServices(RemoteServiceCallback callback) {
|
||||
void queryRemoteConnectionServices(RemoteServiceCallback callback, String callingPackage) {
|
||||
// Only supported when there is only one adapter.
|
||||
if (mAdapters.size() == 1) {
|
||||
try {
|
||||
mAdapters.iterator().next().queryRemoteConnectionServices(callback,
|
||||
mAdapters.iterator().next().queryRemoteConnectionServices(callback, callingPackage,
|
||||
Log.getExternalSession());
|
||||
} catch (RemoteException e) {
|
||||
Log.e(this, e, "Exception trying to query for remote CSs");
|
||||
|
||||
@@ -186,8 +186,13 @@ final class ConnectionServiceAdapterServant {
|
||||
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 @@ final class ConnectionServiceAdapterServant {
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ final class RemoteConnectionService {
|
||||
|
||||
@Override
|
||||
public void queryRemoteConnectionServices(RemoteServiceCallback callback,
|
||||
Session.Info sessionInfo) {
|
||||
String callingPackage, Session.Info sessionInfo) {
|
||||
// Not supported from remote connection service.
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,8 @@ oneway interface IConnectionServiceAdapter {
|
||||
|
||||
void onPostDialChar(String callId, char nextChar, in Session.Info sessionInfo);
|
||||
|
||||
void queryRemoteConnectionServices(RemoteServiceCallback callback, in Session.Info sessionInfo);
|
||||
void queryRemoteConnectionServices(RemoteServiceCallback callback, String callingPackage,
|
||||
in Session.Info sessionInfo);
|
||||
|
||||
void setVideoProvider(String callId, IVideoProvider videoProvider, in Session.Info sessionInfo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user