For the record, the linked method did NOT work for me; using the hidden menu recalibration was a complete failure on my device. My proximity sensor was so screwed up that the built-in hardware test wouldn't even recognize that the sensor was in my phone. This was the first method I tried before I even bothered posting a solution.