Answer to: iPhone 4 proximity sensor not working after replacing BLACK GSMYes. I have an idea: Read the comments above. Alle of them. As soon as you tried everything mentioned here you can almost be sure your logicboard is broken.
Answer to: iPhone 4 proximity sensor not working after replacing BLACK GSMI just ried the foam-fix with a DIY foam-frame. It worked perfect on an iPhone we already assumed to be lost. My guess: If the light sensor gets too much light, it doesn't work (o'really :). But where does it get the light from, when you cover the front? From the backlight! The light from the lcd panel diffuses into the light sensor. So if you take a little bit foam to make a frame around the sensor - just like the thing on eBay linked above http://tinyurl.com/6w7uutc this problem is solved. Wow.