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

Change-Id: I17508be0c957ecbad4768c76e1e6e5809935b54f