Merge changes Iadd8aa60,I0896307f into rvc-dev

* changes:
  Use isLeafTask() to check whether to save state.
  Send notification when reusing a stack as a task.