This may be of interest to your efforts:
There's a debug menu which has a screen that allows you to "test" your Proximity/accelerometer/etc Sensors... You might play around with this test screen to see if maybe it's detecting "proximity" even when there's nothing near it...
First: (extracted from egg_head's about secret codes)
Go into the Dialer and enter *#83786633 then press the Home key
Go back into the phone dialer (clear first code) and enter *#22745927
Now a box will come up asking for the SPC code. Enter 000000
Press the Hiddenmenu Enable radio button.
Then:
From the dialer, enter: *#0*#
This should launch the LCD Test screen.
From here, there's a "Sensor" button in the bottom middle.
Once inside, you see various information: Accelerometer, Proximity, Light, and Magnetic Sensor (great way to see the compass)
You can move your hand over the top part of the phone, and the screen should turn Blue when the proximity is triggered.
I would then play around with the phone.. hold it like you would if you were entering digits... wiggle it, tilt it in different directions... just to see if anything triggers the proximity, even though you have nothing near the top of the screen.
For my phone, it ONLY shows the blue screen when i have some object within 2 inches of the sensor.
There is a "Cal." button.... I've pressed it a few times, but I have no clue what it's doing... not sure if you're supposed to have it on a solid/level surface and then hit the calibrate? or.. if it even works at all . ??
This test also allows me to see that the proximity sensor is the one closes to the earpiece.
what's also interesting is that the Light Sensor appears to be in the same spot as the proximity... when I cover up the left dot,.. nothing changes... proximity and light show the same... ... . .
Not sure if this will get you anywhere.. but, i'm hoping it may show that proximity is being triggered even when you don't think it should be