manual cherry-pick http://review.cyanogenmod.org/#/c/27624/

Change-Id: Iaa20c6c44bf773aa0b5c333c0983a01934fac85f