Ideally, as long as you haven't abused heroin for years, or been on methadone for maintenance therapy, I am 100% confident, for an otherwise healthy adult, your testosterone levels should return to normal if you were to quit using them.
They both will have some degree of effect.
Have you gone to an endocrinologist in the past? Ideally, you could measure your testosterone levels while on opiates, before, and afterwards as well, to track the effects it had on your testosterone level.
If you are at least in your mid 20's then your levels shouldn't be doing much other than 'plateauing'; opiate use of oxycodone/codeine, 4-5 times a week, at a recreational dosage, probably won't have an "extreme" testosterone diminishing effect like 200mg oral methadone / day would, but it could have some effect.