← 输入框|github.com|刷新
Skip to content

refactor: share battery optimization toggle and use Log instead of printStackTrace - #111

Merged
LeanBitLab merged 1 commit into
mainfrom
chore/cleanup-battery-opt-logging
Nov 24, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
chore/cleanup-battery-opt-logging

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Cleanup, no intended behavior change.

  • New BatteryOptimization.kt replaces the duplicated battery-optimization toggle blocks in SettingsPermissions.kt and SetupActivity.kt; drops the always-true SDK_INT >= M checks (minSdk 26).
  • Replace the remaining printStackTrace() calls with Log.w, and give four generic "Exception caught" logs specific messages.
  • Share one openUsageAccessSettings() for the identical usage-access lambdas.

Verified: check_strings.py, testDebugUnitTest (incl. MainActivitySmokeTest), lintDebug, debug build installed and launched on a device, battery toggle checked by hand on the device.

@LeanBitLab
LeanBitLab merged commit cb77d48 into main Nov 24, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the chore/cleanup-battery-opt-logging branch November 24, 2026 11:50
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.

1 participant