You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/flipcash/features/scanner/src/main/kotlin/com/flipcash/app/scanner/internal/bills/BillContainerView.kt
Copy file name to clipboardExpand all lines: apps/flipcash/shared/appupdates/src/main/kotlin/com/flipcash/app/updates/internal/GooglePlayAppUpdateController.kt
+27-7Lines changed: 27 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,21 @@ class GooglePlayAppUpdateController @Inject constructor(
47
47
tag ="App Updates",
48
48
message ="Checking for available updates"
49
49
)
50
+
51
+
val minimumVersionFromServer = userManager.userFlags?.minimumVersion ?:Int.MIN_VALUE
52
+
53
+
if (versionInfo.versionCode >= minimumVersionFromServer) {
54
+
trace(
55
+
tag ="App Updates",
56
+
message ="Forced update is not required: ${versionInfo.versionCode} >= $minimumVersionFromServer",
57
+
metadata = {
58
+
"current version" to versionInfo.versionCode
59
+
"minimum version" to minimumVersionFromServer
60
+
}
61
+
)
62
+
return
63
+
}
64
+
50
65
val task = appUpdateManager.appUpdateInfo
51
66
52
67
task.addOnSuccessListener { update ->
@@ -66,22 +81,27 @@ class GooglePlayAppUpdateController @Inject constructor(
66
81
rawAppUpdateInfo = update
67
82
)
68
83
69
-
val minimumVersionFromServer = userManager.userFlags?.minimumVersion ?:Int.MIN_VALUE
84
+
_availableUpdate.update { availableUpdate }
70
85
71
-
if (versionInfo.versionCode >= minimumVersionFromServer) {
86
+
if (availableUpdate.availableVersionCode > versionInfo.versionCode) {
72
87
trace(
73
88
tag ="App Updates",
74
-
message ="Forced update is not required",
89
+
message ="New update available",
75
90
metadata = {
76
91
"current version" to versionInfo.versionCode
77
-
"minimum version" to minimumVersionFromServer
92
+
"available version" to availableUpdate.availableVersionCode
93
+
"update priority" to update.updatePriority()
94
+
"bytes downloaded" to update.bytesDownloaded()
95
+
"total bytes to download" to update.totalBytesToDownload()
78
96
}
79
97
)
80
-
return@addOnSuccessListener
98
+
} else {
99
+
trace(
100
+
tag ="App Updates",
101
+
message ="No new update available: ${versionInfo.versionCode} - ${availableUpdate.availableVersionCode}"
102
+
)
81
103
}
82
104
83
-
_availableUpdate.update { availableUpdate }
84
-
85
105
if (update.updateAvailability() ==UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS) {
86
106
// in-app update is already in progress, resume it
0 commit comments