Before trying bug fix

This commit is contained in:
Phillip Hsu
2016-06-05 19:58:27 -07:00
parent 53d5eed670
commit f67c5e5bb5
4 changed files with 44 additions and 7 deletions
@@ -4,6 +4,7 @@ import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.philliphsu.clock2.Alarm;
import com.philliphsu.clock2.UpcomingAlarmReceiver;
@@ -24,10 +25,12 @@ import static com.philliphsu.clock2.util.Preconditions.checkNotNull;
* TODO: Adapt this to Timers too...
*/
public final class AlarmUtils {
private static final String TAG = "AlarmUtils";
private AlarmUtils() {}
public static void scheduleAlarm(Context context, Alarm alarm) {
Log.d(TAG, "Scheduling alarm " + alarm);
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
// If there is already an alarm for this Intent scheduled (with the equality of two
// intents being defined by filterEquals(Intent)), then it will be removed and replaced