title: Check if lockscreen is currently displayed
body: <p>I have a problem with lockscreen. Sometimes when I sleep the phone and then immediately after wake it up, onResume is called and then onPause which messes up my app. I thought that I could do a workaround and if lockscreen is displayed then ignore the logic that I have in onPause but I can't figure out how to check it. I tried to use PowerManger and KeyguardManager like suggested <a href="https://stackoverflow.com/a/48208172/1852879">here</a> but it didn't work. I also tried to check if activity hasWindowFocus() in onPause but it returns true even if lockscreen is showing. Is there any way to know if lockscreen is currently displayed?</p>