summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/calendar/CalendarAlarmManager.java
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2017-02-09 16:56:51 -0800
committerMakoto Onuki <omakoto@google.com>2017-02-09 17:00:38 -0800
commitf26261b11e66435addeeb6c62978eb3fc767a4ec (patch)
treefa08dbc79c3c87c447ad9de8793139d685b943cf /src/com/android/providers/calendar/CalendarAlarmManager.java
parent7c018bc1d64f767e04be6ea026e3886eb9267ce0 (diff)
downloadandroid_packages_providers_CalendarProvider-f26261b11e66435addeeb6c62978eb3fc767a4ec.tar.gz
android_packages_providers_CalendarProvider-f26261b11e66435addeeb6c62978eb3fc767a4ec.tar.bz2
android_packages_providers_CalendarProvider-f26261b11e66435addeeb6c62978eb3fc767a4ec.zip
Stop using IntentService and use async receiver.
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: Ib3afd744c5b94522d08778c367641d7c8f444a1f
Diffstat (limited to 'src/com/android/providers/calendar/CalendarAlarmManager.java')
-rw-r--r--src/com/android/providers/calendar/CalendarAlarmManager.java31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/com/android/providers/calendar/CalendarAlarmManager.java b/src/com/android/providers/calendar/CalendarAlarmManager.java
index ac14713..adb98c4 100644
--- a/src/com/android/providers/calendar/CalendarAlarmManager.java
+++ b/src/com/android/providers/calendar/CalendarAlarmManager.java
@@ -127,10 +127,6 @@ public class CalendarAlarmManager {
*/
@VisibleForTesting
protected Object mAlarmLock;
- /**
- * Used to keep the process from getting killed while scheduling alarms
- */
- private final WakeLock mScheduleNextAlarmWakeLock;
@VisibleForTesting
protected Context mContext;
@@ -141,14 +137,6 @@ public class CalendarAlarmManager {
PowerManager powerManager = (PowerManager) mContext.getSystemService(
Context.POWER_SERVICE);
- // Create a wake lock that will be used when we are actually
- // scheduling the next alarm
- mScheduleNextAlarmWakeLock = powerManager.newWakeLock(
- PowerManager.PARTIAL_WAKE_LOCK, SCHEDULE_NEXT_ALARM_WAKE_LOCK);
- // We want the Wake Lock to be reference counted (so that we dont
- // need to take care
- // about its reference counting)
- mScheduleNextAlarmWakeLock.setReferenceCounted(true);
}
protected void initializeWithContext(Context context) {
@@ -229,25 +217,6 @@ public class CalendarAlarmManager {
setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, triggerTimeMillis, pending);
}
- PowerManager.WakeLock getScheduleNextAlarmWakeLock() {
- return mScheduleNextAlarmWakeLock;
- }
-
- void acquireScheduleNextAlarmWakeLock() {
- getScheduleNextAlarmWakeLock().acquire();
- }
-
- void releaseScheduleNextAlarmWakeLock() {
- try {
- getScheduleNextAlarmWakeLock().release();
- } catch (RuntimeException e) {
- if (!e.getMessage().startsWith("WakeLock under-locked ")) {
- throw e;
- }
- Log.w(TAG, "WakeLock under-locked ignored.");
- }
- }
-
void rescheduleMissedAlarms() {
rescheduleMissedAlarms(mContext.getContentResolver());
}