Merge "Merge "Wait until any background events are processed." into stage-aosp-master am: 0589325300 am: 8cf1cab8c4 am: 120715a56b am: 1117253913"