Attempt to de-flake testSyncState.

(Cherry-pick from R CTS. Original CL decscription follows below.)
Bug: 170926877

- Don't assert on time differences between states. We only care about
the ordering of the states, the time difference between states is beyond
our control.

- Remove lock notifyAll() without a corresponding wait(). Also
synchronize on same lock for creation of SyncAdapter's CountDownLatch as
CountDownLoatch.countDown().

Fixes: 156691456
Test: atest --iterations=100 CtsStatsdHostTestCases:android.cts.statsd.atom.UidAtomTests#testSyncState
Change-Id: Ib5047c03ff8b8f3790e29682dadfc6b8146d9117
Merged-In: Ib5047c03ff8b8f3790e29682dadfc6b8146d9117
(cherry picked from commit 93d82cd81dbd119617c4328b3954552f35f4cce4)
2 files changed