A man has been jailed for more than nine years for firearms offences after shots were fired in Smethwick last year.