Didn't volkswagen "fix" some emission tests in this manner?
They had 'defeat devices' that detected test environments and changed how the car ran so that it would pass emissions testing.
And only 2 or 3 people are in jail afaik.
Only a light slap on the wrist.