Use Java 8 date format in analytics.settings

Java 11 changed the default format for Date serialization which
affected files produced by Gson. Gson can deserialize dates in both
Java 8 and Java 9 formats, but only when run on Java 9+.

analytics.settings file is read by all versions of Android Studio. If
Java 9 format is used, this will break previous versions - some will
fail to start while others will start but analytics will not work.

With the fix applied, the older, Java 8 date format is used even on
Java 9+.

(cherry picked from commit d246e071a894e57e5a8be99fe21c263a7e8cf9a5)

Fixes: 156291868
Fixes: 165343136
Test: AnalyticsSettingsTest.useJava8DateFormat
Change-Id: I65b95a08a4ba3a7e73c755fb24e7aa74f9c60d91
2 files changed