TelephonyConnection: Serialize onHold()/onUnhold()

- When a DSDA UE has 3 calls:
1. TC@1 from SIM1, on hold
2. TC@2 from SIM1, active
3. TC@3 incoming from SIM2

When it answers TC@3, TC@1 should DISCONNECT and TC@2 should go on HOLD.
- TelephonyConnectionService serializes TC@1's onDisconnect() and TC@2's
  onHold(), however the underlying TelephonyConnection calls are not
  serialized- specifically the disconnect goes through a handler, while
  the hold is processed immediately,
- So TC@1's DISCONNECT is pre-empted by TC@2's HOLD. This is not a
  problem when all 3 calls are at the same SIM, since the per-SIM
  ImsPhoneCallTracker has the necessary context to keep TC@2 on HOLD
  on answering TC@3.
- However when TC@3 is from SIM2, SIM1's ImsPhoneCallTracker
  UNHOLDs TC@2 after TC@1's DISCONNECT. Both TC@2 and the new TC@3 from
  SIM2 are logically ACTIVE, and 1 call gets dropped.

- Any dual-SIM fix should be non-intrusive to the per-SIM
  ImsPhoneCallTracker.
- A short term fix (this CL) is to also make TC@2's hold go through its
  TelephonyConnection handler, to "slow it down" so the TC@1's
  disconnect is processed and its state updated in ImsPhoneCallTracker.
- A long term fix to enforce the serialization at
  TelephonyConnectionService is considered for android V.

Fix: 269544679, 280695920
Test: Live tests for 3 calls and multiple swap / hold across single-SIM and DSDA.
Change-Id: If3b7a2ec71ba6c3f375814a59559f963069a3047
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 6d136b0..7aa0e7b 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -149,6 +149,8 @@
     private static final int MSG_DTMF_DONE = 22;
     private static final int MSG_MEDIA_ATTRIBUTES_CHANGED = 23;
     private static final int MSG_ON_RTT_INITIATED = 24;
+    private static final int MSG_HOLD = 25;
+    private static final int MSG_UNHOLD = 26;
 
     private static final String JAPAN_COUNTRY_CODE_WITH_PLUS_SIGN = "+81";
     private static final String JAPAN_ISO_COUNTRY_CODE = "JP";
@@ -344,6 +346,12 @@
                     }
                     sendRttInitiationSuccess();
                     break;
+                case MSG_HOLD:
+                    performHold();
+                    break;
+                case MSG_UNHOLD:
+                    performUnhold();
+                    break;
             }
         }
     };
@@ -1049,12 +1057,12 @@
 
     @Override
     public void onHold() {
-        performHold();
+        mHandler.obtainMessage(MSG_HOLD).sendToTarget();
     }
 
     @Override
     public void onUnhold() {
-        performUnhold();
+        mHandler.obtainMessage(MSG_UNHOLD).sendToTarget();
     }
 
     @Override