Maintain the state of the CANCEL_NEXT_UP_EVENT flag properly. Change-Id: I5ca22409bf8557c486d02806811b10550c5576eb