Manually cherry-pick http://review.cyanogenmod.org/#/c/25104/

Change-Id: I90359c36316cc8fbbae558e360cd4938eb686be1