Hidden Debug screen + diagnostic logging for USB audio path#81
Merged
Conversation
Surfaces the structured event log so users can diagnose problems (particularly USB audio routing on car-dash tablets) without needing adb. Unlocked by tapping the version row in About 7 times, matching the Android developer-options convention. Hidden from normal users. Includes: - GeneralVariables.fileLog() static helper any class can call. - MicRecorder + openUsbAudioInput() now record which step succeeded or failed (device-found, USB permission, open(), hasInput(), activateInput(48000)) and the final routing decision. Previously these went only to logcat, which a non-adb user can't see. - debugModeEnabled persisted via the existing config DB. - DebugLogScreen: auto-refreshing tail of debug.log, Share intent through FileProvider, Clear, and an optional logcat capture toggle that adds the running app's own logcat output for richer detail during an active repro. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a hidden in-app Debug screen so users can diagnose problems (especially the car-dash USB audio routing issue from #80) without needing adb. Unlocked Android-developer-options style: tap the version row in Settings → About 7 times.
While we're at it, this also wires the USB audio open path into
debug.logso the screen actually has useful signal. Previously those failures only went to logcat.What's in it
GeneralVariables.fileLog()— static helper any class can call. Same format as existing per-class loggers.MicRecorder.openUsbAudioInput()— every step now logs success/failure with context (device found, USB permission,open(),hasInput(),activateInput(48000)). The constructor logs the final routing decision (USB direct vsAudioRecordwith mic fallback, including whethersetPreferredDevicereturned true).debugModeEnabledboolean inGeneralVariables, loaded byDatabaseOprlike other config flags.AboutDialog: tap-counter on the version text. 7 taps → flips the flag, persists, toasts confirmation.SettingsScreen: conditional Debug row under FAQ & Support, visible only when unlocked.DebugLogScreen(new): full-screen Dialog with auto-refreshing tail (last 500 lines, every 2s), Share via FileProvider, Clear, and a Logcat: ON/OFF toggle that appendslogcat -d --pid=<self>output for richer runtime detail during an active repro.filepaths.xml: exposesexternal-files-pathso the share intent can handdebug.logto the chooser.Test plan
assembleDebugcompiles clean.(USB direct)in Audio Input, open Debug screen, sharedebug.log. Lines likeopenUsbAudioInput: NO USB permission...oractivateInput(48000) FAILED ...should tell us exactly where the raw USB path is dying.🤖 Generated with Claude Code