Please have the stored preference be the eventual value that's passed to setVibrate so that you don't have to do this rule matching.