DateUtils.parse not RFC 822 compliant

App version: x.y.z (state whether from Google Play/F-Droid/Custom built APK)
Source of problematic file of current revision:

Android version: 5.x (Please mention if you are using a custom rom!)
irrelevant

Device model:
irrelevant

Expected behaviour:
The datetime parser (DateUtils.parse) parses datetime strings compliant with RFC 822.

Current behaviour:
Date parsing does not work if the time zone is given by “Z”. Note that this is compliant with the date format given by RFC 822 (RFC 822: Standard for the Format of Arpa Internet Text Messages).

Possible solutions:
One solution would be to also add patterns for the other possible timezone formats.
Note that the Java documentation is misleading as it claims that “Z” (the pattern) is for RFC 822 timezones when clearly it is not.

For instance, the string “Fri, 27 Dec 2024 13:52:59 Z” can be parsed by the pattern “EEE, dd MMM yyyy HH:mm:ss X”.

First occurred: (e.g. about x days/weeks ago)
irrelevant

Steps to reproduce:

  1. Call DateUtils.parse("Fri, 27 Dec 2024 13:52:59 Z")
  2. See that it fails.

Environment: (Settings you have changed (e.g. Auto Download). “Unusual” devices you use (e.g. Bluetooth headphones). Did you select another media player?)

Stacktrace/Logcat:

[if available]