Merge "Improve isInForeground" into rvc-dev