From b63830a7241a0bb9cb7b3d512138713449b62af2 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Thu, 9 Feb 2017 17:06:28 -0800 Subject: [PATCH] Stop using IntentService and use async receiver (2/2 - contract) Also: - Set FLAG_RECEIVER_INCLUDE_BACKGROUND for ACTION_EVENT_REMINDER - Remove the wake lock; with goAsync() now it's not needed. Test: Manual test with: adb shell am broadcast --receiver-include-background -a android.intent.action.EVENT_REMINDER -d content: Bug 35207106 Change-Id: I9e456f473f13b71df6e0dd1a1abdb0df8c26e6c7 --- core/java/android/provider/CalendarContract.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java index aa22041d27775..d9ce57af8c01f 100644 --- a/core/java/android/provider/CalendarContract.java +++ b/core/java/android/provider/CalendarContract.java @@ -2392,6 +2392,7 @@ public final class CalendarContract { Intent intent = new Intent(ACTION_EVENT_REMINDER); intent.setData(ContentUris.withAppendedId(CalendarContract.CONTENT_URI, alarmTime)); intent.putExtra(ALARM_TIME, alarmTime); + intent.setFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0); manager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, alarmTime, pi); }