History log of /packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3d09b483349d1436d8264243995d7d78f9021aa1 03-Mar-2017 Makoto Onuki <omakoto@google.com> Clean up CalendarProvider2

- Set RESULT_OK in the receiver properly.
- Don't create the provider instance in static; use a proper API for that.

Bug: 35938801
Test: adb shell am instrument -w com.android.providers.calendar.tests

Change-Id: I34eada3d9f14e9688c6af9899b4c69c367e1f6b1
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
88ce4c3299e915feebdf7fab788d091ccd2701d6 18-Feb-2017 Makoto Onuki <omakoto@google.com> Remove BG service from calendar provider.

The purpose of EmptyService was to keep the process running until
it sends a broadcast with a delay which is scheduled with a handler...

However "sending a broadcast with a delay" can just be done

Bug 35350114

Test: Manual tests with the verbose log enabled.
- adb shell setprop log.tag.CalendarProvider2 VERBOSE &&
adb shell am force-stop com.android.providers.calendar
- Then create/delete events on the calendar app and monitor
adb logcat | grep 'sendUpdateNotification'
- Then check the alarm and make sure PROVIDER_CHANGED is scheduled
at the right time.
adb shell dumpsys alarm | grep -A 4 -P 'ELAPSED.*com.android.providers.calendar'

Change-Id: Id2c0e10604bb7fdd3e9f8650295da83b3a62ecff
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
f26261b11e66435addeeb6c62978eb3fc767a4ec 10-Feb-2017 Makoto Onuki <omakoto@google.com> 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
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
ea1b82d2ab660a15659258da19fabe19e5d4fbd5 16-Jul-2015 Tony Mak <tonymak@google.com> Fix calendar reminder notification is not shown in idle state

M introduce "doze" which prevents alarm goes off when devices is in idle
state.

The solution is to use setExactAndAllowWhileIdle, however,
there is a restriction that we can only have one such an alarm within 15
mins during dozing.

Before explaining the changes, here is the brief introduction how reminder
notification works.
CalendarProvider send EVENT_REMINDER broadcast to notify calendar app
to show notification.
It sets two alarms, one to send this broadcast and set one another to
schedule the next coming reminder.
The scheduler alarm goes off one minute after the reminder alarm.

Here are the changes:
1.Due to the 15 min restriction, the current architecture is not working.
This commit removes the scheduler alarm.
CalendarProvider now listens for the EVENT_REMINDER broadcast and
schedule the next reminder immediately.

2. When there is no reminder within 1 day, CalendarProvider will setup
an alarm on the next day to start the scheduler again.
This alarm needs to goes off in idle state. But due to the 15 mins
restriction, now the time is set to 15 mins earlier.

3. Also remove SCHEDULE broadcast which is basically same as the
ACTION_CHECK_NEXT_ALARM broadcast.

4. ag/720759 make sure the reminder alarm goes off during dozing.

Please notice that even with this commit, we can't have more than
one reminder notification within 15 minutes due to the restriction
mentioned above.

Bug: 22182280

Change-Id: I950dab5595a98a26370f2cd8decf0b32d9363591
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
0ab307238107189b4717127b638e6c7dc9f988f1 30-Jul-2014 Jay Shrauner <shrauner@google.com> Fix stale db handle crash

Need to reacquire db handle before handling requests.
Fix NPEs when timezonetype isn't in the cache.

Bug:16559219
Change-Id: Ie037399aec91feb80312adf7c37d8d210b6aa544
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
0aeb094381148a08ae05c805f1c91a5c6b6e4900 19-Nov-2013 Alon Albert <aalbert@google.com> Merge "Ignore Wakelock Under-Locked Exception" into klp-dev
d46932bf3e0cc194ca8e6194a9f4e619b6bd009f 19-Nov-2013 Alon Albert <aalbert@google.com> Ignore Wakelock Under-Locked Exception

Bug: 11751204
Change-Id: I78d9e16ea83a06e1fe3e69b0d8a596d16da271f7
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
98e01573880a2f1b1547d1e2e9a1c5c7d5e09043 12-Nov-2013 Alon Albert <aalbert@google.com> Initialize WakeLock in the CTOR

Protect against possible race

Also added a log that will indicate if a second provider is created in the in
same process.

