mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-10 16:02:25 +01:00
usage notes: say which boxes are ticked, so the server can drop details from unticked ones
This commit is contained in:
1 parent
3855cc4781
commit
2891a170db
1 file changed
+11
@@ -88,6 +88,9 @@ object UsageStats {
|
|||||||
.putBoolean("share_phone", choices.phone)
|
.putBoolean("share_phone", choices.phone)
|
||||||
.putBoolean("share_cars", choices.cars)
|
.putBoolean("share_cars", choices.cars)
|
||||||
.putBoolean("share_failures", choices.failures)
|
.putBoolean("share_failures", choices.failures)
|
||||||
|
// The server drops details from a box once it's unticked, so the next note sends
|
||||||
|
// them again rather than assuming the server still has them.
|
||||||
|
.remove(KEY_SENT_DETAILS)
|
||||||
.apply()
|
.apply()
|
||||||
// Turning it on sends nothing yet: the driver may still be ticking boxes. The first note
|
// Turning it on sends nothing yet: the driver may still be ticking boxes. The first note
|
||||||
// waits for [choicesClosed].
|
// waits for [choicesClosed].
|
||||||
@@ -251,6 +254,14 @@ object UsageStats {
|
|||||||
.put("version", BuildConfig.VERSION_NAME)
|
.put("version", BuildConfig.VERSION_NAME)
|
||||||
.put("code", BuildConfig.VERSION_CODE)
|
.put("code", BuildConfig.VERSION_CODE)
|
||||||
.put("build", if (BuildConfig.DEBUG) "dev" else "release")
|
.put("build", if (BuildConfig.DEBUG) "dev" else "release")
|
||||||
|
// Which boxes are ticked, so the server knows what this phone shares and can drop
|
||||||
|
// anything it kept from a box since unticked.
|
||||||
|
.put("shares", JSONArray().apply {
|
||||||
|
if (c.android) put("android")
|
||||||
|
if (c.phone) put("phone")
|
||||||
|
if (c.cars) put("cars")
|
||||||
|
if (c.failures) put("sessions")
|
||||||
|
})
|
||||||
// Phone details change rarely, so they ride along only when they differ from what the
|
// Phone details change rarely, so they ride along only when they differ from what the
|
||||||
// server last got, or once a month in case it lost them. Unticked ones are left out, and
|
// server last got, or once a month in case it lost them. Unticked ones are left out, and
|
||||||
// the server keeps the last value it had.
|
// the server keeps the last value it had.
|
||||||
|
|||||||
Reference in new issue
Block a user