mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* Resume the Android speech model download instead of failing in the background Setup starts the 190 MB Whisper small download and then sends the person to Android's Settings. On Android 15+ (seen on API 36) the system closes a backgrounded app's sockets about 5 s later, so the plain HttpsURLConnection failed, setup said the download stopped and Try again started from 0. ModelStore now: - keeps the partial file (whisper-small-<sha256>.part) and continues with an HTTP Range request; it re-hashes the kept bytes so the final SHA-256 and byte-count check is unchanged. A 200 reply (range ignored), a 206 for the wrong range or a 416 for an incomplete file falls back to a clean restart. A resumed file that fails the checksum is deleted and fetched once more from 0; a fresh one that fails reports a failure. - treats a connection error while Hex was in the background (or left the foreground during the attempt) as a pause, not an error: the progress stays and the download continues as soon as a Hex activity starts again (ActivityLifecycleCallbacks registered from refresh()). The same hook picks up a partial file after the app is swiped away or the phone restarts. - reports real failures by cause. State.Retry is now a data class carrying a Problem (Connection, Server, Space); modelStatus() maps them to the new model_no_connection / model_no_space strings and the existing model_stopped, and modelAction() offers Try again, which now resumes. - the old restart-every-time path (part.delete() in finally) is removed. No new permissions (still only RECORD_AUDIO and INTERNET), no foreground service, no new dependencies. Verified on API 36 and API 31 emulators with the debug build, rebased on #2291's setup flow (Turn on, Hex switched on in Settings, the picker that opens on return, Hex picked): Settings for 10/30/90 s, swipe from recents, airplane mode in the foreground (shows "No connection", Try again resumes) and in the background (continues on return), reboot, and 16 corrupted bytes in the partial file (detected, re-fetched, final SHA-256 matches). Every run finished with the right hash; dictation from Home used the installed small model on both. Signed release build: Settings 30 s on API 36 finished, DEX has no android.util.Log references, permissions are RECORD_AUDIO and INTERNET only. Baseline on API 36: interrupted ~5 s after Settings, 234.5 MB fetched; now 190.1 MB and no error. ./gradlew test passes (64 tests); lintDebug's only error is the existing LogTagMismatch in MicCapture.kt (same on origin/dev), plus one UsableSpace warning from the extra check. * Android: Simplified Chinese for the two new speech model failure strings #2295 added values-zh-rCN while this branch was open. This adds model_no_connection and model_no_space there in the same style as model_stopped. Verified: assembleDebug, test and lintDebug pass on the rebased branch (lint now has no errors). |
||
| .. | ||
| main | ||
| release | ||
| test/java/ly/anoma/hex | ||