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

Change-Id: Icbd64228602c4a32dfe3e1cecc0a2b57e67190f1