This is a cherry pick of http://android-git.corp.google.com/g/156427 from master. bug: 5800592 Change-Id: Ifb249e8b6d432bbd1a5faf1a8731deea02962d39