By any chance, Is this fixed in Android 2.1r1 release? I notice that there are many commits that mention Keyguard related fixes. I'm currently building the AOSP sources to verify the behavior in the emulator.
Some kind of confirmation will be appreciated :) On Thu, Mar 11, 2010 at 7:34 PM, devi prasad <[email protected]> wrote: > Hi, > In my application I want to use KeyguardManager to present the unlock > screen at required places. I wrote the following code and tested it on > Google IO phone (Android 1.6) and a Nexus One phone. Although this > works decently on Nexus one, its behavior is odd at times. Sometimes > the unlock screen doesn't appear for consecutive runs. It also has > serious issues with configuration changes. And surprisingly, if I turn > off the screen and turn it back on, the unlock screen disappears! Of > course, this happens only in my program, and not in general in the > phone. > > Can someone explain what's wrong with my code? Just FYI, I have tried > various combinations of disableKeyguard() and reenableKeyguard() > without much gain. > > public class UnlockActivity extends Activity { > KeyguardManager mKgm; > KeyguardLock mKgl; > > �...@override > public void onCreate(Bundle savedInstanceState) { > ... > mKgm = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); > mKgl = mKgm.newKeyguardLock("me"); > } > > class HandlerCallback implements Handler.Callback { > public boolean handleMessage(Message msg) { > mKgl.disableKeyguard(); > mKgm.exitKeyguardSecurely(new OnKeyguardExitResult() { > public void onKeyguardExitResult(boolean > success) { > Log.d("UnlockActivity", "status: " + > success); > mKgl.reenableKeyguard(); > } > }); > return true; > } > } > ... > } > > > thanks > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

