summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-08-31 15:19:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-31 15:19:43 +0000
commit2d6ceda21a0fe46025f1294a040265b243487245 (patch)
treeeff6f47f7b6b171a6bbeccdc52e945bd8e312b14 /src
parentc23d020a471ef4aa6c705c429fcdafee8cb212d6 (diff)
parentddd966e7f6b947e345163c442f4c2f9c3d146024 (diff)
downloadandroid_packages_services_Telecomm-2d6ceda21a0fe46025f1294a040265b243487245.tar.gz
android_packages_services_Telecomm-2d6ceda21a0fe46025f1294a040265b243487245.tar.bz2
android_packages_services_Telecomm-2d6ceda21a0fe46025f1294a040265b243487245.zip
Merge "Properly route rejection reply when capability is set." into cw-e-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/server/telecom/Call.java2
-rw-r--r--src/com/android/server/telecom/ConnectionServiceWrapper.java10
-rw-r--r--src/com/android/server/telecom/InCallController.java6
-rw-r--r--src/com/android/server/telecom/RespondViaSmsManager.java5
4 files changed, 17 insertions, 6 deletions
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 91f7c4fe..f18ff476 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -1091,7 +1091,7 @@ public class Call implements CreateConnectionResponse {
// Ensure video state history tracks video state at time of rejection.
mVideoStateHistory |= mVideoState;
- mConnectionService.reject(this);
+ mConnectionService.reject(this, rejectWithMessage, textMessage);
Log.event(this, Log.Events.REQUEST_REJECT);
}
}
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
index d5ab5cff..b80134e9 100644
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -774,12 +774,18 @@ final class ConnectionServiceWrapper extends ServiceBinder {
}
/** @see IConnectionService#reject(String) */
- void reject(Call call) {
+ void reject(Call call, boolean rejectWithMessage, String message) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("reject")) {
try {
logOutgoing("reject %s", callId);
- mServiceInterface.reject(callId);
+
+ if (rejectWithMessage && call.can(
+ android.telecom.Call.Details.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) {
+ mServiceInterface.rejectWithMessage(callId, message);
+ } else {
+ mServiceInterface.reject(callId);
+ }
} catch (RemoteException e) {
}
}
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 8a8e4f4b..9562ea75 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -32,7 +32,6 @@ import android.os.Looper;
import android.os.RemoteException;
import android.os.Trace;
import android.os.UserHandle;
-import android.telecom.AudioState;
import android.telecom.CallAudioState;
import android.telecom.Connection;
import android.telecom.DefaultDialerManager;
@@ -770,7 +769,10 @@ public final class InCallController extends CallsManagerListenerBase {
android.telecom.Call.Details.CAPABILITY_CAN_UPGRADE_TO_VIDEO,
Connection.CAPABILITY_CAN_PAUSE_VIDEO,
- android.telecom.Call.Details.CAPABILITY_CAN_PAUSE_VIDEO
+ android.telecom.Call.Details.CAPABILITY_CAN_PAUSE_VIDEO,
+
+ Connection.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION,
+ android.telecom.Call.Details.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION
};
private static int convertConnectionToCallCapabilities(int connectionCapabilities) {
diff --git a/src/com/android/server/telecom/RespondViaSmsManager.java b/src/com/android/server/telecom/RespondViaSmsManager.java
index e5a20426..ab410f1b 100644
--- a/src/com/android/server/telecom/RespondViaSmsManager.java
+++ b/src/com/android/server/telecom/RespondViaSmsManager.java
@@ -126,7 +126,10 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {
@Override
public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
- if (rejectWithMessage && call.getHandle() != null) {
+ if (rejectWithMessage
+ && call.getHandle() != null
+ && !call.can(
+ android.telecom.Call.Details.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) {
int subId = mCallsManager.getPhoneAccountRegistrar().getSubscriptionIdForPhoneAccount(
call.getTargetPhoneAccount());
rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(),