Skip to content

Commit 64e2961

Browse files
authored
Merge PR #44: fix FTL startup crash on devices without Google Play Services
fix(ci): prevent FTL startup crash on Pixel devices without Google Play Services
2 parents 0838196 + eb20b31 commit 64e2961

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

Common/src/main/java/tk/glucodata/Applic.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,18 @@ public androidx.work.Configuration getWorkManagerConfiguration() {
923923
public void onCreate() {
924924
super.onCreate();
925925
updateWearMessageReceiverComponent();
926-
if (DiskSpace.check(this)) {
927-
initproc();
928-
} else {
926+
if (!DiskSpace.check(this)) {
929927
android.util.Log.e(LOG_ID, "Stop program");
930928
stopprogram = 1;
929+
return;
930+
}
931+
try {
932+
initproc();
933+
} catch (Throwable th) {
934+
android.util.Log.e(LOG_ID, "initproc failed; continuing without crash", th);
935+
}
936+
if (!initproccalled) {
937+
stopprogram = 1;
931938
}
932939
}
933940

Common/src/main/java/tk/glucodata/OutboundApiSettings.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,9 @@ object OutboundApiSettings {
375375
arrivedAtMs: Long
376376
) {
377377
updateDestination(context, destinationId) { dest ->
378-
// Only update the timestamp; leave messageId and lastSentMgdl unchanged
379-
// so suppression delta is still computed from the last-sent value.
380378
dest.copy(
381-
lastSentAtMsByRecipient = dest.lastSentAtMsByRecipient + (recipient to arrivedAtMs)
379+
lastSentAtMsByRecipient = dest.lastSentAtMsByRecipient + (recipient to arrivedAtMs),
380+
lastStaleAtMsByRecipient = dest.lastStaleAtMsByRecipient - recipient
382381
)
383382
}
384383
}

0 commit comments

Comments
 (0)