Bug: 11260491
Change-Id: I3048d3c57d1cf6a13b808b85151d20ddb85d95a9
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
74dfe7de007563af5cab1c1bb458f4ebd4e4f66d 19-Jul-2013 Christopher Tate <ctate@google.com> Make sure to use exact alarms for Calendar events

Change-Id: Idfe11d65c81999b76cbbe2611bb77816f0c8875a
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
49b7d3c4222a6b9e8e4639ba6d5128df5eac7e73 12-Oct-2012 Sara Ting <sarating@google.com> Fix race condition for missing alerts after boot up.

After boot up, it was possible to miss scheduling alerts due to improper synchronization of the BOOT_COMPLETED and TIME_CHANGED actions.

Bug:7221716
Change-Id: Id97266a19bb1ff8182576f687c34e10ef8644dc6
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
a7c3f329245dc370151e611fdad85e177f4f6000 27-Sep-2012 Sara Ting <sarating@google.com> Fix possible NPE in runScheduleNextAlarm.

Bug:7244877
Change-Id: Ifda7343cd154fc53a8b7e39fd747c3088f21a5eb
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
1d557af66e0ba44eae39a7bf3878cf256fd8f136 26-Oct-2011 Andy McFadden <fadden@android.com> Move scheduled alarm scrub off main thread

We currently do a database update when the "boot completed" intent
is received. Doing it on the main thread appears to be causing ANRs,
so this moves it to a background thread. An "empty" service is
used to discourage the system from killing the provider while this
is in progress.

Also, removed an unused field from CalendarAlarmManager.

Bug 5262151

Change-Id: I8e5b1bd7782500e1827f43d7a453f824a1e7944c
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
744fa975b40b24ea7377c0e273f60a7a4d47e2e0 30-Jun-2011 RoboErik <epastern@google.com> Updates for api comments

Change-Id: Idb9400d43b52664857ee78835ad1f4231eca7b75
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
b9644fe24edf9e25f0b21c1394e88d25070e0238 14-Jun-2011 RoboErik <epastern@google.com> Rename Calendar.java to CalendarContract.java

Change-Id: Iecdf0141d6baeed4a93b4f219a72f7ed8a5b9ff3
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
4067700dbedcf4c8a379c9ecba9b5603972b4607 19-Apr-2011 Andy McFadden <fadden@android.com> Update calendar database schema

This increases the version from 204 to 205, and includes these changes:
- rename+reorder "_sync_mark" to "sync6" (changing type from INTEGER to TEXT)
- rename "selected" to "visible"
- rename "organizerCanRespond" to "canOrganizerRespond"
- add "canModifyTimeZone"
- add "maxReminders"
- remove "_sync_local_id" (a/k/a _SYNC_DATA)

This CL will be accompanied by changes to:
frameworks/base
packages/apps/Calendar
packages/apps/Exchange
vendor/google
vendor/unbundled_google/packages/GoogleCalendarSyncAdapter

Change-Id: Idc82c26819432ac8756230a4fb0dd8165d255f27
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
420b7fb569773ae573fbe90c3a9c522d4c368863 23-Mar-2011 Erik <epastern@google.com> Refactor CP2 to move alarm code into CalendarAlarmManager

Change-Id: I07d8d028115ce21047afe9aeecb3bf9cc5f170be
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
656f9cb431c798c972260f31a4ebcd56047dff21 04-Nov-2010 Fabrice Di Meglio <fdimeglio@google.com> Simplify CalendarAlarmManager code and unit tests

- implement only the needed delegations to AlarmService
- MockCalendarAlarmManager is mocking all the CalendarAlarmManager methods

Change-Id: I6f97a9a133a2336a791beb9b25874cbbb05ac857
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java
e7a04f1fe637bc1322a6b4942e0251e3831cd544 03-Nov-2010 Fabrice Di Meglio <fdimeglio@google.com> Code refactoring for fixing unit tests and making CalendarProvider2 more testable

- refactoring for mocking the use of the Wake locks
- refactoring for mocking the use of the AlarmManager (introduce the CalendarAlarmManager)
- fix the unit tests
- fix bug 3122402

Change-Id: I5914ccf886612de260bc3c60fa192aad6c9887d2
/packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarAlarmManager.java