How to Fix Nexus-4 sensor problem while on calls
Open up your Phone app, then tap the Menu/Overflow button and select the 'Settings' action. There should be an option to disable the sensor in those settings. 

If there isn't, download the Xposed Framework Installer, open it up then select 'Framework' and 'Update/Install'. Reboot, then install the Disable Proximity module. Open up the Xposed Installer again, select Modules, check the box beside 'Disable Proximity' and reboot again.