FileDocCategorySizeDatePackage
DismissAllAlarmsService.javaAPI DocAndroid 1.5 API2146Wed May 06 22:42:42 BST 2009com.android.calendar

DismissAllAlarmsService

public class DismissAllAlarmsService extends android.app.IntentService
Service for asynchronously marking all fired alarms as dismissed.

Fields Summary
private static final String[]
PROJECTION
private static final int
COLUMN_INDEX_STATE
Constructors Summary
public DismissAllAlarmsService()

  

      
        super("DismissAllAlarmsService");
    
Methods Summary
public android.os.IBinderonBind(android.content.Intent intent)

        return null;
    
public voidonHandleIntent(android.content.Intent intent)

        // Mark all fired alarms as dismissed
        Uri uri = CalendarAlerts.CONTENT_URI_BY_INSTANCE;
        String selection = CalendarAlerts.STATE + "=" + CalendarAlerts.FIRED;
        ContentResolver resolver = getContentResolver();
        Cursor cursor = resolver.query(uri, PROJECTION, selection, null, null);
        if (cursor != null) {
            cursor.moveToPosition(-1);
            while (cursor.moveToNext()) {
                cursor.updateInt(COLUMN_INDEX_STATE, CalendarAlerts.DISMISSED);
            }
            cursor.commitUpdates();
            cursor.close();
        }

        // Stop this service
        stopSelf();