Handle empty tag for EAS 14 event reminder

* EAS < 14 doesn't send a tag when there's no reminder; EAS 14
  sends an empty tag, which we interpret as 0 minutes
* Fix is to detect the empty tag and not create a reminder in this
  case

Bug: 5848662
Change-Id: Id7a8e1d4b4c72e1456e15a1a209cbf60586f9f84
diff --git a/src/com/android/exchange/adapter/CalendarSyncAdapter.java b/src/com/android/exchange/adapter/CalendarSyncAdapter.java
index b467eb7..df15c15 100644
--- a/src/com/android/exchange/adapter/CalendarSyncAdapter.java
+++ b/src/com/android/exchange/adapter/CalendarSyncAdapter.java
@@ -545,9 +545,14 @@
                         organizerName = getValue();
                         break;
                     case Tags.CALENDAR_REMINDER_MINS_BEFORE:
+                        // Save away whether this tag has content; Exchange 2010 sends an empty tag
+                        // rather than not sending one (as with Ex07 and Ex03)
+                        boolean hasContent = !noContent;
                         reminderMins = getValueInt();
-                        ops.newReminder(reminderMins);
-                        cv.put(Events.HAS_ALARM, 1);
+                        if (hasContent) {
+                            ops.newReminder(reminderMins);
+                            cv.put(Events.HAS_ALARM, 1);
+                        }
                         break;
                     // The following are fields we should save (for changes), though they don't
                     // relate to data used by CalendarProvider at this point
diff --git a/src/com/android/exchange/adapter/Parser.java b/src/com/android/exchange/adapter/Parser.java
index fe25751..d24e6c1 100644
--- a/src/com/android/exchange/adapter/Parser.java
+++ b/src/com/android/exchange/adapter/Parser.java
@@ -99,7 +99,7 @@
     public String name;
 
     // Whether the current tag is associated with content (a value)
-    private boolean noContent;
+    public boolean noContent;
 
     // The value read, as a String.  Only one of text or num will be valid, depending on whether the
     // value was requested as a String or an int (to avoid wasted effort in parsing)