Game is not detecting lockscreen

i created a game i.e 2D platformer game
but when i m trying to test in my android device
game is work properly
and when i’m pressing the side lock screen button to lock mobile but when i’m unlocking my mobile, my device is locked and not showing the lock screen display to unlock my device or to put my password, game is directly displayed without unlocking my device, and when i’m exiting the game my device is locked and game closed and device is asking me to pu password .

It might be related to unity settings, depending on your unity version you might have the option "Run In Background" to allow your application to stay active even when your phone is not active, preventing it to lock

–

That's expected behavior for development builds. If you would switch to release - you'll see lock screen as usual.

–