Modern Xiaomi smartphones come with a host of smart features designed to make everyday use easier. One such useful option is an in-pocket mode that locks the screen when the device is in confined space, preventing accidental calls and battery discharge. Owners of MIUI 12 shell devices often face situations where this feature is not working correctly or is completely disabled by default, which requires manual intervention in system settings.
The problem is relevant, because the lack of lock in your pocket can lead you to pull out a phone with the recorder on, or with the emergency number dialed. In this article, we will discuss in detail the algorithms for activating the function, setting the sensitivity of the proximity sensor and methods for eliminating common errors. You will learn how to correctly calibrate the proximity sensor so that the system accurately detects the presence of the smartphone in the pocket of the pants or bag.
We'll look at both standard methods through the settings menu and hidden engineering tests available through a dedicated menu. Understanding the principles of sensors will allow you to avoid false positives when the screen goes out during a conversation, or situations where it continues to burn while lying on the table. Proximity Sensor is the key to comfortable use of your Xiaomi.
The approach sensor in MIUI 12
The back of the pocket mode is a proximity sensor, usually located at the top of the front of the smartphone. This sensor emits invisible infrared radiation and analyzes its reflection from objects. When you hold the phone to your ear or put it in your pocket, the light reflects off the tissue or skin, and the sensor signals the system to lock the display. In the MIUI 12 shell, the system process is responsible for processing this data, which can conflict with third-party applications or protective films.
It is worth noting that new Xiaomi models use a virtual sensor that works in conjunction with an accelerometer and a gyroscope, which sometimes causes delays in reaction. The physical sensor is more accurate, but is subject to contamination. If dust, grease or glue residue from the protective glass accumulates on the surface of the glass or in the dynamic speaker area, the accuracy of the readings can be reduced to a critical level.
MIUI 12 algorithms also analyze the rate of light change. A sharp drop in light levels is often interpreted as putting a device in your pocket. However, when you use dark covers or wear a phone with a screen to your body in tight clothes, false positives can occur. It is important to understand the difference between software locking and hardware shutting down the backlight.
π‘
Use microfiber to regularly wipe the top of the screen to avoid false sensor alerts due to contamination.
Activate the function through the standard settings menu
The first and easiest way to turn on the mode in your pocket is to use the standard system settings interface. The path to the desired switch may vary slightly depending on the particular smartphone model, but the general logic remains the same. You need to open the Settings app and go to the section responsible for locking the screen.
In some versions of MIUI 12, this option is placed in a separate screen lock menu, while in others it is hidden inside the lock screen settings. Find a item called pocket mode or pocket mode and activate the corresponding slider. If the switch is already active but the function is not working, try turning it off and reset it to reset the service state.
Note that on some global firmware, this item may be called βPrevent accidental touches.β This is the mode that blocks the touchscreen when youβre in your pocket. The absence of this item on the menu may indicate that your version of the shell has region limitations or requires an update to security components.
βοΈ Verification of mode activation
Calibration of the sensor through the engineering menu
If standard settings don't work, you need to calibrate the sensor, which is a procedure that trains the system to understand what is near and what is far for your device, and uses a special code that is entered through the Phone app to access the engineering test.
Enter the code ##6484## or #4636## in the dialer. Once you enter the combination, the CIT menu will open. In the test list, find the "Proximity Sensor" or "Proximity Sensor" item. Click on it to go to the calibration screen. Here you will see two values: the current sensor reading and the threshold value.
The calibration process requires simple steps: first, remove your hand from the top of the phone so that the sensor can see the far point, and press the Calibrate or Pass button. Then close the sensor with your palm (imitating a pocket) and press the confirmation button again. If the test is successful, you will see a message Calibration Success. If you fail, repeat the procedure, making sure that your finger tightly covers the sensor area.
What if the code doesn't work?
Sensitivity and exclusion settings
The MIUI 12 shell provides advanced sensitivity management capabilities, although they are often hidden from the average user. Changing the trigger threshold can help if the phone is locked too often or ignores being in your pocket.
Go to Settings β About your phone and tap the build number seven times to activate the developer menu. Then, in the "Additional" section, look for input settings or special features. This can be where the sensor sensitivity slider is located. Moving it upwards will make the sensor more susceptible to the slightest changes in light.
It's also worth checking the list of apps that are allowed to ignore lock mode. Some navigators or voice recorders may take precedence over the system sensor. Go to the security settings and look for the "Allows" or "Out-Start" section to make sure system services aren't limited in background work.
Influence of protective glasses and covers
One of the most common causes of malfunctioning in the pocket is accessories. Poor quality security glasses may not have a special cutout or a transparent layer above the proximity sensor, resulting in an infrared beam bouncing off the inside of the glass, and the system thinks the phone is closed.
Tight leather bookcases can also cause problems if the magnetic fastener is too close to the top of the smartphone. The magnetic field can affect the magnetometer, which is indirectly involved in determining the position of the device.
If you use a hydrogel film, make sure it's glued flat and has no air bubbles at the top. Even a microscopic defect in the coating can scatter IR rays. The table below shows common accessory problems and how to fix them.
| Accessory type | Probable problem | Decision |
|---|---|---|
| Protective glass without a cutout | Permanent locking of the screen | Replacement of glass with a model with a cutout |
| Tight case | Delayed unlocking | Use of an open-top cover |
| Hydrogel film | Reduced sensitivity | Blisterless film pasting |
| Magnetic holder | Gyroscope failures | Removal of the ring from the back cover |
π‘
The quality of the accessories has a direct impact on the sensors, and cheap glass often breaks the logic of the screen.
Problem Solving and Program Conflicts
Sometimes the problem is not hardware, but software failures of the MIUI 12 shell itself. Conflicts can arise after updating the system or installing applications that control the screen (for example, βpocket modesβ from third-party developers), Having two applications trying to control the sensor leads to chaos in the system.
Remove any third-party screen locking utilities. Leave only the system function. If the problem persists, try resetting all apps through the recovery menu. It's also worth checking for updates for the Security and Google Play Services component, as they often contain patches for sensor drivers.
As a last resort, if calibration doesn't work, you can try resetting to factory settings, saving the data beforehand, and this will eliminate deep registry errors, but before you do, make sure that the sensor is physically fit by checking it in the engineering menu.
Can a virus block the sensor?
Frequently Asked Questions (FAQ)
Why does the screen go out when youβre talking, even though your phone isnβt in your pocket?
Can I turn off the mode in my pocket completely?
Does the flight mode affect the sensor?
What to do if the menu does not have the option "Mode in your pocket"?
β οΈ Note: When calibrating the sensor in the engineering menu, do not use sharp objects to close the sensor, so as not to damage the protective glass or speaker mesh.
β οΈ Warning: Resetting your settings to factory will delete all your personal data, so be sure to back up your contacts and photos before the procedure.
β οΈ Note: Using non-original protective glasses without a transparent zone above the sensor can make the function of the mode in the pocket completely inoperable.