more headless fixes

Change-Id: I25243f67b8bcbef41867497b442d1b7f38f638dd
Merge branch 'cyanogenmod' into cm-10.1