Merge "Protect against possible race conditions" into oc-dev
am: 21076bf34e

Change-Id: I0a0fd4feded52ca8a31caa100dcbd6740b186fdc