Skip to content

Commit 32fa81c

Browse files
Robclaude
andcommitted
fix(tts): stop settings-save from resetting nexttime; bump v0.2.4.2-alpha
applyComposeSettings() and the legacy dialog save handler both called nexttime = System.currentTimeMillis() + cursep; on every save — including on every slider tick and every app-resume that reloads settings. This stamped a full separation-period blackout on the rate limiter unconditionally, so 9 readings could be suppressed before the first speak and after every settings interaction. Trace evidence: 71 glucose notifications, only 7 spoken, first speak at T+607 s despite nexttime=0 at init — a settings reload at app resume had set nexttime = T_resume + cursep before the first glucose arrived. Fix: remove the nexttime assignment from both save paths. cursep is still updated so the correct interval takes effect immediately; nexttime advances only inside selspeak() after a reading is actually announced. Remaining nexttime write sites after this change: selspeak() — advances gate after each spoken reading ✓ SuperGattCallback L494 — resets to 0 when alarm speech starts ✓ volatile static init — initial zero ✓ Bump: versionCode 8241 → 8242, versionName 0.2.4.1 → 0.2.4.2-alpha Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f75893b commit 32fa81c

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

Common/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ android {
8989
//compileSdk 36
9090
applicationId "cloud.glucodroid"
9191

92-
versionName '0.2.4.1-alpha'
93-
versionCode 8241
92+
versionName '0.2.4.2-alpha'
93+
versionCode 8242
9494
// multiDexEnabled true
9595

9696
buildConfigField 'String', 'BUILD_TIME', 'new java.text.SimpleDateFormat("HH:mm:ss dd-MMM-yyyy").format(new java.util.Date(' + System.currentTimeMillis() + 'L))'

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ public static void applyComposeSettings(Context context, boolean speakGlucose, b
255255
curspeed=speed;
256256
curpitch=pitch;
257257
cursep=Math.max(1,separationSeconds)*1000L;
258-
nexttime=System.currentTimeMillis()+cursep;
259258
if(selectedVoice>=0)
260259
voicepos=selectedVoice;
261260

@@ -873,8 +872,6 @@ public void onNothingSelected (AdapterView<?> parent) {
873872
var str = separation.getText().toString();
874873
if(str != null) {
875874
cursep = Integer.parseInt(str)*1000L;
876-
var now=System.currentTimeMillis();
877-
nexttime=now+cursep;
878875
}
879876
var speedstr=((EditText)speeds[1]).getText().toString();
880877
if(speedstr != null) {

0 commit comments

Comments
 (0)