Bug: 19821830 Cherry-pick of ba6adf66 Cherry-pick of e70c5754 Change-Id: Id342fa0ab345f204bec58acf45ce72f6de950cfb