[automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev am: a2b27aa9ae -s ours
am skip reason: subject contains skip directive
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telephony/+/15687964
Change-Id: Ifa3653be05a26eabb14dd9f0adc114e9fc052c17
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index ba797a3..64b2e4d 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1056,7 +1056,7 @@
request.argument).first;
request.phone.setCallForwardingOption(
callForwardingInfoToSet.isEnabled()
- ? CommandsInterface.CF_ACTION_ENABLE
+ ? CommandsInterface.CF_ACTION_REGISTRATION
: CommandsInterface.CF_ACTION_DISABLE,
callForwardingInfoToSet.getReason(),
callForwardingInfoToSet.getNumber(),
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 7a0d8c2..766a75e 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -1199,9 +1199,9 @@
return connection;
}
- com.android.internal.telephony.Connection originalConnection =
- call.getState() == Call.State.WAITING ?
- call.getLatestConnection() : call.getEarliestConnection();
+ // If there are multiple Connections tracked in a call, grab the latest, since it is most
+ // likely to be the incoming call.
+ com.android.internal.telephony.Connection originalConnection = call.getLatestConnection();
if (isOriginalConnectionKnown(originalConnection)) {
Log.i(this, "onCreateIncomingConnection, original connection already registered");
return Connection.createCanceledConnection();