Share your experience!
Big daddy resolved it 
You have to sacrifice resetting the phone using the Sony PC software 1st. Avoid data backup from old accounts.
Then, after the reboot is done and Android is reinstalled with update x.x.x.534 goto the dialer & type *#*#7378423#*#* then press dial
In the menu that will come go to calibration and then choose proximity sensor. (If you run the test it might give error = -1) Then, set settings to default and it may ask to reboot the device.
After reboot type *#*#7378423#*#* then press dial. In the menu that will come go to calibration and then choose proximity sensor do the test and it will show success. VIOLAAAaaaa!!!!
Check the phone...it works 
Have tested this and the issue is resolved on my phone finally ....yippieeeeeee!!!
I also discovered this solution through trial and error before reading your post and can assure everyone that it does work.
My screen appears to be loose in the top right corner and this was causing the issue.
If you do use black tape to cover the proximity sensor, use a good brand otherwise it will peel off!
@Armini wrote:Xperia Z Ultra C6833 - Android 5.0.2
Try if this incredibly simple method will work for you:
1) Go into SERVICE TEST - proximity sensor. Your sensor is shown as ON continuously?
2) Get a small piece of black electric isolation tape (10x10mm). Glue it directly on the spot of the proximity sensor.
Your sensor is now shown as "OFF" in the SERVICE menu? Lucky you. Remove the Tape. Sensor ON? Your life is saved.
3) OK, here comes the fine tuning. Get a punch plier. Choose one of the little punches, around 2mm. Perforate a tiny circle of 2mm diameter of the black tape. Positioning it on the left lens of the double-lensed proximity sensors, it will give you the chance to test if the sensor will react if you touch it with your finger.
If the sensor is continuously on, cut the piece of tape some smaller with a cutter knife or a sharp scissor. This all can be done while the sensor test routine is running on your phone, no need to reboot etc.
If you are patient and work meticulously, you will be able to receive full function of the sensor with ear on / ear off to the phone.
4) I placed the tape spot directly into the left side of the cutout for the proximity sensor of my additional screen protector foil.
Works like a charm.
Good luck!
@phantomrocks wrote:Big daddy resolved it
You have to sacrifice resetting the phone using the Sony PC software 1st. Avoid data backup from old accounts.
Then, after the reboot is done and Android is reinstalled with update x.x.x.534 goto the dialer & type *#*#7378423#*#* then press dial
In the menu that will come go to calibration and then choose proximity sensor. (If you run the test it might give error = -1) Then, set settings to default and it may ask to reboot the device.
After reboot type *#*#7378423#*#* then press dial. In the menu that will come go to calibration and then choose proximity sensor do the test and it will show success. VIOLAAAaaaa!!!!
Check the phone...it works
Have tested this and the issue is resolved on my phone finally ....yippieeeeeee!!!
There is much easier way to unblock the proximity switch.
Just log in on "guest account",then return to your normal account and that's it,proximity switch works again.
thanks this work for me
i put wiretape between the back cover and the circuit board to give some pressure where the proximity sensor was. I am glad it wasn't a hardware faulty.