Merge "Prevent re-entrant calls to onPause" into tm-dev