Before I returned my first Iphone, I tried every trick in the book i.e. restore to factory settings, setup as a new phone without backup, upgrade to 4.01 etc. But I still had the problem with the sensor. So I finally concluded It was a hardware issue not a software issue. Well at least in my case it was.
How to find out if you have this problem with the sensor? Well unfortunately there's no certain way. While testing, the proximity sensor works perfectly fine when you place your finger on it etc. However it starts acting funny during calls. Mine use to start acting up mostly after a few minutes into call when the phone started to heat up. And then no matter how close I put it to my face the screen light still remained on. I was at a stage where I had to ensure that my cheek didn't touch the glass while talking. Trust me it was a pain.
So far the new phone's been doing great. I tested it for at least ten minutes at the genius bar before taking delivery. The the genius asked me to comeback anytime if I am able to replicate the issue again.
How to find out if you have this problem with the sensor? Well unfortunately there's no certain way. While testing, the proximity sensor works perfectly fine when you place your finger on it etc. However it starts acting funny during calls. Mine use to start acting up mostly after a few minutes into call when the phone started to heat up. And then no matter how close I put it to my face the screen light still remained on. I was at a stage where I had to ensure that my cheek didn't touch the glass while talking. Trust me it was a pain.
So far the new phone's been doing great. I tested it for at least ten minutes at the genius bar before taking delivery. The the genius asked me to comeback anytime if I am able to replicate the issue again.