summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Katzenelson <isaackatz@google.com>2013-09-03 14:56:26 -0700
committerIsaac Katzenelson <isaackatz@google.com>2013-09-04 18:15:51 -0700
commit8db042db004353b4eca8e9c0a063b3f451177b80 (patch)
treeaeffd24e01f7403ea3e17c6f4d86da2b45a2632e
parent8acfdb15c256d8e55f50b8f571340ebcdf44c5fa (diff)
downloadCalendar-8db042db004353b4eca8e9c0a063b3f451177b80.tar.gz
Use setExact on K and up only.
Bug: 9926186 Change-Id: Ib81c56b01f1c28f811c0e96582582c4bb5d32c37
-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 744716d9..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.setExact(type, triggerAtMillis, operation);
+ if (Utils.isKeyLimePieOrLater()) {
+ mgr.setExact(type, triggerAtMillis, operation);
+ } else {
+ mgr.set(type, triggerAtMillis, operation);
+ }
}
};
}