Conversation
- Removed direct Root and Shizuku command execution from NetworkTileService. - Removed the local CommandResult implementation and legacy stream-reading methods. - Routed shell commands through CommandExecutorFactory based on the selected execution mode. - Updated command handling to use the shared CommandResult model. - Updated command result access to use exit code, stdout, and success getters. - Preserved existing network mode readback, SIM resolution, tile state, and switching behavior.
- Corrected the broken newline character literal in StreamCollector. - Restored valid Java syntax for appending captured process output. - Fixes the Phase 2 release compilation failure.
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.
Summary
This PR completes Phase 2 of the NetToggle modular refactor by moving Root and Shizuku shell execution out of
NetworkTileServiceinto dedicated command modules.The refactor preserves the existing network-switching behavior while introducing structured command results for future error reporting.
New Command Modules
CommandExecutoras the shared execution interface.RootCommandExecutorfor commands executed throughsu.ShizukuCommandExecutorfor commands executed through Shizuku.CommandExecutorFactoryto select the appropriate executor from the saved execution mode.ProcessResultReaderto collect process results.StreamCollectorto read stdout and stderr concurrently.CommandResultto store:NetworkTileService Changes
CommandResultimplementation.CommandExecutorFactory.CommandResultmodel.Reliability Improvements
Behavior Preserved
Root execution mode
Shizuku execution mode
Auto Target SIM detection
Manual SIM 1 and SIM 2 selection
Subscription-ID based network mode readback
Physical-slot based network mode application
Cached Quick Settings tile state
Existing tile labels and icons
Existing mode cycle:
4G Only → 5G Only → Preferred 5G → Preferred 4G