Skip to content

fix: restore voice_interaction_service on ColorOS 16 (Trigger failed) - #192

Open
Acerchicken wants to merge 1 commit into
parallelcc:mainfrom
Acerchicken:fix/coloros-restore-voice-interaction-service
Open

Acerchicken wants to merge 1 commit into
parallelcc:mainfrom
Acerchicken:fix/coloros-restore-voice-interaction-service

Conversation

@Acerchicken

Copy link
Copy Markdown

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.ASSISTANT points to GsaVoiceInteractionService, but the ROM leaves Settings.Secure.voice_interaction_service empty, so VoiceInteractionManagerService never binds a VoiceInteractionService:

$ adb shell settings get secure assistant
com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService
$ adb shell settings get secure voice_interaction_service
                                   # <- empty
$ adb shell cmd role get-role-holders android.app.role.ASSISTANT
com.google.android.googlequicksearchbox
$ adb shell dumpsys voiceinteraction
  ...
  (No active implementation)

and on trigger:

W VoiceInteractionManager: showSessionFromSession without running voice interaction service

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, MainActivity now checks voice_interaction_service. If it is empty and assistant is set, it restores voice_interaction_service from assistant (and voice_recognition_service from the assistant package's RecognitionService if that is empty too), then retries the trigger for up to ~2s while the service binds.

  • Writing secure settings needs WRITE_SECURE_SETTINGS, declared in the manifest and granted once by the user:
    adb shell pm grant com.parallelc.micts android.permission.WRITE_SECURE_SETTINGS
    
    On ColorOS CN pm grant from 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 with adb install -r -g MiCTS.apk grants it. Both ways are documented in README / README_en.
  • Without the permission behaviour is unchanged, except that when voice_interaction_service is empty while assistant is set, the toast says the assistant service is not running and to grant WRITE_SECURE_SETTINGS (en / vi / zh), and the full adb command is logged.
  • Devices where voice_interaction_service is already set are not affected (early return, no extra delay).
  • Adds a <queries> entry for android.speech.RecognitionService so the assistant's recognition service can be resolved on API 30+.

Tested on

Device OnePlus Ace 5 (PKG110, device OP5D2BL1)
OS ColorOS 16.0.10 (oplusrom V16.1.0), region CN_all
Build PKG110_16.0.10.500(CN01) / OTA PKG110_11.F.56_2560_202608111940
Android 16 (SDK 36), security patch 2026-08-01
Fingerprint OnePlus/PKG110/OP5D2BL1:16/UKQ1.231108.001/V.4b5889d-26206c7-2678746:user/release-keys
Google app 17.64.15.ve.arm64
Root / LSPosed No (VIS trigger only)

Test steps:

  1. Without permission, voice_interaction_service empty → new toast shown, logcat prints the adb command, behaviour otherwise unchanged. ✅
  2. With permission (adb install -r -g), right after a real reboot (ROM cleared voice_interaction_service, dumpsys voiceinteraction = No active implementation) → launch MiCTS:
    I MiCTS   : restored voice_interaction_service to com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService
    I GsaVoiceInteractionSrv: onCreate
    I GsaVoiceInteractionSrv: onReady
    I A       : Invoked omni from VIS
    
    Circle to Search opens (~0.6 s after restore). ✅
  3. Setting already present → no restore, triggers immediately, no extra delay. ✅
  4. assembleMiCTSDebug and assembleVISTriggerDebug both build. ✅

中文简述:ColorOS 16 上默认助理角色是 Google,但系统没有写入 voice_interaction_service(重启后会被清空),导致 VIS 未运行、触发失败。本 PR 在触发前检测该设置为空时,根据 assistant 自动恢复(需通过 adb 授予 WRITE_SECURE_SETTINGS),并在未授权时提示对应的 adb 命令。

🤖 Generated with Claude Code

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-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant