Merge "Fix typo and improve logging for activity state check." into main