I just went through this same issue. My Prox sensor stopped working. Go to the play store and download a proximity sensor app. It should start reading around 3" from the front of the phone. I had the same issues, phone was shutting off non-stop, about 3-4 seconds after I unlocked the phone. My screen would also go to black as soon as I made phone calls, no menu at all. I contacted motorola and they had me clear the cache, then they had me do a complete reset of the phone (wiping all data) and they told me I had to make a warranty claim.
They gave me a issue id number (came with the email they sent me) I then initiated a chat with verizon, told them about my issue, gave them my motorola issue id number, and they overnighted me a new maxx. It was incredibly easy, and verizon's customer support was great.