Code example for AudioManager

Methods: getMode

			// TODO: Do I need to put second call on hold when I answer one? 
			// Check for "second call" restriction 
			if (prefs.getBoolean("no_second_call", false))
				AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
				if (am.getMode() == AudioManager.MODE_IN_CALL)
			// Start tts service. 
			Intent ttsIntent = new Intent(context, TTSService.class);
			ttsIntent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, number);
			// Start autoAnswerIntentService. 
			context.startService(new Intent(context, AutoAnswerIntentService.class));
Stop searching for code, let great code find you!  Add Codota to your java IDE