修复手柄连接提示重复和体感状态恢复#24
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough本 PR 更新 GamepadManager 以去重连接/断开连接通知,防止初始化竞争和重连流程导致的重复监听器调用;同时改进 GyroAssistService,避免不必要的启停循环并完善状态清理。 ChangesGamepadManager 连接去重
GyroAssistService 优化
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entry/src/main/ets/service/input/GamepadManager.ets`:
- Around line 662-667: resetSession currently preserves this.listener but
doesn't clear this.notifiedConnectionKeys, so when the same GamepadInputListener
instance is reused setListener(listener) sees no change and
notifiedConnectionKeys remains stale causing notifyGamepadConnectedOnce to
suppress connection toasts; update resetSession() to clear
this.notifiedConnectionKeys at the end of the method (same place the session
state is reset), ensuring notifyListenerOfExistingDevices /
notifyGamepadConnectedOnce will re-notify devices for the new session.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 01f29d24-bb93-4c58-9b7f-5c94af61533b
📒 Files selected for processing (2)
entry/src/main/ets/service/input/GamepadManager.etsentry/src/main/ets/service/input/GyroAssistService.ets
85456fe to
4310d68
Compare
摘要
dispose()完整重置体感运行态,避免下次进入需要手动关/开一次验证
get_errors检查GamepadManager.ets、GyroAssistService.ets:无错误hvigorw assembleHap --mode module -p product=default --no-daemon:BUILD SUCCESSFULSummary by CodeRabbit
发布说明