How about moving this inside enableCameraFeatures() where it is used?  Also, I'd just do return false instead of res=false; break;  And I'd just return true at the end, but that is a matter of style.