This can be a hardware problem but you may try something before to claim your warranty.
Try to install
this app from Google Play, it's a Sound detector with an slider to adjust the "sensitivity level" and you may be lucky if once closing the app your mic keep the level. If not.... go to your shop and claim for a change.
I'm sorry, I don't have another idea.