lockscreen

Since version 8.1 Android implements something called “anti-falsing” for swipe actions on the lock screen, which are supposed to bring up the controls to input the pin or passphrase for unlocking the phone.

Anti-falsing in this context simply means that Android tries to figure out if a swipe action was intentionally or not. While I’m not entirely sure about the intention behind this behavior, I believe it’s to avoid unintended tries to unlock the phone and unintended emergency calls in cases where the phone is in a bag or pocket.

While the heuristics for identifying an unintentional swipe aren’t as simple, in practice this behavior means that a swipe on the lock screen has to cover a larger distance than everywhere else to be successful. With its default settings on my phone this means it’s required to swipe across half of the screen to get the controls shown, which is annoying to say the least, as it becomes difficult to do so successfully with a single hand.

As I had no problems with unintended swipes before, I searched for ways to disable this behavior. While older Android versions provided a build time configuration option to disable it, this option got removed with Android 12. So with Android 12 I had to look for other ways and as it turned out there are certain conditions which disable this behavior as well. Anti-falsing gets disabled if the device is for example sitting in a dock or if accessibility features are enabled. This meant that installing and enabling an accessibility service which did nothing other than being an accessibility service was sufficient to get it disabled and that’s what I did.

Unfortunately that didn’t last for long as Google tweaked the criteria for disabling the anti-falsing behavior with Android 12L to not only require any accessibility service to be enabled, but to have one enabled which implements touch exploration. As using an accessibility service which implements touch exploration would’ve meant changed behavior for touch events in general, I started looking for another solution again.

What I found in the end is much better than any of the previous solutions. While it’s no option to disable the anti-falsing behavior, it’s an option to change the value for the necessary distance covered by the swipe to be detected as an intended swipe. That means by using this option it’s not only possible to completely disable anti-falsing, but also to tweak its sensitivity to personal preferences. This option can simply be set via adb like that:

adb shell cmd device_config put systemui brightline_falsing_distance_screen_fraction_max_distance 0.1

Once set swiping on the lock screen should feel much more natural again.