The following was posted on XDA four months ago when people were having problems with the proximity sensor. I don't know if it will work now, with Android 5.1, but it might be worth trying at least. Please let us know if you try it and what the results are.
Guys I think I may have a fix for everyone out there I just stumbled across this has my proximity sensor was not working either until now. What you want to do is go into accessibility under settings and check power button to end call . Somehow when I check this my proximity sensor started working correctly again also after that I unchecked it so put it back to normal and it is still working flawlessly. I believe when you check that it recalibrates the sensor. So could someone else please check this and see if it works for them.. ( I wish I would have discovered this before I lifted up my screen protector like 10 times and messed up most of the edges smh.... )
Also if you do not have anyone to call to check to see if it is working you can use this app
https://forums.androidcentral.com/e.../store/apps/d...ter.proxfinder&token=8iTpDs3f
P.S. I think after this others posted that, after changing to power button to end call, they rebooted before unchecking the box to use the power button to end call.