Voice input fails in browser address bars due to incorrect password field detection (v4.2.9, follow-up to #516)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
研究方向
閱讀 VoiceInputManager.kt 中 isBlockedEditor() 附近的程式碼,並將其密碼檢查與 InputTypeUtils.kt 中考量類別的工具進行比較。檢查現有的語音輸入測試(如果有),並確認網址列的 URL 欄位不再被拒絕,同時密碼欄位仍會被封鎖。完成標準是語音輸入能在瀏覽器網址列中啟動,且仍會拒絕密碼欄位。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
Voice dictation still fails in browser address bars after the fix for #516, included in LeanType v4.2.9.
Tested browsers: Firefox, Chrome, and Brave. The issue occurs in all three.
The microphone button appears in the address bar, but tapping it shows:
Voice input not available or permission missing
Voice dictation works correctly in ordinary text fields, including input fields within webpages.
Relationship to #516
Issue #516 was closed as completed via commit 3373e94.
That commit removed this condition from InputAttributes.kt:
- hasNoMicrophoneKeyOption() ||
This stops the app's NO_MICROPHONE flag from hiding the microphone button in browser address bars. However, it addresses button visibility, not the separate activation-time check. The button is now visible but voice recording still fails.
Root cause identified in source code
LeanType uses two inconsistent password-field checks.
1. Microphone visibility — class-aware
InputTypeUtils.isPasswordInputType() checks both the input class and variation:
val maskedInputType = inputType and
(InputType.TYPE_MASK_CLASS or InputType.TYPE_MASK_VARIATION)
Source: InputTypeUtils.kt, lines 56–65
2. Microphone activation — checks variation only
VoiceInputManager.isBlockedEditor() uses:
val variation = info.inputType and InputType.TYPE_MASK_VARIATION
return variation == InputType.TYPE_TEXT_VARIATION_PASSWORD ||
variation == InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD ||
variation == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD ||
variation == InputType.TYPE_NUMBER_VARIATION_PASSWORD
Source: VoiceInputManager.kt, lines 1071–1079
Android assigns the same numeric variation (0x10) to these two types:
TYPE_TEXT_VARIATION_URI— URL fields (text class)TYPE_NUMBER_VARIATION_PASSWORD— numeric password fields (number class)
Because isBlockedEditor() ignores TYPE_MASK_CLASS, a URL field can be incorrectly identified as a numeric password field. This explains the discrepancy between button visibility and activation.
Log evidence
The LeanType diagnostic log repeatedly shows the following immediately after tapping the microphone:
SuggestionStripView: click toolbar key VOICE
VoiceInputManager: canStartVoice: Blocked editor (password)
Other regular text fields successfully initiate recording and transcription. The logs establish that the password-field rejection is occurring; the source code indicates the cause of the misclassification.
To Reproduce
- Install LeanType v4.2.9 (standard flavor).
- Open Firefox, Chrome, or Brave.
- Focus the browser address bar.
- Tap LeanType's visible microphone button.
Actual behavior: Recording does not start. Instead, the keyboard reports Voice input not available or permission missing.
Expected behavior
Voice dictation should activate in browser address bars and insert recognized text as it does in regular text fields.
Suggested fix
Make VoiceInputManager.isBlockedEditor() check both input class and variation, ideally by reusing the existing class-aware utilities:
fun isBlockedEditor(info: EditorInfo?): Boolean {
if (info == null) return false
return InputTypeUtils.isPasswordInputType(info.inputType) ||
InputTypeUtils.isVisiblePasswordInputType(info.inputType)
}
This avoids duplicating password-detection logic and prevents collisions between URL fields and numeric password fields.
Screenshots
A screenshot showing the error message in the address bar is available. LeanType diagnostic logs are also available, showing repeated Blocked editor (password) warnings.
App version & Flavor
- Version: 4.2.9 (4209)
- Flavor: Standard
- Voice provider: Online
Device Info
- Model: Nothing Phone (2)
- OS version: Android 16 (SDK 36)
Related: #516 — Voice dictation does not work in browser URL bars. Its fix addressed microphone-button visibility, but the separate activation-time password-field detection remains defective. Please track this as a follow-up to #516.
- 主要語言
- Kotlin
- 星號
- 1k
- 分支
- 59
- 平均合併
- 13 小時 11 分鐘
- 30 天內合併 PR
- 47
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
LeanBitLab/LeanType 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
LeanBitLab/LeanType#423 · 1 則留言 ·
維護者通常 1 天內回覆
-
Crush Report未關閉
難度 3/5 1-2 天 新手友好度 20/100
LeanBitLab/LeanType#715 ·
維護者通常 1 天內回覆
-
Text Expander/cursor-handling bug可能已有人在做 @LeanBitLab 於 2 天前認領。 未關閉bug
難度 3/5 1-2 天 新手友好度 62/100
LeanBitLab/LeanType#703 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
enhancement
難度 3/5 1-2 天 新手友好度 45/100
LeanBitLab/LeanType#699 ·
維護者通常 1 天內回覆
-
support minicpm未關閉enhancement
難度 4/5 3-5 天 新手友好度 30/100
LeanBitLab/LeanType#698 ·
維護者通常 1 天內回覆
查看 LeanBitLab/LeanType 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
leboncoin/spark-android#2342 ·
維護者通常 1 天內回覆
-
The Voraton URL has been changed可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉Bug Domain changed
難度 2/5 1-3 小時 新手友好度 62/100
keiyoushi/extensions-source#20257 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
bug
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆
-
feature
難度 2/5 1-3 小時 新手友好度 62/100
user-grinch/RivoPhoneApp#302 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