Android KeyguardManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android KeyguardManager class.

This code example shows how to use the following methods:newKeyguardLock
This code example shows how to use the following methods:newKeyguardLock
This code example shows how to use the following methods:newKeyguardLock
        mImm = InputMethodManager.getInstance(mTargetActivity);
 
        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() { 
6
CodeRank
This code example shows how to use the following methods:inKeyguardRestrictedInputMode
        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        if (!pm.isScreenOn()) {
            return false; 
        } 
        KeyguardManager km = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
        if (km.inKeyguardRestrictedInputMode()) {
            return false; 
        } 
        return true; 
    } 
 
    public static void assertViewVisible(View v) {
        if (v == null) {
            throw new NullPointerException();
        } 
        for (;;) { 
            assertTrue("visibility for " + v, View.VISIBLE == v.getVisibility());
            ViewParent parent = v.getParent();
            if (parent == null || !(parent instanceof View)) {
                break; 
5
CodeRank
This code example shows how to use the following methods:isKeyguardLocked
        this.stopService(serviceIntent);
    } 
 
    private void keyguardStop() { 
        boolean screenLocked =
                mKeyguardManager != null && mKeyguardManager.isKeyguardLocked();
        if (!screenLocked) {
            stopService(); 
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:inKeyguardRestrictedInputMode, isKeyguardSecure, newKeyguardLock
    } 
 
    public static synchronized void disableKeyguard(Context context) {
        initialize(context);
 
        if (mKeyguardManager.isKeyguardSecure()) {
            return; 
        } 
 
        if (mKeyguardManager.inKeyguardRestrictedInputMode()) {
            mKeyguardLock = mKeyguardManager.newKeyguardLock(LOGTAG);
            mKeyguardLock.disableKeyguard();
        } else { 
            mKeyguardLock = null;
        } 
    } 
 
    public static synchronized boolean inKeyguardRestrictedInputMode() { 
        if (mKeyguardManager != null) {
            return mKeyguardManager.inKeyguardRestrictedInputMode();
5
CodeRank
This code example shows how to use the following methods:inKeyguardRestrictedInputMode, newKeyguardLock
		setContentView(view.getView());
	} 
 
	private void disableKeyGuard() { 
		KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
		KeyguardManager.KeyguardLock lock = keyguardManager.newKeyguardLock(getClass().getName());
		if (keyguardManager.inKeyguardRestrictedInputMode()) {
			lock.disableKeyguard();
		} 
	} 
 
	@Override 
	public void onBackPressed() { 
		view.onBackPressed();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:isKeyguardLocked, isKeyguardSecure
 
    private boolean isKeyguardLocked() { 
        KeyguardManager kgm = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
        if (LOGV) {
            if (kgm != null) {
                Log.v(TAG, "kgm.isKeyguardLocked()="+kgm.isKeyguardLocked()
                        + ". kgm.isKeyguardSecure()="+kgm.isKeyguardSecure());
            } 
        } 
        // isKeyguardSecure excludes the slide lock case. 
        return (kgm != null) && kgm.isKeyguardLocked() && kgm.isKeyguardSecure();
    } 
} 
7
CodeRank
This code example shows how to use the following methods:newKeyguardLock
This code example shows how to use the following methods:newKeyguardLock

Related Android KeyguardManager Questions & Answers:

See Code Examples for Android KeyguardManager Methods: