Code example for KeyguardManager

Methods: inKeyguardRestrictedInputMode

0
        if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
            //screenOff = true; 
            SoundManager.pauseBackgroundMusic(); 
        } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
        	KeyguardManager keyguardManager = (KeyguardManager)context.getSystemService(Activity.KEYGUARD_SERVICE);  
        	boolean bloccoSchermoAttivo = keyguardManager.inKeyguardRestrictedInputMode();
            //screenOff = false; 
        	if(!bloccoSchermoAttivo && !ActivityHelper.isApplicationBroughtToBackground(context)) {
	        	String activityName = ActivityHelper.getTopActivityClassNameWithPackage(context);
	        	//Log.d(TAG,DrawChallengeActivity.class.getName()); 
	        	if(!DrawChallengeActivity.class.getName().equalsIgnoreCase(activityName)) {
	        		if(!SoundManager.isBackgroundMusicPlaying()) { 
	        			SoundManager.playBackgroundMusic(context);
	        		} 
	        	}else { 
	        		//Durante il gioco ci sarà la musica? 
	        		/* 
	        		if(!SoundManager.isBackgroundMusicPlaying()) { 
	        			SoundManager.playBackgroundMusic(context); 
	        		} 
	        		*/