-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:修复全局浮窗对activity的依赖 #193
Conversation
审阅者指南 by Sourcery这个拉取请求移除了全局浮动窗口对活动生命周期的依赖。它引入了一个新的服务和广播接收器来管理浮动窗口的生命周期。同时还更新了权限检查逻辑和视图初始化过程。 更新后的浮动窗口初始化流程序列图sequenceDiagram
participant App
participant FxSystemPlatformProvider
participant WindowManager
participant PermissionChecker
App->>FxSystemPlatformProvider: checkOrInit()
alt internalView exists
FxSystemPlatformProvider-->>App: return true
else internalView is null
FxSystemPlatformProvider->>FxSystemPlatformProvider: checkOrRegisterActivityLifecycle()
FxSystemPlatformProvider->>PermissionChecker: checkAgreePermission(context)
alt has permission
PermissionChecker-->>FxSystemPlatformProvider: true
FxSystemPlatformProvider->>WindowManager: getSystemService
FxSystemPlatformProvider->>FxSystemPlatformProvider: create FxSystemContainerView
FxSystemPlatformProvider-->>App: return true
else no permission
PermissionChecker-->>FxSystemPlatformProvider: false
FxSystemPlatformProvider->>FxSystemPlatformProvider: internalAskAutoPermission
FxSystemPlatformProvider-->>App: return false
end
end
浮动窗口生命周期状态图stateDiagram-v2
[*] --> Initialized: 启动完成
Initialized --> CheckingPermission: 显示请求
CheckingPermission --> RequestingPermission: 无权限
CheckingPermission --> Creating: 有权限
RequestingPermission --> Creating: 权限已授予
Creating --> Showing: 创建视图
Showing --> Hidden: 隐藏请求
Hidden --> Showing: 显示请求
Hidden --> [*]: 销毁
文件级别变更
可能关联的问题
提示和命令与 Sourcery 交互
自定义您的体验访问您的仪表板以:
获取帮助Original review guide in EnglishReviewer's Guide by SourceryThis pull request removes the dependency of the global floating window on the activity lifecycle. It introduces a new service and broadcast receiver to manage the floating window's lifecycle. It also updates the permission check logic and view initialization process. Sequence diagram for updated floating window initialization flowsequenceDiagram
participant App
participant FxSystemPlatformProvider
participant WindowManager
participant PermissionChecker
App->>FxSystemPlatformProvider: checkOrInit()
alt internalView exists
FxSystemPlatformProvider-->>App: return true
else internalView is null
FxSystemPlatformProvider->>FxSystemPlatformProvider: checkOrRegisterActivityLifecycle()
FxSystemPlatformProvider->>PermissionChecker: checkAgreePermission(context)
alt has permission
PermissionChecker-->>FxSystemPlatformProvider: true
FxSystemPlatformProvider->>WindowManager: getSystemService
FxSystemPlatformProvider->>FxSystemPlatformProvider: create FxSystemContainerView
FxSystemPlatformProvider-->>App: return true
else no permission
PermissionChecker-->>FxSystemPlatformProvider: false
FxSystemPlatformProvider->>FxSystemPlatformProvider: internalAskAutoPermission
FxSystemPlatformProvider-->>App: return false
end
end
State diagram for floating window lifecyclestateDiagram-v2
[*] --> Initialized: Boot Completed
Initialized --> CheckingPermission: Show Request
CheckingPermission --> RequestingPermission: No Permission
CheckingPermission --> Creating: Has Permission
RequestingPermission --> Creating: Permission Granted
Creating --> Showing: Create View
Showing --> Hidden: Hide Request
Hidden --> Showing: Show Request
Hidden --> [*]: Destroy
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嘿 @Petterpx - 我已经审查了你的更改 - 以下是一些反馈:
整体评论:
- 有一个 FIXME 注释表明可能存在多次 show() 调用 - 在合并之前应解决这个竞争条件。考虑添加适当的同步或事件去重。
以下是我在审查期间查看的内容
- 🟡 一般性问题:发现 2 个问题
- 🟢 安全性:一切看起来都很好
- 🟢 测试:一切看起来都很好
- 🟢 复杂性:一切看起来都很好
- 🟢 文档:一切看起来都很好
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我将使用这些反馈来改进你的评论。
Original comment in English
Hey @Petterpx - I've reviewed your changes - here's some feedback:
Overall Comments:
- There's a FIXME comment indicating potential multiple show() calls - this race condition should be addressed before merging. Consider adding proper synchronization or event deduplication.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Summary by Sourcery
更新浮动窗口实现,以移除对活动的依赖并添加开机启动支持。
新功能:
测试:
Original summary in English
Summary by Sourcery
Update the floating window implementation to remove the dependency on activities and add support for starting on boot.
New Features:
Tests: