Skip to content

Commit

Permalink
Revert "Minimize chance of race condition bug that misses alarms by c…
Browse files Browse the repository at this point in the history
…learing/rescheduling alarms." (Etar-Group#411)

This reverts commit 7087453.
  • Loading branch information
jspricke authored and Gitsaibot committed Dec 25, 2018
1 parent d913362 commit acb8d3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 81 deletions.
7 changes: 1 addition & 6 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.mail" />


Expand Down Expand Up @@ -226,12 +225,10 @@
<receiver android:name="com.android.calendar.alerts.AlertReceiver">
<intent-filter>
<action android:name="android.intent.action.EVENT_REMINDER" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.TIME_SET" />
<data android:scheme="content" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.LOCALE_CHANGED" />
</intent-filter>
Expand All @@ -251,8 +248,6 @@

<service android:name="com.android.calendar.alerts.SnoozeAlarmsService" />

<service android:name="com.android.calendar.alerts.InitAlarmsService" />

<!-- Declarations for the widget -->
<!--receiver android:name="com.android.calendar.widget.CalendarAppWidgetProvider" android:label="@string/gadget_title">
<intent-filter>
Expand Down
15 changes: 2 additions & 13 deletions src/com/android/calendar/alerts/AlertService.java
Original file line number Diff line number Diff line change
Expand Up @@ -946,19 +946,8 @@ void processMessage(Message msg) {
}

updateAlertNotification(this);
} else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
// The provider usually initiates this setting up of alarms on startup,
// but there was a bug (b/7221716) where a race condition caused this step to be
// skipped, resulting in missed alarms. This is a stopgap to minimize this bug
// for devices that don't have the provider fix, by initiating this a 2nd time here.
// However, it would still theoretically be possible to hit the race condition
// the 2nd time and still miss alarms.
//
// TODO: Remove this when the provider fix is rolled out everywhere.
Intent intent = new Intent();
intent.setClass(this, InitAlarmsService.class);
startService(intent);
} else if (action.equals(Intent.ACTION_TIME_CHANGED)) {
} else if (action.equals(Intent.ACTION_BOOT_COMPLETED)
|| action.equals(Intent.ACTION_TIME_CHANGED)) {
doTimeChanged();
} else if (action.equals(AlertReceiver.ACTION_DISMISS_OLD_REMINDERS)) {
dismissOldAlerts(this);
Expand Down
62 changes: 0 additions & 62 deletions src/com/android/calendar/alerts/InitAlarmsService.java

This file was deleted.

0 comments on commit acb8d3f

Please sign in to comment.