Merge "Updated isAppForeground implementation."