Merge "API changes in GatewayInfo, Response, and PropertyPresentation (4/4)" into lmp-dev
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index c1331cd..9476fb9 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -24,16 +24,16 @@
import android.os.Bundle;
import android.os.Handler;
import android.provider.ContactsContract.Contacts;
-import android.telecomm.Connection;
-import android.telecomm.PhoneCapabilities;
-import android.telecomm.PropertyPresentation;
import android.telecomm.CallState;
+import android.telecomm.Connection;
import android.telecomm.GatewayInfo;
import android.telecomm.ParcelableConnection;
import android.telecomm.PhoneAccount;
import android.telecomm.PhoneAccountHandle;
+import android.telecomm.PhoneCapabilities;
import android.telecomm.Response;
import android.telecomm.StatusHints;
+import android.telecomm.TelecommManager;
import android.telecomm.VideoProfile;
import android.telephony.DisconnectCause;
import android.telephony.PhoneNumberUtils;
@@ -198,13 +198,17 @@
/** The handle with which to establish this call. */
private Uri mHandle;
- /** The {@link PropertyPresentation} that controls how the handle is shown. */
+ /**
+ * The presentation requirements for the handle. See {@link TelecommManager} for valid values.
+ */
private int mHandlePresentation;
/** The caller display name (CNAP) set by the connection service. */
private String mCallerDisplayName;
- /** The {@link PropertyPresentation} that controls how the caller display name is shown. */
+ /**
+ * The presentation requirements for the handle. See {@link TelecommManager} for valid values.
+ */
private int mCallerDisplayNamePresentation;
/**
@@ -304,7 +308,7 @@
mState = isConference ? CallState.ACTIVE : CallState.NEW;
mRepository = repository;
setHandle(handle);
- setHandle(handle, PropertyPresentation.ALLOWED);
+ setHandle(handle, TelecommManager.PRESENTATION_ALLOWED);
mGatewayInfo = gatewayInfo;
mConnectionManagerPhoneAccountHandle = connectionManagerPhoneAccountHandle;
mTargetPhoneAccountHandle = targetPhoneAccountHandle;
@@ -382,7 +386,7 @@
void setHandle(Uri handle) {
- setHandle(handle, PropertyPresentation.ALLOWED);
+ setHandle(handle, TelecommManager.PRESENTATION_ALLOWED);
}
void setHandle(Uri handle, int presentation) {
@@ -459,7 +463,7 @@
*/
public Uri getOriginalHandle() {
if (mGatewayInfo != null && !mGatewayInfo.isEmpty()) {
- return mGatewayInfo.getOriginalHandle();
+ return mGatewayInfo.getOriginalAddress();
}
return getHandle();
}
diff --git a/src/com/android/telecomm/CallsManager.java b/src/com/android/telecomm/CallsManager.java
index 116cf95..2b562e3 100644
--- a/src/com/android/telecomm/CallsManager.java
+++ b/src/com/android/telecomm/CallsManager.java
@@ -361,7 +361,7 @@
return;
}
- final Uri uriHandle = (gatewayInfo == null) ? handle : gatewayInfo.getGatewayHandle();
+ final Uri uriHandle = (gatewayInfo == null) ? handle : gatewayInfo.getGatewayAddress();
if (gatewayInfo == null) {
Log.i(this, "Creating a new outgoing call with handle: %s", Log.piiHandle(uriHandle));
diff --git a/src/com/android/telecomm/ConnectionServiceWrapper.java b/src/com/android/telecomm/ConnectionServiceWrapper.java
index b37f185..8f7df33 100644
--- a/src/com/android/telecomm/ConnectionServiceWrapper.java
+++ b/src/com/android/telecomm/ConnectionServiceWrapper.java
@@ -610,14 +610,14 @@
GatewayInfo gatewayInfo = call.getGatewayInfo();
Bundle extras = call.getExtras();
if (gatewayInfo != null && gatewayInfo.getGatewayProviderPackageName() != null &&
- gatewayInfo.getOriginalHandle() != null) {
+ gatewayInfo.getOriginalAddress() != null) {
extras = (Bundle) extras.clone();
extras.putString(
NewOutgoingCallIntentBroadcaster.EXTRA_GATEWAY_PROVIDER_PACKAGE,
gatewayInfo.getGatewayProviderPackageName());
extras.putParcelable(
NewOutgoingCallIntentBroadcaster.EXTRA_GATEWAY_ORIGINAL_URI,
- gatewayInfo.getOriginalHandle());
+ gatewayInfo.getOriginalAddress());
}
try {
diff --git a/src/com/android/telecomm/InCallController.java b/src/com/android/telecomm/InCallController.java
index 981a640..59c06b5 100644
--- a/src/com/android/telecomm/InCallController.java
+++ b/src/com/android/telecomm/InCallController.java
@@ -36,7 +36,7 @@
import android.telecomm.InCallService;
import android.telecomm.ParcelableCall;
import android.telecomm.PhoneCapabilities;
-import android.telecomm.PropertyPresentation;
+import android.telecomm.TelecommManager;
import android.util.ArrayMap;
import com.android.internal.telecomm.IInCallService;
@@ -464,10 +464,10 @@
capabilities |= PhoneCapabilities.RESPOND_VIA_TEXT;
}
- Uri handle = call.getHandlePresentation() == PropertyPresentation.ALLOWED ?
+ Uri handle = call.getHandlePresentation() == TelecommManager.PRESENTATION_ALLOWED ?
call.getHandle() : null;
String callerDisplayName = call.getCallerDisplayNamePresentation() ==
- PropertyPresentation.ALLOWED ? call.getCallerDisplayName() : null;
+ TelecommManager.PRESENTATION_ALLOWED ? call.getCallerDisplayName() : null;
List<Call> conferenceableCalls = call.getConferenceableCalls();
List<String> conferenceableCallIds = new ArrayList<String>(conferenceableCalls.size());
diff --git a/tests/src/com/android/telecomm/testapps/TestConnectionService.java b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
index 26a65aa..6963eb3 100644
--- a/tests/src/com/android/telecomm/testapps/TestConnectionService.java
+++ b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
@@ -28,12 +28,12 @@
import android.telecomm.Connection;
import android.telecomm.PhoneAccount;
import android.telecomm.PhoneCapabilities;
-import android.telecomm.PropertyPresentation;
import android.telecomm.ConnectionRequest;
import android.telecomm.ConnectionService;
import android.telecomm.PhoneAccountHandle;
import android.telecomm.RemoteConnection;
import android.telecomm.StatusHints;
+import android.telecomm.TelecommManager;
import android.telecomm.VideoProfile;
import android.telephony.DisconnectCause;
import android.util.Log;
@@ -330,7 +330,7 @@
VideoProfile.VideoState.BIDIRECTIONAL :
VideoProfile.VideoState.AUDIO_ONLY;
connection.setVideoState(videoState);
- connection.setHandle(handle, PropertyPresentation.ALLOWED);
+ connection.setHandle(handle, TelecommManager.PRESENTATION_ALLOWED);
addCall(connection);