Skip to content

Extract SIM resolution and network mode operations - #11

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

Extract SIM resolution and network mode operations#11
Dhangofa merged 5 commits into
mainfrom
dev

Conversation

@Dhangofa

Copy link
Copy Markdown
Owner

Summary

This PR completes Phase 3 of the NetToggle modular refactor by moving SIM resolution, network mode readback, and network mode application logic out of NetworkTileService into dedicated telephony modules.

The refactor keeps the current app behavior unchanged while making the telephony layer easier to maintain, test, and extend.

New Telephony Modules

  • Added SimResolver to handle subscription ID and physical SIM slot resolution.
  • Added NetworkModeReader to read and map the current preferred network mode.
  • Added NetworkModeController to build and execute network mode commands.
  • Added ShellValueParser to parse integer values from shell command output.

NetworkTileService Changes

  • Removed subscription ID resolution logic.
  • Removed physical SIM slot resolution logic.
  • Removed dumpsys isub command construction.
  • Removed preferred network mode readback command construction.
  • Removed network mode apply-command construction.
  • Removed shell-output parsing logic.
  • Updated the tile service to coordinate NetworkModeReader and NetworkModeController.
  • Updated mode application to use the structured CommandResult from Phase 2.

Behavior Preserved

  • Root and Shizuku execution modes remain unchanged.

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

  • Subscription IDs continue to be used for network mode readback.

  • Physical SIM slot indexes continue to be used for applying network modes.

  • Android 10 and newer continue to use direct active-subscription slot resolution where available.

  • Older Android versions continue to use the existing dumpsys isub fallback.

  • Auto SIM detection errors continue to show the existing Toast and persistent warning.

  • Cached tile-state behavior remains unchanged.

  • Existing tile labels and icons remain unchanged.

  • Existing Quick Settings cycle remains:

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

…NetworkTileService

- Removed SIM resolution and telephony shell-command construction from NetworkTileService.
- Updated NetworkTileService to coordinate the modular telephony components.
- Preserved existing Target SIM, readback, switching, cache, label, icon, and Auto SIM error behavior.
@Dhangofa
Dhangofa merged commit 3562134 into main Aug 11, 2026
2 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.

1 participant