In most cases, warships don't go around with their active sonar on, it really bothers GreenPeace.
Active sonar is only used when they are specifically looking for something, and in most cases of covert observation by US subs, the baddies have no idea they're there, so they wouldn't light up their active sonar just going about their normal ship-board routines.