Snap for 5533215 from ba910b3fb28d9de6584f86e6549e314a6c0f6b34 to rvc-release
Change-Id: I437605f72ec8dfed87e522f57a534a0347049cd1
diff --git a/src/com/android/providers/calendar/CalendarAlarmManager.java b/src/com/android/providers/calendar/CalendarAlarmManager.java
index 7019797..e64cac2 100644
--- a/src/com/android/providers/calendar/CalendarAlarmManager.java
+++ b/src/com/android/providers/calendar/CalendarAlarmManager.java
@@ -181,7 +181,7 @@
// Trigger the check in 5s from now, so that we can have batch processing.
long triggerAtTime = SystemClock.elapsedRealtime() + ALARM_CHECK_DELAY_MILLIS;
// Given to the short delay, we just use setExact here.
- setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAtTime, pending);
+ setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAtTime, pending);
}
}
@@ -482,6 +482,10 @@
mAlarmManager.set(type, triggerAtTime, operation);
}
+ public void setAndAllowWhileIdle(int type, long triggerAtTime, PendingIntent operation) {
+ mAlarmManager.setAndAllowWhileIdle(type, triggerAtTime, operation);
+ }
+
public void setExact(int type, long triggerAtTime, PendingIntent operation) {
mAlarmManager.setExact(type, triggerAtTime, operation);
}
diff --git a/src/com/android/providers/calendar/CalendarProvider2.java b/src/com/android/providers/calendar/CalendarProvider2.java
index b5783fd..e6cf42b 100644
--- a/src/com/android/providers/calendar/CalendarProvider2.java
+++ b/src/com/android/providers/calendar/CalendarProvider2.java
@@ -4804,14 +4804,16 @@
Log.d(TAG, "sendUpdateNotification: delay=" + delay);
}
- mCalendarAlarm.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + delay,
+ mCalendarAlarm.setAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+ SystemClock.elapsedRealtime() + delay,
PendingIntent.getBroadcast(mContext, 0, createProviderChangedBroadcast(),
PendingIntent.FLAG_UPDATE_CURRENT));
}
private Intent createProviderChangedBroadcast() {
return new Intent(Intent.ACTION_PROVIDER_CHANGED, CalendarContract.CONTENT_URI)
- .addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
+ .addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING)
+ .addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
}
private static final int TRANSACTION_QUERY = 0;