Merge "TIF: Change the isForeground API to isVisible and isMainSession" into sc-dev