Repository navigation
fix: restore voice_interaction_service on ColorOS 16 (Trigger failed) - #192
Open
Acerchicken wants to merge 1 commit into
Open
Acerchicken wants to merge 1 commit into
Acerchicken wants to merge 1 commit into
Conversation
On ColorOS 16 the assistant role is held by Google but
voice_interaction_service is left empty (and cleared on every reboot),
so no VoiceInteractionService runs and showSessionFromSession always
returns false ("Trigger failed!").
Before triggering, restore voice_interaction_service (and
voice_recognition_service if empty) from the assistant setting when
WRITE_SECURE_SETTINGS is granted via adb, then retry while the service
binds. Without the permission, show a hint toast instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
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.
Problem
On ColorOS 16 (OnePlus Ace 5, CN firmware) opening MiCTS always shows "Trigger failed!", even though Google is selected as the default digital assistant.
The assistant role is held by Google and
Settings.Secure.ASSISTANTpoints toGsaVoiceInteractionService, but the ROM leavesSettings.Secure.voice_interaction_serviceempty, soVoiceInteractionManagerServicenever binds a VoiceInteractionService:and on trigger:
Writing the setting manually via adb makes Circle to Search work immediately (
Invoked omni from VIS), but ColorOS clears it again on every reboot.Fix
Before triggering,
MainActivitynow checksvoice_interaction_service. If it is empty andassistantis set, it restoresvoice_interaction_servicefromassistant(andvoice_recognition_servicefrom the assistant package'sRecognitionServiceif that is empty too), then retries the trigger for up to ~2s while the service binds.WRITE_SECURE_SETTINGS, declared in the manifest and granted once by the user:pm grantfrom shell is rejected (Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS) and there is no "Disable permission monitoring" toggle in developer options, but installing withadb install -r -g MiCTS.apkgrants it. Both ways are documented in README / README_en.voice_interaction_serviceis empty whileassistantis set, the toast says the assistant service is not running and to grantWRITE_SECURE_SETTINGS(en / vi / zh), and the full adb command is logged.voice_interaction_serviceis already set are not affected (early return, no extra delay).<queries>entry forandroid.speech.RecognitionServiceso the assistant's recognition service can be resolved on API 30+.Tested on
PKG110, deviceOP5D2BL1)oplusromV16.1.0), regionCN_allPKG110_16.0.10.500(CN01)/ OTAPKG110_11.F.56_2560_202608111940OnePlus/PKG110/OP5D2BL1:16/UKQ1.231108.001/V.4b5889d-26206c7-2678746:user/release-keysTest steps:
voice_interaction_serviceempty → new toast shown, logcat prints the adb command, behaviour otherwise unchanged. ✅adb install -r -g), right after a real reboot (ROM clearedvoice_interaction_service,dumpsys voiceinteraction=No active implementation) → launch MiCTS:assembleMiCTSDebugandassembleVISTriggerDebugboth build. ✅中文简述:ColorOS 16 上默认助理角色是 Google,但系统没有写入
voice_interaction_service(重启后会被清空),导致 VIS 未运行、触发失败。本 PR 在触发前检测该设置为空时,根据assistant自动恢复(需通过 adb 授予WRITE_SECURE_SETTINGS),并在未授权时提示对应的 adb 命令。🤖 Generated with Claude Code