diff options
author | Isaac Katzenelson <isaackatz@google.com> | 2013-09-03 14:56:26 -0700 |
---|---|---|
committer | Isaac Katzenelson <isaackatz@google.com> | 2013-09-03 14:56:26 -0700 |
commit | e8305d6e1674bcc7cdb4e99e50f48fbcfd23d4db (patch) | |
tree | 505fc8ee46453fc2c8a2193bbff30e31bbfa0cd2 /src/com/android/calendar | |
parent | 11698040ff0ce6692a8670e447e4aa80492c7946 (diff) | |
download | android_packages_apps_Calendar-e8305d6e1674bcc7cdb4e99e50f48fbcfd23d4db.tar.gz android_packages_apps_Calendar-e8305d6e1674bcc7cdb4e99e50f48fbcfd23d4db.tar.bz2 android_packages_apps_Calendar-e8305d6e1674bcc7cdb4e99e50f48fbcfd23d4db.zip |
Use setExact on K and up only.
Bug: 9926186
Change-Id: Ib81c56b01f1c28f811c0e96582582c4bb5d32c37
Diffstat (limited to 'src/com/android/calendar')
-rw-r--r-- | src/com/android/calendar/Utils.java | 9 | ||||
-rw-r--r-- | src/com/android/calendar/alerts/AlertUtils.java | 6 |
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); + } } }; } |