Merge "Avoid applying closing animation for invisible activity." into sc-dev