Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/ttstd/dialer/service/MyVoiceInteractionService.java
#	app/src/main/java/com/ttstd/dialer/service/MyVoiceInteractionSession.java
This commit is contained in:
TongTongStudio
2026-07-29 00:40:25 +08:00
3 changed files with 17 additions and 18 deletions

View File

@@ -29,11 +29,14 @@ public class MyVoiceInteractionService extends VoiceInteractionService {
public void onReady() {
super.onReady();
Logger.d(TAG, "onReady");
// 服务准备就绪,通常在此之后可以开启 Session 获取界面信息
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Logger.d(TAG, "onStartCommand: " + intent);
Logger.d(TAG, "onStartCommand: action=" + (intent != null ? intent.getAction() : "null"));
// 如果需要主动触发获取界面信息,可以调用 showSession
// 这会触发 MyVoiceInteractionSessionService 创建 Session并回调 onHandleAssist
if (intent != null) {
String action = intent.getAction();
if (ACTION_SHOW_SESSION.equals(action)) {
@@ -44,7 +47,7 @@ public class MyVoiceInteractionService extends VoiceInteractionService {
Bundle args = new Bundle();
showSession(args,
VoiceInteractionSession.SHOW_WITH_ASSIST |
VoiceInteractionSession.SHOW_WITH_SCREENSHOT);
VoiceInteractionSession.SHOW_WITH_SCREENSHOT);
} else {
Logger.w(TAG, "Service is not the active voice interaction service");
}