aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang/kau/email
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-10-08 01:46:36 -0400
committerGitHub <noreply@github.com>2018-10-08 01:46:36 -0400
commit19020070cc073c81bfe397454f2314d37a78ed31 (patch)
tree7cebfa93ec8f8b465608579744b34be0aed0b1cc /core/src/main/kotlin/ca/allanwang/kau/email
parent81518f74fa76b6c2274a0e02ad4169f5d7f61e59 (diff)
downloadkau-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.kt7
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" }
}