Please tell us some basic information before asking for help:
Model Name: 5Z
Frequency of Occurrence: all the times
I face this problem quite a while. My phone functions running automatically while I use ear phones of any make.. I tried with almost with all possible ear phones.. this problem has increased after my last update of android 10