Merge "Avoid checking for idle state when the app is in top state." into tm-dev