From 14354839f327103a65a51d79d69ceff83b1ec2b6 Mon Sep 17 00:00:00 2001 From: Meno Hochschild Date: Mon, 20 Apr 2020 03:47:21 +0200 Subject: [PATCH] version update including debug infos --- CHANGELOG.md | 6 +- NOTICE | 2 +- README.md | 2 +- time4j-android/build.gradle | 6 +- .../time4j/android/ApplicationStarter.java | 85 ++++++++++--------- 5 files changed, 54 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be75ced..399e634 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,16 @@ ## [v4.5-2020a] not yet released + +## [v4.4.5-2019c] published on 2020-04-20 ### Added - Make PatternType.CLDR_DATE being applicable on PlainDate [#889] ### Fixed -- Crash during app initialization (rare case) [#894] +- Crash during app initialization (rare case) [#894 + #897] - Incorrect sign in last term of calculation of mean lunar anomaly [#891] ## [v4.4.4-2019c] published on 2020-01-15 ### Changed -- Update of Android version dependencies +- Update of Android version dependencies [PR #2] ## [v4.4.3-2019c] published on 2019-11-04 ### Added diff --git a/NOTICE b/NOTICE index 91be515..1660d63 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Time4A Code -Copyright 2018-2019 Meno Hochschild +Copyright 2018-2020 Meno Hochschild This product includes software derived from the Time4J-project (https://github.com/MenoData/Time4J/). diff --git a/README.md b/README.md index bc811a6..e2fd2b1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Only two steps are required before coding against the API of Time4A. ```groovy dependencies { - implementation group: 'net.time4j', name: 'time4j-android', version: '4.4.4-2019c' + implementation group: 'net.time4j', name: 'time4j-android', version: '4.4.5-2019c' } ``` diff --git a/time4j-android/build.gradle b/time4j-android/build.gradle index ff5ec98..38c4cf6 100644 --- a/time4j-android/build.gradle +++ b/time4j-android/build.gradle @@ -13,7 +13,7 @@ ext { siteUrl = 'https://github.com/menodata/Time4A' gitUrl = 'https://github.com/menodata/Time4A.git' - libraryVersion = '4.4.4-2019c' + libraryVersion = '4.4.5-2019c' developerId = 'mhochschild' developerName = 'Meno Hochschild' @@ -26,8 +26,8 @@ ext { gradle.projectsEvaluated { tasks.withType(JavaCompile) { - options.debug = false - options.debugOptions.debugLevel = "source" + options.debug = true + options.debugOptions.debugLevel = "source,lines" options.compilerArgs << "-Xlint:deprecation" } } diff --git a/time4j-android/src/main/java/net/time4j/android/ApplicationStarter.java b/time4j-android/src/main/java/net/time4j/android/ApplicationStarter.java index 4d8fcf0..7957c76 100644 --- a/time4j-android/src/main/java/net/time4j/android/ApplicationStarter.java +++ b/time4j-android/src/main/java/net/time4j/android/ApplicationStarter.java @@ -63,10 +63,10 @@ public class ApplicationStarter { //~ Statische Felder/Initialisierungen -------------------------------- - private static final String VERSION = "v4.4.4-2019c"; + private static final String VERSION = "v4.4.5-2019c"; private static final int RELEASE_YEAR = 2020; - private static final int RELEASE_MONTH = 1; - private static final int RELEASE_DAY = 15; + private static final int RELEASE_MONTH = 4; + private static final int RELEASE_DAY = 20; private static final String TIME4A = "TIME4A"; private static final AtomicBoolean PREPARED = new AtomicBoolean(false); @@ -119,43 +119,7 @@ public static void initialize( initialize( context, - prefetch - ? new Runnable() { - @Override - public void run() { - long start2 = System.nanoTime(); - int offset = - TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000; - TZID tzid = ZonalOffset.ofTotalSeconds(offset); - Locale sysloc = Locale.getDefault(); - DisplayMode style = DisplayMode.FULL; - try { - Moment moment = SystemClock.currentMoment(); - tzid = Timezone.ofSystem().getID(); - Log.i(TIME4A, "System time zone at start: [" + tzid.canonical() + "]"); - Log.i(TIME4A, "System locale at start: [" + sysloc.toString() + "]"); - String currentTime = - ChronoFormatter.ofMomentStyle( - style, - style, - sysloc, - tzid - ).format(moment); - Log.i(TIME4A, currentTime); - } catch (Throwable thr) { - Log.e( - TIME4A, - "Error on prefetch thread with: time zone=" - + tzid.canonical() - + ", locale=" + sysloc + "!", - thr); - throw new IllegalStateException(thr); // rethrow for Google Play Store etc. - } - long delta = (System.nanoTime() - start2) / 1000000; - Log.i(TIME4A, "Prefetch thread consumed (in ms): " + delta); - } - } - : null + prefetch ? new StdPrefetch() : null ); } @@ -305,4 +269,45 @@ public void onReceive(Context context, Intent intent) { } + private static class StdPrefetch + implements Runnable { + + //~ Methoden ------------------------------------------------------ + + @Override + public void run() { + long start2 = System.nanoTime(); + int offset = TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000; + TZID tzid = ZonalOffset.ofTotalSeconds(offset); + Locale sysloc = Locale.getDefault(); + + try { + Moment moment = SystemClock.currentMoment(); + tzid = Timezone.ofSystem().getID(); + Log.i(TIME4A, "System time zone at start: [" + tzid.canonical() + "]"); + Log.i(TIME4A, "System locale at start: [" + sysloc.toString() + "]"); + String currentTime = + ChronoFormatter.ofMomentStyle( + DisplayMode.FULL, + DisplayMode.FULL, + sysloc, + tzid + ).format(moment); + Log.i(TIME4A, currentTime); + } catch (Throwable thr) { + Log.e( + TIME4A, + "Error on prefetch thread with: time zone=" + + tzid.canonical() + + ", locale=" + sysloc + "!", + thr); + throw new IllegalStateException(thr); // rethrow for Google Play Store etc. + } + + long delta = (System.nanoTime() - start2) / 1000000; + Log.i(TIME4A, "Prefetch thread consumed (in ms): " + delta); + } + + } + }