As I mentioned before we are currently developing an application which runs on a dedicated android-device. When implementing the auto-start function I noticed that android enters a screen-locked state after booting. This snippet disables the lock.
KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
in androidmanifest:
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>
2 Comments
Marcus,
in which file, do i need to modify. can i get the full source code. i am having android on our custom board. i need to disable keylock during booting-up.
Thanks and Regards, HarishKumar.V
should i call it from every activity? or once on application running? and when the KeyguardLock released and opened?