Back to project page Tacere.
The source code is released under:
MIT License
If you think the Android project Tacere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (c) 2014 Jonathan Nelson/* w w w . java 2s.com*/ * Released under the BSD license. For details see the COPYING file. */ package org.ciasaboark.tacere.service; import android.app.IntentService; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import org.ciasaboark.tacere.database.DatabaseInterface; import org.ciasaboark.tacere.event.ringer.RingerType; import org.ciasaboark.tacere.manager.AlarmManagerWrapper; public class SkipEventService extends IntentService { public static final String EVENT_ID_TAG = "eventId"; private static final String TAG = "SkipEventService"; public SkipEventService() { super(TAG); } @Override protected void onHandleIntent(Intent intent) { Log.d(TAG, "waking"); Context ctx = getApplicationContext(); if (intent.getExtras() != null) { Bundle b = intent.getExtras(); long eventId = b.getLong(EVENT_ID_TAG, -1); if (eventId != -1) { DatabaseInterface dbIface = DatabaseInterface.getInstance(ctx); dbIface.setRingerForInstance(eventId, RingerType.IGNORE); AlarmManagerWrapper alarmManagerWrapper = new AlarmManagerWrapper(ctx); alarmManagerWrapper.scheduleImmediateAlarm(RequestTypes.NORMAL); } } } }