Partial cherry-pick of commit 7ad1110e. Test: m Merged-In: Id0e57ee828f17008891fe3741935a9be8830b01d Change-Id: Id0e57ee828f17008891fe3741935a9be8830b01d