[Framework] Fixed issue with pause/resume scanning when app switched states from background to foreground