Skip to content

Optimize pattern handling and memory management#1429

Merged
ukanth merged 3 commits intoukanth:betafrom
mmiheev:feature-mmiheev
Dec 9, 2025
Merged

Optimize pattern handling and memory management#1429
ukanth merged 3 commits intoukanth:betafrom
mmiheev:feature-mmiheev

Conversation

@mmiheev
Copy link
Contributor

@mmiheev mmiheev commented Oct 2, 2025

Changes

Added Back Button to PreferencesActivity

  • Added back button navigation to PreferencesActivity toolbar following existing pattern from other activities
  • Extracted intent extras handling to separate method for better code organization
  • Used AppCompat resources for back icon compatibility

Refactored SecPreferenceFragment

  • Added dedicated methods for pattern result handling:
    • handleCreatePatternResult()
    • handleEnterPatternResult()
    • savePattern()
    • enablePatternFeatures()
    • resetPatternSelection()

Memory Management

  • Explicit nullification of globalContext, enableAdminPref, and enableDeviceCheckPref in onDestroy()
  • Added isAdded() checks in onActivityResult() to prevent NPE

Lifecycle Safety

  • Implemented fragment state validation before UI operations
  • Protected against operations when fragment is detached

Technical Details

  • Maintained full backward compatibility
  • No changes to public API or user-facing behavior
  • Reduced method complexity by extracting helper functions
  • Improved error resilience during configuration changes

@ukanth ukanth added this to the 4.0.1 milestone Oct 8, 2025
@mmiheev
Copy link
Contributor Author

mmiheev commented Oct 18, 2025

Back button functionality has been added to PreferencesActivity.

@mmiheev mmiheev requested a review from ukanth October 18, 2025 21:08
@ukanth ukanth merged commit 933bbc0 into ukanth:beta Dec 9, 2025
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.

2 participants