Avoid accidental arming and triggering alarm when phone is in your pocket unlocked

It happens only occassionally, but when it does, it is a big problem: your phone is in your pocket unlocked. The app is open or becomes open after receiving a notification. Then you accidentally arm the alarm. Then the alarm goes off.

Can you add a feature to avoid accidental arming of the alarm?

One idea is to require a PIN to arm the alarm. This would prevent accidental arming (and subsequent triggering). Optionally, consider that this feature could be configurable so for people who don’t need this protection, they don’t need to enter a PIN. Perhaps ther are other ideas to implement this capability as well.