Back to project page silent-meeting.
The source code is released under:
GNU General Public License
If you think the Android project silent-meeting listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.bensproule.silentmeeting.receiver; /* w w w . j a v a 2 s . c o m*/ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.media.AudioManager; import android.util.Log; import uk.co.bensproule.silentmeeting.constants.Extra; import uk.co.bensproule.silentmeeting.constants.Setting; import uk.co.bensproule.silentmeeting.dao.InstanceDao; public class UnmutePhoneBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { boolean active = Setting.getActive(context); if (active) { int previousRingerMode = intent.getIntExtra(Extra.PREVIOUS_RINGER_MODE, AudioManager.RINGER_MODE_NORMAL); int instanceId = intent.getIntExtra(Extra.INSTANCE_ID, 0); Log.d("SilencePhone", "Unmuting phone"); AudioManager audio = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); audio.setRingerMode(previousRingerMode); InstanceDao instanceDao = new InstanceDao(context); instanceDao.delete(instanceId); } } }