Respect the RESPONSE_REQUESTED tag in meeting invite mail

Bug: 2639037
Change-Id: I4bd73f23ba270fa0ead72971b5a79d9db678a8dd
diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java
index 51707e6..a541ab0 100644
--- a/src/com/android/exchange/EasSyncService.java
+++ b/src/com/android/exchange/EasSyncService.java
@@ -1182,6 +1182,15 @@
             InputStream is = res.getEntity().getContent();
             if (len != 0) {
                 new MeetingResponseParser(is, this).parse();
+                String meetingInfo = msg.mMeetingInfo;
+                if (meetingInfo != null) {
+                    String responseRequested =
+                        new PackedString(meetingInfo).get(MeetingInfo.MEETING_RESPONSE_REQUESTED);
+                    // If there's no tag, or a non-zero tag, we send the response mail
+                    if ("0".equals(responseRequested)) {
+                        return;
+                    }
+                }
                 sendMeetingResponseMail(msg, req.mResponse);
             }
         } else if (isAuthError(status)) {
diff --git a/src/com/android/exchange/adapter/EmailSyncAdapter.java b/src/com/android/exchange/adapter/EmailSyncAdapter.java
index 055abfa..de312a3 100644
--- a/src/com/android/exchange/adapter/EmailSyncAdapter.java
+++ b/src/com/android/exchange/adapter/EmailSyncAdapter.java
@@ -368,6 +368,9 @@
                     case Tags.EMAIL_RECURRENCES:
                         recurrencesParser();
                         break;
+                    case Tags.EMAIL_RESPONSE_REQUESTED:
+                        packedString.put(MeetingInfo.MEETING_RESPONSE_REQUESTED, getValue());
+                        break;
                     default:
                         skipTag();
                 }