Recently, I have been looking for reliable ways to control a secured Android Keyguard. Mainly to display a custom lock screen. I know that Google had state
If AOSP is in your control then you need to set the simple flag and keyguard() is gone for good. Here is the details to do that, get into the file "overlay/frameworks/base/packages/SystemUI/res/values/config.xml" and search for "config_enableKeyguardService" then set the flag to false.
NO MORE keyGuard, pheww