summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/calendar/Utils.java9
-rw-r--r--src/com/android/calendar/alerts/AlertUtils.java6
2 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/calendar/Utils.java b/src/com/android/calendar/Utils.java
index fc409cd4..40a9e58d 100644
--- a/src/com/android/calendar/Utils.java
+++ b/src/com/android/calendar/Utils.java
@@ -207,6 +207,15 @@ public class Utils {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
}
+ /**
+ * Returns whether the SDK is the KeyLimePie release or later.
+ */
+ public static boolean isKeyLimePieOrLater() {
+ // TODO when SDK is set to 19, switch back to this:
+// return Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2;
+ return "KeyLimePie".equals(Build.VERSION.CODENAME);
+ }
+
public static int getViewTypeFromIntentAndSharedPref(Activity activity) {
Intent intent = activity.getIntent();
Bundle extras = intent.getExtras();
diff --git a/src/com/android/calendar/alerts/AlertUtils.java b/src/com/android/calendar/alerts/AlertUtils.java
index a082fdf7..fec7b111 100644
--- a/src/com/android/calendar/alerts/AlertUtils.java
+++ b/src/com/android/calendar/alerts/AlertUtils.java
@@ -88,7 +88,11 @@ public class AlertUtils {
return new AlarmManagerInterface() {
@Override
public void set(int type, long triggerAtMillis, PendingIntent operation) {
- mgr.set(type, triggerAtMillis, operation);
+ if (Utils.isKeyLimePieOrLater()) {
+ mgr.setExact(type, triggerAtMillis, operation);
+ } else {
+ mgr.set(type, triggerAtMillis, operation);
+ }
}
};
}