Merge branch 'stable-3.1' into stable-3.2 * stable-3.1: Use volatile and AtomicIntegers to be thread safe Change-Id: I923730a525fbffb4c304ab0d23b088f5e8bfa307