2014-07-30 10:07:40 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
R* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2014-09-12 22:16:17 -07:00
|
|
|
package android.telecom;
|
2014-07-30 10:07:40 -07:00
|
|
|
|
|
|
|
import android.net.Uri;
|
2015-05-27 17:21:45 -07:00
|
|
|
import android.os.Bundle;
|
2014-07-30 10:07:40 -07:00
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.Message;
|
|
|
|
import android.os.RemoteException;
|
2016-10-28 12:29:55 -07:00
|
|
|
import android.telecom.Logging.Session;
|
2014-07-30 10:07:40 -07:00
|
|
|
|
2014-07-28 18:15:48 -07:00
|
|
|
import com.android.internal.os.SomeArgs;
|
2014-09-12 22:16:17 -07:00
|
|
|
import com.android.internal.telecom.IConnectionServiceAdapter;
|
|
|
|
import com.android.internal.telecom.IVideoProvider;
|
|
|
|
import com.android.internal.telecom.RemoteServiceCallback;
|
2014-07-28 18:15:48 -07:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2014-07-30 10:07:40 -07:00
|
|
|
/**
|
|
|
|
* A component that provides an RPC servant implementation of {@link IConnectionServiceAdapter},
|
|
|
|
* posting incoming messages on the main thread on a client-supplied delegate object.
|
|
|
|
*
|
|
|
|
* TODO: Generate this and similar classes using a compiler starting from AIDL interfaces.
|
|
|
|
*
|
|
|
|
* @hide
|
|
|
|
*/
|
|
|
|
final class ConnectionServiceAdapterServant {
|
2014-08-18 09:23:25 -07:00
|
|
|
private static final int MSG_HANDLE_CREATE_CONNECTION_COMPLETE = 1;
|
|
|
|
private static final int MSG_SET_ACTIVE = 2;
|
|
|
|
private static final int MSG_SET_RINGING = 3;
|
|
|
|
private static final int MSG_SET_DIALING = 4;
|
|
|
|
private static final int MSG_SET_DISCONNECTED = 5;
|
|
|
|
private static final int MSG_SET_ON_HOLD = 6;
|
2014-09-08 15:34:24 -07:00
|
|
|
private static final int MSG_SET_RINGBACK_REQUESTED = 7;
|
2014-11-12 13:41:16 -08:00
|
|
|
private static final int MSG_SET_CONNECTION_CAPABILITIES = 8;
|
2014-08-18 09:23:25 -07:00
|
|
|
private static final int MSG_SET_IS_CONFERENCED = 9;
|
|
|
|
private static final int MSG_ADD_CONFERENCE_CALL = 10;
|
|
|
|
private static final int MSG_REMOVE_CALL = 11;
|
|
|
|
private static final int MSG_ON_POST_DIAL_WAIT = 12;
|
|
|
|
private static final int MSG_QUERY_REMOTE_CALL_SERVICES = 13;
|
|
|
|
private static final int MSG_SET_VIDEO_STATE = 14;
|
|
|
|
private static final int MSG_SET_VIDEO_CALL_PROVIDER = 15;
|
2014-09-08 15:34:24 -07:00
|
|
|
private static final int MSG_SET_IS_VOIP_AUDIO_MODE = 16;
|
2014-08-18 09:23:25 -07:00
|
|
|
private static final int MSG_SET_STATUS_HINTS = 17;
|
2014-09-08 15:34:24 -07:00
|
|
|
private static final int MSG_SET_ADDRESS = 18;
|
2014-08-18 09:23:25 -07:00
|
|
|
private static final int MSG_SET_CALLER_DISPLAY_NAME = 19;
|
2014-09-03 10:07:03 -07:00
|
|
|
private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20;
|
2014-10-30 14:27:48 -07:00
|
|
|
private static final int MSG_ADD_EXISTING_CONNECTION = 21;
|
2014-12-15 16:12:50 -08:00
|
|
|
private static final int MSG_ON_POST_DIAL_CHAR = 22;
|
2015-04-24 15:25:29 -07:00
|
|
|
private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23;
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
private static final int MSG_PUT_EXTRAS = 24;
|
|
|
|
private static final int MSG_REMOVE_EXTRAS = 25;
|
|
|
|
private static final int MSG_ON_CONNECTION_EVENT = 26;
|
2016-03-22 09:02:47 -07:00
|
|
|
private static final int MSG_SET_CONNECTION_PROPERTIES = 27;
|
2016-07-07 22:53:57 -07:00
|
|
|
private static final int MSG_SET_PULLING = 28;
|
2017-01-09 09:43:12 -08:00
|
|
|
private static final int MSG_SET_AUDIO_ROUTE = 29;
|
2017-02-06 10:49:48 -08:00
|
|
|
private static final int MSG_ON_RTT_INITIATION_SUCCESS = 30;
|
|
|
|
private static final int MSG_ON_RTT_INITIATION_FAILURE = 31;
|
|
|
|
private static final int MSG_ON_RTT_REMOTELY_TERMINATED = 32;
|
|
|
|
private static final int MSG_ON_RTT_UPGRADE_REQUEST = 33;
|
2014-07-30 10:07:40 -07:00
|
|
|
|
|
|
|
private final IConnectionServiceAdapter mDelegate;
|
|
|
|
|
|
|
|
private final Handler mHandler = new Handler() {
|
|
|
|
@Override
|
|
|
|
public void handleMessage(Message msg) {
|
|
|
|
try {
|
|
|
|
internalHandleMessage(msg);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Internal method defined to centralize handling of RemoteException
|
|
|
|
private void internalHandleMessage(Message msg) throws RemoteException {
|
|
|
|
switch (msg.what) {
|
2014-08-18 09:23:25 -07:00
|
|
|
case MSG_HANDLE_CREATE_CONNECTION_COMPLETE: {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2014-08-18 09:23:25 -07:00
|
|
|
mDelegate.handleCreateConnectionComplete(
|
2014-08-07 19:46:01 -07:00
|
|
|
(String) args.arg1,
|
|
|
|
(ConnectionRequest) args.arg2,
|
2016-10-28 12:29:55 -07:00
|
|
|
(ParcelableConnection) args.arg3,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MSG_SET_ACTIVE:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setActive((String) msg.obj, null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
|
|
|
case MSG_SET_RINGING:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setRinging((String) msg.obj, null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
|
|
|
case MSG_SET_DIALING:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setDialing((String) msg.obj, null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
2016-07-07 22:53:57 -07:00
|
|
|
case MSG_SET_PULLING:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setPulling((String) msg.obj, null /*Session.Info*/);
|
2016-07-07 22:53:57 -07:00
|
|
|
break;
|
2014-07-30 10:07:40 -07:00
|
|
|
case MSG_SET_DISCONNECTED: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setDisconnected((String) args.arg1, (DisconnectCause) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MSG_SET_ON_HOLD:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setOnHold((String) msg.obj, null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
2014-09-08 15:34:24 -07:00
|
|
|
case MSG_SET_RINGBACK_REQUESTED:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setRingbackRequested((String) msg.obj, msg.arg1 == 1,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
2014-11-12 13:41:16 -08:00
|
|
|
case MSG_SET_CONNECTION_CAPABILITIES:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setConnectionCapabilities((String) msg.obj, msg.arg1,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
2016-03-22 09:02:47 -07:00
|
|
|
case MSG_SET_CONNECTION_PROPERTIES:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setConnectionProperties((String) msg.obj, msg.arg1,
|
|
|
|
null /*Session.Info*/);
|
2016-03-22 09:02:47 -07:00
|
|
|
break;
|
2014-07-30 10:07:40 -07:00
|
|
|
case MSG_SET_IS_CONFERENCED: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setIsConferenced((String) args.arg1, (String) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-08-07 18:35:18 -07:00
|
|
|
case MSG_ADD_CONFERENCE_CALL: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
|
|
|
mDelegate.addConferenceCall(
|
2016-10-28 12:29:55 -07:00
|
|
|
(String) args.arg1, (ParcelableConference) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
2014-08-07 18:35:18 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
2014-08-07 18:35:18 -07:00
|
|
|
}
|
2014-07-30 10:07:40 -07:00
|
|
|
case MSG_REMOVE_CALL:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.removeCall((String) msg.obj,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
|
|
|
case MSG_ON_POST_DIAL_WAIT: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.onPostDialWait((String) args.arg1, (String) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-12-15 16:12:50 -08:00
|
|
|
case MSG_ON_POST_DIAL_CHAR: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.onPostDialChar((String) args.arg1, (char) args.argi1,
|
|
|
|
null /*Session.Info*/);
|
2014-12-15 16:12:50 -08:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-07-30 10:07:40 -07:00
|
|
|
case MSG_QUERY_REMOTE_CALL_SERVICES:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.queryRemoteConnectionServices((RemoteServiceCallback) msg.obj,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
|
|
|
case MSG_SET_VIDEO_STATE:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setVideoState((String) msg.obj, msg.arg1, null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
|
|
|
case MSG_SET_VIDEO_CALL_PROVIDER: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2014-08-07 19:46:01 -07:00
|
|
|
mDelegate.setVideoProvider((String) args.arg1,
|
2016-10-28 12:29:55 -07:00
|
|
|
(IVideoProvider) args.arg2, null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-09-08 15:34:24 -07:00
|
|
|
case MSG_SET_IS_VOIP_AUDIO_MODE:
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setIsVoipAudioMode((String) msg.obj, msg.arg1 == 1,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
break;
|
|
|
|
case MSG_SET_STATUS_HINTS: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setStatusHints((String) args.arg1, (StatusHints) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-09-08 15:34:24 -07:00
|
|
|
case MSG_SET_ADDRESS: {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setAddress((String) args.arg1, (Uri) args.arg2, args.argi1,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MSG_SET_CALLER_DISPLAY_NAME: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
|
|
|
mDelegate.setCallerDisplayName(
|
2016-10-28 12:29:55 -07:00
|
|
|
(String) args.arg1, (String) args.arg2, args.argi1,
|
|
|
|
null /*Session.Info*/);
|
2014-07-30 10:07:40 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-07-28 18:15:48 -07:00
|
|
|
case MSG_SET_CONFERENCEABLE_CONNECTIONS: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setConferenceableConnections((String) args.arg1,
|
|
|
|
(List<String>) args.arg2, null /*Session.Info*/);
|
2014-07-28 18:15:48 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-10-30 14:27:48 -07:00
|
|
|
case MSG_ADD_EXISTING_CONNECTION: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.addExistingConnection((String) args.arg1,
|
|
|
|
(ParcelableConnection) args.arg2, null /*Session.Info*/);
|
2014-10-30 14:27:48 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2015-04-24 15:25:29 -07:00
|
|
|
case MSG_SET_CONFERENCE_MERGE_FAILED: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.setConferenceMergeFailed((String) args.arg1,
|
|
|
|
null /*Session.Info*/);
|
2015-04-24 15:25:29 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
case MSG_PUT_EXTRAS: {
|
2015-05-27 17:21:45 -07:00
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.putExtras((String) args.arg1, (Bundle) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MSG_REMOVE_EXTRAS: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-10-28 12:29:55 -07:00
|
|
|
mDelegate.removeExtras((String) args.arg1, (List<String>) args.arg2,
|
|
|
|
null /*Session.Info*/);
|
2015-05-27 17:21:45 -07:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
2016-02-24 13:17:21 -08:00
|
|
|
break;
|
2015-05-27 17:21:45 -07:00
|
|
|
}
|
2016-02-16 14:36:20 -08:00
|
|
|
case MSG_ON_CONNECTION_EVENT: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
2016-03-14 15:18:07 -07:00
|
|
|
mDelegate.onConnectionEvent((String) args.arg1, (String) args.arg2,
|
2016-10-28 12:29:55 -07:00
|
|
|
(Bundle) args.arg3, null /*Session.Info*/);
|
2016-02-16 14:36:20 -08:00
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
2016-02-24 13:17:21 -08:00
|
|
|
break;
|
2016-02-16 14:36:20 -08:00
|
|
|
}
|
2017-01-09 09:43:12 -08:00
|
|
|
case MSG_SET_AUDIO_ROUTE: {
|
|
|
|
SomeArgs args = (SomeArgs) msg.obj;
|
|
|
|
try {
|
|
|
|
mDelegate.setAudioRoute((String) args.arg1, args.argi1,
|
|
|
|
(Session.Info) args.arg2);
|
|
|
|
} finally {
|
|
|
|
args.recycle();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2017-02-06 10:49:48 -08:00
|
|
|
case MSG_ON_RTT_INITIATION_SUCCESS:
|
|
|
|
mDelegate.onRttInitiationSuccess((String) msg.obj, null /*Session.Info*/);
|
|
|
|
break;
|
|
|
|
case MSG_ON_RTT_INITIATION_FAILURE:
|
|
|
|
mDelegate.onRttInitiationFailure((String) msg.obj, msg.arg1,
|
|
|
|
null /*Session.Info*/);
|
|
|
|
break;
|
|
|
|
case MSG_ON_RTT_REMOTELY_TERMINATED:
|
|
|
|
mDelegate.onRttSessionRemotelyTerminated((String) msg.obj,
|
|
|
|
null /*Session.Info*/);
|
|
|
|
break;
|
|
|
|
case MSG_ON_RTT_UPGRADE_REQUEST:
|
|
|
|
mDelegate.onRemoteRttRequest((String) msg.obj, null /*Session.Info*/);
|
|
|
|
break;
|
2014-07-30 10:07:40 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
private final IConnectionServiceAdapter mStub = new IConnectionServiceAdapter.Stub() {
|
|
|
|
@Override
|
2014-08-18 09:23:25 -07:00
|
|
|
public void handleCreateConnectionComplete(
|
2014-08-07 19:46:01 -07:00
|
|
|
String id,
|
|
|
|
ConnectionRequest request,
|
2016-10-28 12:29:55 -07:00
|
|
|
ParcelableConnection connection,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
2014-08-07 19:46:01 -07:00
|
|
|
args.arg1 = id;
|
|
|
|
args.arg2 = request;
|
|
|
|
args.arg3 = connection;
|
2014-08-18 09:23:25 -07:00
|
|
|
mHandler.obtainMessage(MSG_HANDLE_CREATE_CONNECTION_COMPLETE, args).sendToTarget();
|
2014-07-30 10:07:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setActive(String connectionId, Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_ACTIVE, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setRinging(String connectionId, Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_RINGING, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setDialing(String connectionId, Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_DIALING, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2016-07-07 22:53:57 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setPulling(String connectionId, Session.Info sessionInfo) {
|
2016-07-07 22:53:57 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_PULLING, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2014-07-30 10:07:40 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setDisconnected(String connectionId, DisconnectCause disconnectCause,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
2014-09-11 17:33:16 -07:00
|
|
|
args.arg2 = disconnectCause;
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_DISCONNECTED, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setOnHold(String connectionId, Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_ON_HOLD, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setRingbackRequested(String connectionId, boolean ringback,
|
|
|
|
Session.Info sessionInfo) {
|
2014-09-08 15:34:24 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_RINGBACK_REQUESTED, ringback ? 1 : 0, 0, connectionId)
|
2014-07-30 10:07:40 -07:00
|
|
|
.sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setConnectionCapabilities(String connectionId, int connectionCapabilities,
|
|
|
|
Session.Info sessionInfo) {
|
2014-11-12 13:41:16 -08:00
|
|
|
mHandler.obtainMessage(
|
|
|
|
MSG_SET_CONNECTION_CAPABILITIES, connectionCapabilities, 0, connectionId)
|
2014-07-30 10:07:40 -07:00
|
|
|
.sendToTarget();
|
|
|
|
}
|
|
|
|
|
2016-03-22 09:02:47 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setConnectionProperties(String connectionId, int connectionProperties,
|
|
|
|
Session.Info sessionInfo) {
|
2016-03-22 09:02:47 -07:00
|
|
|
mHandler.obtainMessage(
|
|
|
|
MSG_SET_CONNECTION_PROPERTIES, connectionProperties, 0, connectionId)
|
|
|
|
.sendToTarget();
|
|
|
|
}
|
|
|
|
|
2015-04-24 15:25:29 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setConferenceMergeFailed(String callId, Session.Info sessionInfo) {
|
2015-04-24 15:25:29 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = callId;
|
|
|
|
mHandler.obtainMessage(MSG_SET_CONFERENCE_MERGE_FAILED, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2014-07-30 10:07:40 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setIsConferenced(String callId, String conferenceCallId,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = callId;
|
|
|
|
args.arg2 = conferenceCallId;
|
|
|
|
mHandler.obtainMessage(MSG_SET_IS_CONFERENCED, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void addConferenceCall(String callId, ParcelableConference parcelableConference,
|
|
|
|
Session.Info sessionInfo) {
|
2014-08-07 18:35:18 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = callId;
|
|
|
|
args.arg2 = parcelableConference;
|
|
|
|
mHandler.obtainMessage(MSG_ADD_CONFERENCE_CALL, args).sendToTarget();
|
2014-07-30 10:07:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void removeCall(String connectionId,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_REMOVE_CALL, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void onPostDialWait(String connectionId, String remainingDigits,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = remainingDigits;
|
|
|
|
mHandler.obtainMessage(MSG_ON_POST_DIAL_WAIT, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2014-12-15 16:12:50 -08:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void onPostDialChar(String connectionId, char nextChar,
|
|
|
|
Session.Info sessionInfo) {
|
2014-12-15 16:12:50 -08:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.argi1 = nextChar;
|
|
|
|
mHandler.obtainMessage(MSG_ON_POST_DIAL_CHAR, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2014-07-30 10:07:40 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void queryRemoteConnectionServices(RemoteServiceCallback callback,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, callback).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setVideoState(String connectionId, int videoState,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_VIDEO_STATE, videoState, 0, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public void setVideoProvider(String connectionId, IVideoProvider videoProvider,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
2014-08-07 19:46:01 -07:00
|
|
|
args.arg2 = videoProvider;
|
2014-07-30 10:07:40 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_VIDEO_CALL_PROVIDER, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void setIsVoipAudioMode(String connectionId, boolean isVoip,
|
|
|
|
Session.Info sessionInfo) {
|
2014-09-08 15:34:24 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_IS_VOIP_AUDIO_MODE, isVoip ? 1 : 0, 0,
|
2014-07-30 10:07:40 -07:00
|
|
|
connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void setStatusHints(String connectionId, StatusHints statusHints,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = statusHints;
|
|
|
|
mHandler.obtainMessage(MSG_SET_STATUS_HINTS, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void setAddress(String connectionId, Uri address, int presentation,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
2014-09-08 15:34:24 -07:00
|
|
|
args.arg2 = address;
|
2014-07-30 10:07:40 -07:00
|
|
|
args.argi1 = presentation;
|
2014-09-08 15:34:24 -07:00
|
|
|
mHandler.obtainMessage(MSG_SET_ADDRESS, args).sendToTarget();
|
2014-07-30 10:07:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public final void setCallerDisplayName(
|
2016-10-28 12:29:55 -07:00
|
|
|
String connectionId, String callerDisplayName, int presentation,
|
|
|
|
Session.Info sessionInfo) {
|
2014-07-30 10:07:40 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = callerDisplayName;
|
|
|
|
args.argi1 = presentation;
|
|
|
|
mHandler.obtainMessage(MSG_SET_CALLER_DISPLAY_NAME, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2014-07-28 18:15:48 -07:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void setConferenceableConnections(String connectionId,
|
|
|
|
List<String> conferenceableConnectionIds, Session.Info sessionInfo) {
|
2014-07-28 18:15:48 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = conferenceableConnectionIds;
|
|
|
|
mHandler.obtainMessage(MSG_SET_CONFERENCEABLE_CONNECTIONS, args).sendToTarget();
|
|
|
|
}
|
2014-10-30 14:27:48 -07:00
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void addExistingConnection(String connectionId,
|
|
|
|
ParcelableConnection connection, Session.Info sessionInfo) {
|
2014-10-30 14:27:48 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = connection;
|
|
|
|
mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget();
|
|
|
|
}
|
2015-05-27 17:21:45 -07:00
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void putExtras(String connectionId, Bundle extras, Session.Info sessionInfo) {
|
2015-05-27 17:21:45 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = extras;
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
mHandler.obtainMessage(MSG_PUT_EXTRAS, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void removeExtras(String connectionId, List<String> keys,
|
|
|
|
Session.Info sessionInfo) {
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = keys;
|
|
|
|
mHandler.obtainMessage(MSG_REMOVE_EXTRAS, args).sendToTarget();
|
2015-05-27 17:21:45 -07:00
|
|
|
}
|
2016-02-16 14:36:20 -08:00
|
|
|
|
2017-01-09 09:43:12 -08:00
|
|
|
@Override
|
|
|
|
public final void setAudioRoute(String connectionId, int audioRoute,
|
|
|
|
Session.Info sessionInfo) {
|
|
|
|
|
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.argi1 = audioRoute;
|
|
|
|
args.arg2 = sessionInfo;
|
|
|
|
mHandler.obtainMessage(MSG_SET_AUDIO_ROUTE, args).sendToTarget();
|
|
|
|
}
|
|
|
|
|
2016-02-16 14:36:20 -08:00
|
|
|
@Override
|
2016-10-28 12:29:55 -07:00
|
|
|
public final void onConnectionEvent(String connectionId, String event, Bundle extras,
|
|
|
|
Session.Info sessionInfo) {
|
2016-02-16 14:36:20 -08:00
|
|
|
SomeArgs args = SomeArgs.obtain();
|
|
|
|
args.arg1 = connectionId;
|
|
|
|
args.arg2 = event;
|
2016-03-14 15:18:07 -07:00
|
|
|
args.arg3 = extras;
|
2016-02-16 14:36:20 -08:00
|
|
|
mHandler.obtainMessage(MSG_ON_CONNECTION_EVENT, args).sendToTarget();
|
|
|
|
}
|
2017-02-06 10:49:48 -08:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onRttInitiationSuccess(String connectionId, Session.Info sessionInfo)
|
|
|
|
throws RemoteException {
|
|
|
|
mHandler.obtainMessage(MSG_ON_RTT_INITIATION_SUCCESS, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onRttInitiationFailure(String connectionId, int reason,
|
|
|
|
Session.Info sessionInfo)
|
|
|
|
throws RemoteException {
|
|
|
|
mHandler.obtainMessage(MSG_ON_RTT_INITIATION_FAILURE, reason, 0, connectionId)
|
|
|
|
.sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onRttSessionRemotelyTerminated(String connectionId, Session.Info sessionInfo)
|
|
|
|
throws RemoteException {
|
|
|
|
mHandler.obtainMessage(MSG_ON_RTT_REMOTELY_TERMINATED, connectionId).sendToTarget();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onRemoteRttRequest(String connectionId, Session.Info sessionInfo)
|
|
|
|
throws RemoteException {
|
|
|
|
mHandler.obtainMessage(MSG_ON_RTT_UPGRADE_REQUEST, connectionId).sendToTarget();
|
|
|
|
}
|
2014-07-30 10:07:40 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
|
|
|
|
mDelegate = delegate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IConnectionServiceAdapter getStub() {
|
|
|
|
return mStub;
|
|
|
|
}
|
|
|
|
}
|