Correctly send the original address in BluetoothPhoneService if using gateway
Bug: 17662993
Change-Id: I3e02f74ace399361033f126bb1e01b8ef5753827
diff --git a/src/com/android/server/telecom/BluetoothPhoneService.java b/src/com/android/server/telecom/BluetoothPhoneService.java
index 9e02539..7d0dab1 100644
--- a/src/com/android/server/telecom/BluetoothPhoneService.java
+++ b/src/com/android/server/telecom/BluetoothPhoneService.java
@@ -508,7 +508,12 @@
int index = getIndexForCall(call);
int direction = call.isIncoming() ? 1 : 0;
boolean isPartOfConference = call.getParentCall() != null;
- Uri addressUri = call.getHandle();
+ final Uri addressUri;
+ if (call.getGatewayInfo() != null) {
+ addressUri = call.getGatewayInfo().getOriginalAddress();
+ } else {
+ addressUri = call.getHandle();
+ }
String address = addressUri == null ? null : addressUri.getSchemeSpecificPart();
int addressType = address == null ? -1 : PhoneNumberUtils.toaFromString(address);