fansonfong / funf-open-sensing-framework

Automatically exported from code.google.com/p/funf-open-sensing-framework
0 stars 0 forks source link

Pipeline alarms can get canceled, and never created again #78

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Alarms are getting cancelled in the pipeline and then not properly created:

Faulty code is here
private void cancelAlarm(String action) {
        Intent i = new Intent(this, getClass());
        i.setAction(action);
        PendingIntent pi = PendingIntent.getService(this, 0, i, PendingIntent.FLAG_NO_CREATE);
        if (pi != null) {
            AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
            alarmManager.cancel(pi);
            pi.cancel();  // <---- THIS IS NOT BEING DONE
        }
    }

Original issue reported on code.google.com by alan.gar...@gmail.com on 26 Jan 2012 at 6:09