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
1 file changed