Code example for KeyguardManager

Methods: newKeyguardLock

0
 
    private KeyguardLock getLock(Context context) {
        if (lock == null) {
            KeyguardManager keyguardManager = (KeyguardManager) context
                    .getSystemService(Activity.KEYGUARD_SERVICE);
            lock = keyguardManager.newKeyguardLock(Context.KEYGUARD_SERVICE);
        } 
        return lock;
    } 
 
    public void updateState(Context context, SharedPreferences globalPreferences, int[] appWidgetIds) {
        getState(context);
        if (lockScreen == null) {
            currentIcon = R.drawable.ic_appwidget_settings_lock_screen_off; 
            currentState = SettingsAppWidgetProvider.STATE_INTERMEDIATE; 
        } else if (lockScreen) {
            currentIcon = R.drawable.ic_appwidget_settings_lock_screen_on; 
            currentState = SettingsAppWidgetProvider.STATE_ENABLED; 
        } else { 
            currentIcon = R.drawable.ic_appwidget_settings_lock_screen_off; 
Experience pair programming with AI  Get Codota for Java