Skip to content

feature/battery optimization reminder#6235

Open
SeniorZhai wants to merge 11 commits into
masterfrom
codex/battery-optimization-reminder
Open

feature/battery optimization reminder#6235
SeniorZhai wants to merge 11 commits into
masterfrom
codex/battery-optimization-reminder

Conversation

@SeniorZhai
Copy link
Copy Markdown
Member

No description provided.

@SeniorZhai SeniorZhai added the testing Now testing, but you can review label Mar 19, 2026
@SeniorZhai SeniorZhai requested a review from Copilot March 19, 2026 05:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a battery-optimization reminder flow using the existing Compose bottom-sheet reminder system, replacing the prior dedicated dialog activity approach.

Changes:

  • Introduces a new BatteryOptimizationReminder popup type and UI copy (Battery_Optimization) across multiple locales.
  • Refactors ReminderPage to take pre-resolved content text (String) so callers can use stringResource(...) directly.
  • Centralizes battery optimization detection/navigation in ContextExtension and removes the old BatteryOptimizationDialogActivity + legacy triggers.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/main/res/values/strings.xml Adds Battery_Optimization string (default locale).
app/src/main/res/values-zh-rTW/strings.xml Adds Traditional Chinese translation for Battery_Optimization.
app/src/main/res/values-zh-rCN/strings.xml Adds Simplified Chinese translation for Battery_Optimization.
app/src/main/res/values-ru/strings.xml Adds Russian translation for Battery_Optimization.
app/src/main/res/values-ja/strings.xml Adds Japanese translation for Battery_Optimization.
app/src/main/res/values-es/strings.xml Adds Spanish translation for Battery_Optimization.
app/src/main/java/one/mixin/android/ui/home/reminder/VerifyMobileReminderBottomSheetDialogFragment.kt Updates reminder page content argument to pass a String via stringResource.
app/src/main/java/one/mixin/android/ui/home/reminder/ReminderPage.kt Changes content parameter from @StringRes Int to String; removes internal stringResource(content) lookup.
app/src/main/java/one/mixin/android/ui/home/reminder/ReminderBottomSheetDialogFragment.kt Adds battery optimization reminder selection + UI; updates other reminder content to pass strings.
app/src/main/java/one/mixin/android/ui/home/MainActivity.kt Removes legacy battery optimization check and related imports.
app/src/main/java/one/mixin/android/ui/common/BatteryOptimizationDialogActivity.kt Deletes the old dialog activity implementation.
app/src/main/java/one/mixin/android/job/BlazeMessageService.kt Removes background-triggered battery optimization dialog; centralizes restriction check.
app/src/main/java/one/mixin/android/extension/ContextExtension.kt Adds isBatteryOptimizationRestricted() and openBatteryOptimizationSetting() helpers.
app/src/main/AndroidManifest.xml Removes BatteryOptimizationDialogActivity registration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SeniorZhai SeniorZhai removed the testing Now testing, but you can review label Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new in-app “Battery Optimization” reminder surfaced via the existing reminder bottom sheet flow, replacing the previous dedicated dialog activity and consolidating battery optimization detection/navigation into Context extensions.

Changes:

  • Introduce a new BatteryOptimizationReminder popup type and reminder UI (new string + background image).
  • Refactor ReminderPage to accept pre-resolved String content (instead of a @StringRes id) and update call sites.
  • Remove BatteryOptimizationDialogActivity and migrate battery-optimization checks/open-settings behavior into ContextExtension.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/src/main/res/values/strings.xml Adds Battery_Optimization title string (EN).
app/src/main/res/values-zh-rTW/strings.xml Adds Traditional Chinese translation for Battery_Optimization.
app/src/main/res/values-zh-rCN/strings.xml Adds Simplified Chinese translation for Battery_Optimization.
app/src/main/res/values-ru/strings.xml Adds Russian translation for Battery_Optimization.
app/src/main/res/values-ja/strings.xml Adds Japanese translation for Battery_Optimization.
app/src/main/res/values-es/strings.xml Adds Spanish translation for Battery_Optimization.
app/src/main/res/drawable-xxhdpi/bg_reminder_battery_optimization.png Adds new reminder background asset.
app/src/main/java/one/mixin/android/ui/home/reminder/VerifyMobileReminderBottomSheetDialogFragment.kt Updates reminder content argument to pass a resolved string via stringResource.
app/src/main/java/one/mixin/android/ui/home/reminder/ReminderPage.kt Changes API: content becomes String and is rendered directly.
app/src/main/java/one/mixin/android/ui/home/reminder/ReminderBottomSheetDialogFragment.kt Adds battery optimization reminder selection + UI, and opens battery optimization settings.
app/src/main/java/one/mixin/android/ui/home/MainActivity.kt Removes the legacy battery optimization check hook.
app/src/main/java/one/mixin/android/ui/common/BatteryOptimizationDialogActivity.kt Deletes the legacy dialog activity implementation.
app/src/main/java/one/mixin/android/job/BlazeMessageService.kt Uses the new Context.isBatteryOptimizationRestricted() helper and removes dialog activity trigger.
app/src/main/java/one/mixin/android/extension/ContextExtension.kt Adds isBatteryOptimizationRestricted() + openBatteryOptimizationSetting() and intent fallback logic.
app/src/main/AndroidManifest.xml Removes BatteryOptimizationDialogActivity registration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ization-reminder

# Conflicts:
#	app/src/main/java/one/mixin/android/ui/home/reminder/ReminderBottomSheetDialogFragment.kt
#	app/src/main/java/one/mixin/android/ui/home/reminder/ReminderPage.kt
#	app/src/main/java/one/mixin/android/ui/home/reminder/VerifyMobileReminderBottomSheetDialogFragment.kt
…der' into codex/battery-optimization-reminder
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ottomSheetDialogFragment.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SeniorZhai
Copy link
Copy Markdown
Member Author

@claude[agent]+claude-opus-4.6 review PR
@codex[agent]+claude-opus-4.6 review PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +261 to +266
private fun batteryOptimizationContent(): String {
return getString(getBatteryOptimizationContentResId())
.replace("<b>", "")
.replace("</b>", "")
.replace("**", "")
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batteryOptimizationContent() removes <b>...</b> / **...** markers by string replacement, so the emphasized parts that were previously rendered in bold (see removed BatteryOptimizationDialogActivity.replaceTags) will now appear as plain text. Consider parsing these markers into an AnnotatedString (or otherwise applying bold spans) instead of dropping them, and build the text via stringResource(...) inside the composable so it stays configuration/locale-aware.

Copilot uses AI. Check for mistakes.
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.

3 participants