feat: Phase 6 - Battery Optimization Testing#422
Merged
hossain-khan merged 1 commit intomainfrom Dec 11, 2025
Merged
Conversation
Adds Battery Optimization Testing section to Developer Portal with: - Display current battery optimization status (Enabled/Disabled) - Button to show battery optimization reminder bottom sheet - Button to reset 'Don't remind again' preference - Button to open system battery optimization settings - Auto-refresh of status after settings changes - Integration with BatteryOptimizationHelper and AppPreferencesDataStore Changes: - Added BatteryOptimizationTestingCard to DeveloperPortalScreen.kt - New events: ShowBatteryOptSheet, DismissBatteryOptSheet, ResetBatteryOptPreference, OpenBatterySettings - New state fields: isBatteryOptimizationEnabled, showBatteryOptSheet - Integrated existing BatteryOptimizationBottomSheet component - Uses Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent - Removed Battery Optimization from 'Coming Soon' list - Added proper context handling and coroutine scoping Closes #412
Code Coverage Report |
📊 APK Size AnalysisComparing Generated by Diffuse via diffuse-action |
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.
🎯 Phase 6: Battery Optimization Testing
This PR implements Phase 6 of the Developer Portal, adding comprehensive battery optimization testing controls to help developers test and verify the app's battery optimization status and user flow.
✨ Features Implemented
Battery Optimization Testing Card
🏗️ Technical Implementation
State Management
New Events
Integration Points
BatteryOptimizationHelper.isIgnoringBatteryOptimizations()- Check current statusAppPreferencesDataStore.setHideBatteryOptReminder()- Reset preferenceBatteryOptimizationBottomSheet- Reused existing UI componentSettings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS- System intentDependencies Injected
AppPreferencesDataStore- Added to presenter constructor for preference managementLocalContext- Added to access Android context in Composable📱 User Flow
🧪 Testing Controls Available
⚡ Key Implementation Details
LocalContext.currentin presenter for accessing Android APIsscope.launch🎨 UI/UX Features
🔧 Code Changes
Modified Files:
DeveloperPortalScreen.kt- Added 211 lines, removed 3 linesNew Imports:
android.content.Intentandroid.net.Uriandroid.provider.Settingsandroidx.compose.ui.platform.LocalContextdev.hossain.remotenotify.data.AppPreferencesDataStoredev.hossain.remotenotify.ui.addalert.BatteryOptimizationBottomSheetdev.hossain.remotenotify.utils.BatteryOptimizationHelper✅ Validation Results
All quality checks passing:
📸 What It Looks Like
The Battery Optimization Testing card appears in the Developer Portal with:
🔗 Related Issues
Closes #412 - Battery Optimization Testing
Part of epic #416 - Developer Portal Implementation
📊 Progress
Completed: 6 of 7 phases (86%)
🧑💻 Testing Instructions
🎓 Learning Points
This implementation demonstrates:
Ready for Review ✅
All features implemented, tested, and validated. This completes Phase 6 of 7 in the Developer Portal implementation.