Reland #2: Android: Replace ConcurrentHashMap usage with manual lock.

ConcurrentHashMap has a bug on L.
* Also adds a checkstyle check to prevent future uses.
* Also adds @AnyThread / @MainThread to all public methods

Previously reverted in ab41c2866ed57abc1f778496440e84a7023a787c.

Reason for reland: Fixed toolchain issue (crbug.com/693079)

Change since previous land:
* Optimizations so that we're now removing some methods rather than
adding some (which the previous land did).

Change-Id: I00afd74394964c62b6cc5358a8546048aa215e8d
Bug: 905903
Reviewed-on: https://chromium-review.googlesource.com/c/1412233
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#624190}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d69c7a37d711183e6c215115ccaa29ffc6b59a76
1 file changed