add --headless mode

Change-Id: I6338ed1d093a8db20250bd060cf97896db268976
Merge "add --headless mode" into cm-10.1
Merge remote-tracking branch 'cm/cm-10.1' into cm-10.1