The maker of the BlackBerry e-mail device Friday said it settled its long-running patent dispute with a small Virginia-based firm, averting a possible court-ordered shutdown of the BlackBerry system and a disruption of wireless service for millions of users.