Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae633b2d authored by Andy McFadden's avatar Andy McFadden
Browse files

Port EventRecurrence.parse() from native

This adds a Java-language implementation of EventRecurrence.parse(),
to make it easier to relocate it for the benefit of unbundled
Calendar.

Differences from the native version:

 - enforces that FREQ appears first
 - allows (but ignores) X-* parts
 - improved validation on various values
 - error messages are more specific
 - enforces that only one of UNTIL and COUNT may be present [disabled]
 - allows lower-case property and enumeration values [disabled]

As part of the transition process, both versions of the parser are
called on every request, and the results are compared.  If the results
are different a warning message is logged.

An unnecessary constructor was removed.

This also this moves some EventRecurrence tests out of CalendarProvider,
into coretests, and adds a simple parse test with the examples from
the RFC.

Bug 4575374

Change-Id: If737ed1272fda65c93363d87b2da12b85e644f5b
parent 93aa58fd
Loading
Loading
Loading
Loading
+605 −45

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ EventRecurrence_parse(JNIEnv* env, jobject This, jstring jstr)
 */
static JNINativeMethod METHODS[] = {
    /* name, signature, funcPtr */
    { "parse", "(Ljava/lang/String;)V", (void*)EventRecurrence_parse }
    { "parseNative", "(Ljava/lang/String;)V", (void*)EventRecurrence_parse }
};

static const char*const CLASS_NAME = "android/pim/EventRecurrence";
+753 −0

File added.

Preview size limit exceeded, changes collapsed.