Enforce consistent user retrieval for ICS updates.

In InCallController, getUserFromCall is being leveraged in various areas
to get the corresponding user which is used to store references to the
ongoing connections. Typically, this is extracted from the UserHandle
stored in the target phone account but this may not be set if the user
has not selected a default sim and there are multiple accounts which can
be used to place the call. As fallback in the situations, we used the
current user so the connection would be referencable using that user
only. Once the target account is set (and if that user is different from
the current user), we would end up trying to retrieve the ICS for that
user which would result in a bunch of no-ops in the call flow.

As a solution, we can ensure that the UserHandle retrieved for any given
call by getUserFromCall will always be consistent for the entirety of
the call. For MT calls, the target phone account is always set so we can
use that. For MO calls, since there's a possibility that the target
phone account isn't set, we can use the initiating user instead. Note
that for any call, the phone account used would either be associated
with the user placing the call or not. In the latter case, we should
still use the initiating user so that we can report that as such in
dialer.

This points out a deeper problem in Telecom where we are interchangeably
using Call#getInitiatingUser and
Call#getUserHandleFromTargetPhoneAccount, without enforcing the
possibility that the target phone account is never set if a default sim
isn't selected. In order to consolidate the logic to determine the user
association with the call, I have replaced mInitiatingUser with
mAssociatedUser, which essentially tracks the associated user for any
given call (i.e. initiating user for MO, target phone account user for
MT). Also note that for conference calls and existing connections, we
will continue to base the user association with the target phone account
user.

Fixes: 284403805
Test: Created a failing test which tests that the connection is not
      removed from the mapping when the call is removed before the
      updates.
Test: Unit test to ensure that the user retrieval in getUserFromCall is
      consistent when the target phone account is not initially set.
Test: Modified existing unit tests, atest TelecomUnitTests
Test: Manual testing on secondary user with no default sim to verify
      in-call UI is visible and accessible.
Change-Id: I262344ae555c790eae6e6e37b664694a9ce859e3
28 files changed