diff options
author | Allan Wang <me@allanwang.ca> | 2018-10-08 01:46:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 01:46:36 -0400 |
commit | 19020070cc073c81bfe397454f2314d37a78ed31 (patch) | |
tree | 7cebfa93ec8f8b465608579744b34be0aed0b1cc /core/src/main/kotlin/ca/allanwang/kau/email | |
parent | 81518f74fa76b6c2274a0e02ad4169f5d7f61e59 (diff) | |
download | kau-19020070cc073c81bfe397454f2314d37a78ed31.tar.gz kau-19020070cc073c81bfe397454f2314d37a78ed31.tar.bz2 kau-19020070cc073c81bfe397454f2314d37a78ed31.zip |
Enhancement/kpref (#170)
* Deprecate kpref double
* Update kpref tests and migration
* Fix kpref file
* Update changelog
* Replace changelog angle brackets
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/email')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt index 804eacb..dbdcf09 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt @@ -69,9 +69,14 @@ class EmailBuilder(val email: String, val subject: String) { if (appInfo) { try { val appInfo = context.packageManager.getPackageInfo(context.packageName, 0) + val versionCode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + appInfo.longVersionCode.toString() + } else { + appInfo.versionCode.toString() + } emailBuilder.append("\nApp: ").append(context.packageName) .append("\nApp Version Name: ").append(appInfo.versionName) - .append("\nApp Version Code: ").append(appInfo.versionCode).append("\n") + .append("\nApp Version Code: ").append(versionCode).append("\n") } catch (e: PackageManager.NameNotFoundException) { KL.e { "EmailBuilder packageInfo not found" } } |