This question has been asked before but the answers do not apply to the current android version (e.g. here is an answer for 2.3 and here is a question marked duplicate for that answer; I also tried the solutions here and here).
I can't seem to find an answer to this question. Is it even possible? Most searches turn back results of people who have an issue with their sensor or whose screens don't come back on (mine does), but I want to flat out stop this from happening (it was nice before bluetooth, but now I get a random black screen in the middle of calls whenever I try to look for something).