Skip to content

Commit eb97d9b

Browse files
committed
Fixed a crash on some Android 8 and 8.1 devices when accessing TimeZone information
1 parent 40c0565 commit eb97d9b

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
2-
All notable changes to this project will be documented in this file.
2+
All notable changes to this project will be documented in this file.
3+
4+
## [0.10.6]
5+
6+
### Fixed
7+
- Fixed a crash on some Android 8 and 8.1 devices when updating the ProductDatabase
38

49
## [0.10.5]
510

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ allprojects {
2424
}
2525

2626
project.ext {
27-
sdkVersion='0.10.5'
27+
sdkVersion='0.10.6'
2828
versionCode=1
2929

3030
compileSdkVersion=28

core/src/main/java/io/snabble/sdk/ProductDatabase.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,19 @@ private void parseLastUpdateTimestamp() {
230230

231231
void updateLastUpdateTimestamp(long timestamp) {
232232
putMetaData(METADATA_KEY_LAST_UPDATE_TIMESTAMP, String.valueOf(timestamp));
233-
lastUpdateDate = new Date(timestamp);
234-
Logger.d("Updating last update timestamp: %s", lastUpdateDate.toString());
233+
234+
try {
235+
lastUpdateDate = new Date(timestamp);
236+
Logger.d("Updating last update timestamp: %s", lastUpdateDate.toString());
237+
} catch (AssertionError e) {
238+
// Some Android 8 and 8.1 builds are faulty and throw an AssertionError when
239+
// accessing time zone information
240+
//
241+
// Since this is only used for logging and we are fine with catching the error
242+
// and not providing an alternative implementation
243+
//
244+
// see https://issuetracker.google.com/issues/110848122
245+
}
235246
}
236247

237248
/**

0 commit comments

Comments
 (0)