Repository navigation
Code cleanup, threading fixes, and deprecation removal - #7
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
- FloatingMicService: Replace runBlocking with async position loading - SpeechRecognitionService: Add 10s timeout to model init, fix callback timing - VoiceInputMethodService: Remove recursive startRecording, add init timeout - TranscribeActivity: Add configChanges to preserve state on rotation - AudioMonitorService: Use DEBOUNCE_MS constant, add file validation - BootReceiver: Add timeout to DataStore reads - RecognizerManager: Replace manual timeout loop with withTimeoutOrNull - Theme: Use safe Activity cast to prevent preview crash Co-Authored-By: Claude <noreply@anthropic.com>
The Parakeet TDT model auto-detects language regardless of user selection. Remove the unused language preference UI and code: - Remove LanguageSettingItem from Settings UI - Remove preferredLanguage flow and related methods from SettingsRepository - Remove languageCode parameter from transcribe() methods - Remove setting_language strings from all locale files Co-Authored-By: Claude <noreply@anthropic.com>
- AudioRecorder: Use AtomicBoolean for thread-safe isRecording flag
- TextInjectionService/FloatingMicService: Fix mutex scope for audioRecorder
- TextInjectionService: Add try-finally to prevent AccessibilityNodeInfo leaks
- ModelManager: Use response.use{} to prevent HTTP connection leaks
- RecognizerManager: Move isLoading check inside mutex to prevent race
- BootReceiver: Use runBlocking to ensure pendingResult.finish() is called
- AudioMonitorService: Stop old observers before starting new ones
- DictionaryManager: Cache compiled regex patterns for performance
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace deprecated onBackPressed with OnBackPressedDispatcher in VoiceInputActivity - Add ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE for Android 14+ in FloatingMicService - Use AtomicBoolean for isRecording flag in FloatingMicService and TextInjectionService - Add @volatile to TextInjectionService.instance for thread visibility - Replace Handler.postDelayed with coroutine delay in TextInjectionService - Use CopyOnWriteArrayList for fileObservers in AudioMonitorService - Cancel debounceJob in AudioMonitorService.stopMonitoring() Co-Authored-By: Claude <noreply@anthropic.com>
Android 26+ automatically manages AccessibilityNodeInfo lifecycle, making manual recycle() and obtain() calls unnecessary. Co-Authored-By: Claude <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
Changes
Threading & Concurrency
AtomicBooleanforisRecordingflag in FloatingMicService and TextInjectionService@VolatiletoTextInjectionService.instancefor thread visibilityCopyOnWriteArrayListforfileObserversin AudioMonitorServiceDeprecation Fixes
onBackPressed()withOnBackPressedDispatcherin VoiceInputActivityAccessibilityNodeInfo.recycle()andobtain()calls (auto-managed since API 26)ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONEfor Android 14+Handler.postDelayedwith coroutinedelay()Other Improvements
debounceJobin AudioMonitorService cleanup