Merge "Only check bg restriction if an app is idle" into pi-dev