Skip to content

refactor: remove redundant isNougatPlus check in safeStorageContext #418

Merged
naveensingh merged 1 commit intoFossifyOrg:mainfrom
SEKI-YUTA:SEKI-YUTA/remove-redundant-nougat-check
Mar 1, 2026
Merged

refactor: remove redundant isNougatPlus check in safeStorageContext #418
naveensingh merged 1 commit intoFossifyOrg:mainfrom
SEKI-YUTA:SEKI-YUTA/remove-redundant-nougat-check

Conversation

@SEKI-YUTA
Copy link
Contributor

@SEKI-YUTA SEKI-YUTA commented Mar 1, 2026

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Removed redundant isNougatPlus() check in safeStorageContext getter
  • The isDeviceInDirectBootMode property already includes an isNougatPlus() check internally, so the outer check is unnecessary
  • This is a pure refactoring change with no behavioral difference

Before:

get() = if (isNougatPlus() && isDeviceInDirectBootMode) {

After:

get() = if (isDeviceInDirectBootMode) {

Logical equivalence:

  • isDeviceInDirectBootMode returns isNougatPlus() && !userManager.isUserUnlocked
  • Therefore, isNougatPlus() && isDeviceInDirectBootMode simplifies to just isDeviceInDirectBootMode

Tests performed

  • Verified logical equivalence of the change
  • Confirmed isDeviceInDirectBootMode is used standalone in App.kt without additional isNougatPlus() check, supporting this pattern

Before & after preview

N/A (no UI changes)

Closes the following issue(s)

N/A (trivial refactoring, no issue created per contribution guidelines exception)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

@SEKI-YUTA SEKI-YUTA requested a review from naveensingh as a code owner March 1, 2026 00:33
@SEKI-YUTA SEKI-YUTA changed the title chore: remove redundant nougat check at Context.safeStorageContext ex… refactor: remove redundant isNougatPlus check in safeStorageContext Mar 1, 2026
@naveensingh naveensingh merged commit 1777ae2 into FossifyOrg:main Mar 1, 2026
15 of 21 checks passed
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