Fix exception on rotation.

Change-Id: I6cc653db3397074fb1cd9aa12b06511ce2cc3c9d
JIRA:CYAN-731
Merge "Fix exception on rotation." into cm-10.1
Merge remote branch 'cm/cm-10.1'