Synchronize onMultiSimConfigChanged with callback registrations.

TelephonyRegistry is susceptible to race conditions around
MULTI_SIM_CONFIG_CHANGED broadcast. When broadcast received, we'll
executing onMultiSimConfigChanged which may cause mNumPhones changed.
However, callback registrations at the same times might try to access
an already non-exist phoneId. Synchronize the whole
onMultiSimConfigChanged with callback registrations to avoid potential
race conditions.

Bug: 221080521
Test: TelephonyRegistryTest
Change-Id: I36a3d2a3d153cd68dd3ec18774d457dc32b00c82
1 file changed