Skip to content

Modularize preferences and network mode definitions - #8

Merged
Dhangofa merged 8 commits into
mainfrom
dev
Aug 11, 2026
Merged

Modularize preferences and network mode definitions#8
Dhangofa merged 8 commits into
mainfrom
dev

Conversation

@Dhangofa

Copy link
Copy Markdown
Owner

Summary

This PR completes Phase 1 of the NetToggle modular refactor.

It centralizes preferences and shared models while preserving the existing application behavior, saved preference values, Target SIM handling, and four-mode Quick Settings tile cycle.

New Modules

  • Added AppPreferences as the central preference manager.
  • Added ExecutionMode for None, Root, and Shizuku modes.
  • Added TargetSim for Auto, SIM 1, and SIM 2 selection.
  • Added NetworkMode for network mode states, labels, icons, bitmasks, default cycle order, and legacy readback mappings.

Updated Components

  • Updated BootReceiver to clear transient state through AppPreferences.
  • Updated MainActivity to use the shared preference and model classes.
  • Updated NetworkTileService to use centralized network mode definitions.
  • Removed duplicated preference keys and numeric mode constants from the main components.

Behavior Preserved

  • Existing SharedPreferences values remain compatible with v1.0.32.

  • Root and Shizuku execution modes remain unchanged.

  • Auto, SIM 1, and SIM 2 Target SIM behavior remains unchanged.

  • Network mode readback continues to use subscription IDs.

  • Network mode application continues to use physical SIM slot indexes.

  • Cached QS tile state behavior remains unchanged.

  • Boot and package-update cache reset behavior remains unchanged.

  • Existing QS tile cycle remains:

    4G Only → 5G Only → Preferred 5G → Preferred 4G

@Dhangofa
Dhangofa merged commit a6ed03f into main Aug 11, 2026
1 check 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.

1 participant