fix(android): limit DND channel settings to native devices - #585
Merged
whes1015 merged 1 commit intoOct 2, 2026
Merged
Conversation
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
YinCheng0106
previously approved these changes
Oct 1, 2026
whes1015
force-pushed
the
fix(android)-handle-OEM-specific-DND-notification-settings
branch
from
October 1, 2026 19:50
bfedf20 to
3eed769
Compare
whes1015
previously approved these changes
Oct 1, 2026
whes1015
force-pushed
the
fix(android)-handle-OEM-specific-DND-notification-settings
branch
from
October 1, 2026 20:38
3eed769 to
e9dd467
Compare
whes1015
enabled auto-merge (rebase)
October 1, 2026 20:38
lowrt
force-pushed
the
fix(android)-handle-OEM-specific-DND-notification-settings
branch
from
October 2, 2026 00:12
e9dd467 to
a065692
Compare
Platform: android Fix(zh-Hant): 限制零打擾通知類別設定至原生 Android 裝置 Fix(en-US): limit Do Not Disturb channel settings to native Android devices
lowrt
force-pushed
the
fix(android)-handle-OEM-specific-DND-notification-settings
branch
from
October 2, 2026 00:13
a065692 to
9c97507
Compare
Comment on lines
+79
to
+80
| private fun usesNativeDndChannelSettings() = | ||
| Build.MANUFACTURER.lowercase() in nativeDndChannelSettingsManufacturers |
There was a problem hiding this comment.
由于设备的制造商在应用运行期间不会改变,建议将 usesNativeDndChannelSettings 改为 companion object 中的 val 属性,以避免每次调用时都重复执行 Build.MANUFACTURER.lowercase() 操作。
Suggestion:
Suggested change
| private fun usesNativeDndChannelSettings() = | |
| Build.MANUFACTURER.lowercase() in nativeDndChannelSettingsManufacturers | |
| // 在 companion object 中定义: | |
| private val usesNativeDndChannelSettings = Build.MANUFACTURER.lowercase() in nativeDndChannelSettingsManufacturers | |
| // 然后在调用处使用: | |
| if (!usesNativeDndChannelSettings) { ... } |
whes1015
disabled auto-merge
October 2, 2026 22:55
whes1015
deleted the
fix(android)-handle-OEM-specific-DND-notification-settings
branch
October 2, 2026 22:55
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.
這個 PR 做了什麼
部分 Android OEM 將「勿擾 / 零打擾」設定放在不同的位置。
目前已確認 Google Pixel、Sony Xperia 會在通知類別的系統設定中提供原生 Android 的「零打擾」選項,因此這些裝置會繼續直接開啟指定的 Notification Channel 設定。
其他尚未確認支援相同設定流程的 OEM,則改為開啟 App 的通知設定,避免將使用者帶到沒有「零打擾」選項的通知類別頁面。
白名單
其他裝置
未列入白名單的裝置會 fallback 至 App 通知設定。
這次不針對個別 OEM 寫死特定的私有 Settings Activity,後續可在確認其他品牌的實際設定流程後,再加入白名單。
相關 issue
怎麼驗
檢查清單
tool/check/commits.sh origin/main..HEAD通過—— commit 訊息就是更新日誌,格式見 commit.md
mise exec -- flutter analyze與mise exec -- flutter test通過AppLocalizations,沒有寫死AppSpacing/AppRadius/AppMotion,深色模式看過,文字對比度可接受