Synchronize updates of missed call counts and add more logging.
When the missed call count stored in MissedCallNotifierImpl was updated, there was a rare chance for the missed call count to be cleared while it was being updated. mMissedCallCounts is a concurrent hash map and the references it stores are AtomicIntegers; getting an element and then updating it can't be guaranteed to be thread safe. Also, in the case of updating the missed call count we'd update the value and then re-fetch it when sending the intent to dialer; this means it could have been cleared in the process of being updated. Test: Ran MissedCallNotifierImpl tests. Test: Performed missed call regression testing to verify that missed call notifications and clearing takes place in Dialer as expected. Test: Added unit tests for dialer-handled set/clear of missed call count. This doesn't test concurrency per se, but it helps improve test coverage. Fixes: 168695531 Change-Id: I76389500bf8d91f029123178060db6ff38e398eb
Loading
Please register or sign in to comment