bug:23128949 bug:27398183 Change-Id: Iffde6ba064e54546827cb8fc2a670baedf2e2409 (cherry picked from commit 83f080ac)