manually cherry-pick http://review.cyanogenmod.org/#/c/24276/

Change-Id: Iea1c542f36021b6eb334dd0a428d238eb76f14be