Possible Duplicate:
Lock the android device programatically
I was trying to lock phone using a application,
I have tried the following code, but no use,I inserted user permissions too.
KeyguardManager manager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
KeyguardLock lock = manager.newKeyguardLock("hh");
lock.disableKeyguard();
lock.reenableKeyguard();
Please suggest me a code to lock the phone.