Fix potential concurrency issue with setTechnologyTypeExtras.
The setConnectionExtras call on mOriginalConnection would cause that
object to invoke the onExtrasChange callback in TelephonyConnection, which
itself would trampoline it back onto the handler. A bit of a roundabout
way to set the extras. Using the new set extras API instead.
Bug: 27646331
Change-Id: I680b755a81addb2da95d47c3fceeb57b83cd8a4e
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 04bc02c..9a5d708 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -737,14 +737,7 @@
*/
private void setTechnologyTypeExtra() {
if (getPhone() != null) {
- if (mOriginalConnection.getConnectionExtras() == null) {
- Bundle b = new Bundle();
- b.putInt(TelecomManager.EXTRA_CALL_TECHNOLOGY_TYPE, getPhone().getPhoneType());
- mOriginalConnection.setConnectionExtras(b);
- } else {
- mOriginalConnection.getConnectionExtras().putInt(
- TelecomManager.EXTRA_CALL_TECHNOLOGY_TYPE, getPhone().getPhoneType());
- }
+ putExtra(TelecomManager.EXTRA_CALL_TECHNOLOGY_TYPE, getPhone().getPhoneType());
}
}