Backport from master.

Change-Id: I416e4325242ba147cb02acb69a577bf1fb60275f
Merge android-4.1.2_r1