Merge "IMS: Add support in frameworks for call deflection feature" am: ba0f9d2973 am: f39bef4801

am: ac48eed9c0

Change-Id: I4695aca7d886f37341672ea5815770e3ccdf7a51
This commit is contained in:
Pooja Jain
2018-02-08 02:15:56 +00:00
committed by android-build-merger
13 changed files with 138 additions and 2 deletions

View File

@@ -124,6 +124,7 @@ public abstract class ConnectionService extends Service {
private static final String SESSION_ABORT = "CS.ab";
private static final String SESSION_ANSWER = "CS.an";
private static final String SESSION_ANSWER_VIDEO = "CS.anV";
private static final String SESSION_DEFLECT = "CS.def";
private static final String SESSION_REJECT = "CS.r";
private static final String SESSION_REJECT_MESSAGE = "CS.rWM";
private static final String SESSION_SILENCE = "CS.s";
@@ -181,6 +182,7 @@ public abstract class ConnectionService extends Service {
private static final int MSG_CONNECTION_SERVICE_FOCUS_GAINED = 31;
private static final int MSG_HANDOVER_FAILED = 32;
private static final int MSG_HANDOVER_COMPLETE = 33;
private static final int MSG_DEFLECT = 34;
private static Connection sNullConnection;
@@ -352,6 +354,20 @@ public abstract class ConnectionService extends Service {
}
}
@Override
public void deflect(String callId, Uri address, Session.Info sessionInfo) {
Log.startSession(sessionInfo, SESSION_DEFLECT);
try {
SomeArgs args = SomeArgs.obtain();
args.arg1 = callId;
args.arg2 = address;
args.arg3 = Log.createSubsession();
mHandler.obtainMessage(MSG_DEFLECT, args).sendToTarget();
} finally {
Log.endSession();
}
}
@Override
public void reject(String callId, Session.Info sessionInfo) {
Log.startSession(sessionInfo, SESSION_REJECT);
@@ -847,6 +863,17 @@ public abstract class ConnectionService extends Service {
}
break;
}
case MSG_DEFLECT: {
SomeArgs args = (SomeArgs) msg.obj;
Log.continueSession((Session) args.arg3, SESSION_HANDLER + SESSION_DEFLECT);
try {
deflect((String) args.arg1, (Uri) args.arg2);
} finally {
args.recycle();
Log.endSession();
}
break;
}
case MSG_REJECT: {
SomeArgs args = (SomeArgs) msg.obj;
Log.continueSession((Session) args.arg2, SESSION_HANDLER + SESSION_REJECT);
@@ -1605,6 +1632,11 @@ public abstract class ConnectionService extends Service {
findConnectionForAction(callId, "answer").onAnswer();
}
private void deflect(String callId, Uri address) {
Log.d(this, "deflect %s", callId);
findConnectionForAction(callId, "deflect").onDeflect(address);
}
private void reject(String callId) {
Log.d(this, "reject %s", callId);
findConnectionForAction(callId, "reject").onReject();