In the realm of mobile device hardware integration, the proximity sensor stands as a critical component for power management and user interface optimization. For engineers, technicians, and advanced users working with OnePlus smartphones, understanding the methods to disable this sensor is essential for diagnostics, hardware testing, and specific use-case modifications. This guide provides a technical overview of the proximity sensor's function and details the primary methods for its deactivation.
The proximity sensor, typically an infrared (IR) LED and receiver pair located near the earpiece, serves a fundamental purpose: to detect the presence of nearby objects without physical contact. Its most common application is during voice calls. When the device is brought close to the user's ear, the sensor triggers the display to turn off, preventing accidental screen touches and conserving battery power. It also plays a role in preventing false triggers in pockets or bags. In the OnePlus Android framework, the sensor is managed by thesensors.qcom HAL (Hardware Abstraction Layer) and interfaces with theSensorManager service.
There are several scenarios where disabling the proximity sensor becomes a technical necessity. These include conducting hardware diagnostics where sensor feedback interferes with other tests, performing screen repairs or replacements (where a faulty sensor calibration can cause the screen to remain off), developing applications that require full screen persistence, or troubleshooting the infamous "pocket dial" issue that may arise from sensor malfunction. It is crucial to differentiate between a software-disable command and a physical hardware fault; this guide addresses the former.
Method 1: Utilizing the Hardware Test Menu (Engineering Mode)

OnePlus devices, like many Android smartphones, contain a built-in engineering menu for hardware diagnostics. This is often the most direct software method.
1. Open the phone dialer.

2. Enter the code#808#. This code is commonly used for the "OnePlus FactoryMode" or similar engineering interface on many models. (Note: Codes can vary by model and OxygenOS version.##808## or##3646633## are alternatives to try).
3. This action should launch a hardware testing menu. Navigate to "Sensor" or "Proximity Sensor Test."
4. Within the test menu, there is often an option to "Disable," "Turn Off," or "Calibrate." Selecting disable will deactivate the sensor for the current session. This change is typically reverted upon reboot.
Method 2: Disabling via ADB (Android Debug Bridge) Commands
For persistent control and automation, ADB provides a powerful command-line interface. This requires USB debugging to be enabled on the OnePlus device and the ADB binary installed on a connected computer.
1. Connect the device to a PC and authorize the debugging connection.
2. Open a command prompt or terminal on the PC.
3. To check the sensor's status and identifier, you can use:
adb shell pm list features
or more directly, pull the sensor list:
adb shell dumpsys sensorservice
4. The most direct method to disable the sensor is by controlling the associated kernel module or system property, which often requires root access. For non-rooted devices, a temporary workaround is to force-stop the process managing it or useadb shell to input:
adb shell settings put system proximity_sensor 0
(This command's effectiveness depends on the specific OxygenOS build and may not be universally available).
5. For rooted devices, one can remount the system partition as read-write and modify relevant configuration files in/system/vendor/etc/ or disable the kernel module.
Method 3: Employing Third-Party Applications (Non-Root & Root)
Several applications on the Google Play Store can control sensor permissions. Apps like "Proximity Sensor Reset/Repair" or "Sensor Disabler" request theDUMP permission (often via ADB) to disable sensors. For rooted devices, apps like "Kernel Adiutor" or "EX Kernel Manager" offer deep system control, including the ability to toggle specific sensor drivers.
Important Technical Considerations and Warnings:
Reboot Persistence: Changes made via the Engineering Menu or non-root ADB commands are usually temporary. A device reboot will typically re-enable the sensor and reload its default drivers.
Root Access: Permanent disablement (surviving reboots) almost invariably requires root privileges to modify system files like/system/build.prop or vendor HAL configurations. This voids the warranty and carries significant security risks.
Functional Impact: Disabling the proximity sensor will cause the screen to remain on during phone calls