It's no secret that Android phones are often targets of malware. Just last month, an estimated 36.5 million Android devices were infected with Play Store apps that contained malware which generated false ad revenue for the malware creators.

One way malware can hijack a phone is to prevent the user from exiting the app by pressing the back button. Now this could simply be a poorly coded app or something more nefarious.

In order to prevent apps (malicious or not) from locking a user from going back, Google secretly inserted code that forces Android to override the app and go back to the home screen whenever the back button is pressed multiple times. Found by the ever resourceful XDA-Developers, the feature is called "panic detection" and was located in a recent build of Android 7.1 Nougat.

This feature doesn't seem to be on all devices with Android 7.1, but is a useful feature nonetheless.

According to the code unearthed by XDA, the exact number of button presses needed is four by default and the time between presses needs to be less than a third of a second (300 ms to be exact). This seems like a very minor thing and indeed, the Java code that Google used to implement it is relatively simple, however, the first thing many people do if their phone freezes is to press the back button (or home button).

Having this feature allows users to exit an app and then delete it without having to restart their phone. It's encouraging to see Google pay attention to minor security details and improve user experience.