Code example for KeyguardManager

Methods: newKeyguardLock

0
        mImm = InputMethodManager.getInstance();
 
        KeyguardManager keyguardManager =
            (KeyguardManager) getInstrumentation().getContext().getSystemService(
                    Context.KEYGUARD_SERVICE);
        keyguardManager.newKeyguardLock("imftest").disableKeyguard();
    } 
     
    // Utility test methods 
    public void verifyEditTextAdjustment(final View editText, int rootViewHeight) {
 
        int[] origLocation = new int[2];
        int[] newLocation = new int[2];
 
        // Tell the keyboard to go away. 
        mImm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
 
        // Bring the target EditText into focus. 
        mTargetActivity.runOnUiThread(new Runnable() {
            public void run() { 
                editText.requestFocus();