Skip to content

fix(automation): make Turn On/Off Hotspot actually tether - #1289

Merged
sameerasw merged 3 commits into
sameerasw:developfrom
xav-ie:fix/hotspot-tethering
Oct 8, 2026
Merged

sameerasw merged 3 commits into
sameerasw:developfrom
xav-ie:fix/hotspot-tethering

Conversation

@xav-ie

@xav-ie xav-ie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Description

The DIY actions "Turn On / Turn Off / Toggle Hotspot" run cmd wifi start-softap / stop-softap with no arguments. start-softap requires <ssid> <security> <passphrase>, so the command fails and nothing happens. Even with arguments it wouldn't help, since its help text says "the shell command doesn't activate internet tethering" (WifiShellCommand.java).

New domain/controller/HotspotController calls ITetheringConnector.startTethering / stopTethering through ShizukuBinderWrapper, using the same reflection pattern as DataSimController. This is the tethering service the Settings hotspot toggle uses, so carrier entitlement checks run as usual.

  • Handles the Android 11 signatures and the Android 12+ ones that add callingAttributionTag (ITetheringConnector.aidl).
  • Calls as com.android.shell, which holds TETHER_PRIVILEGED (Shell manifest).
  • A non-zero tethering result shows a toast (new string hotspot_tethering_failed).
  • Without Shizuku permission, below API 30, or if the binder call throws, the previous shell path is kept, along with its Shizuku notifications.

Not covered:

  • Root mode without Shizuku still uses the shell command.
  • Root-mode Shizuku passes root as the caller package; untested.
  • Like DataSimController, this relies on Shizuku's cached service binder, which isn't re-fetched if it dies.

Type of change

  • Bug fix
  • New feature
  • UI / visual update
  • Performance improvement
  • Refactoring / cleanup
  • Translations
  • Build / CI tooling

UI changes

None, apart from a toast when tethering fails.

Checklist

  • The base branch is set to develop (not main).
  • The app builds cleanly locally with ./gradlew assembleDebug.
  • Unit tests pass with ./gradlew testDebugUnitTest.
  • You tested the changes on a device or emulator (including Shizuku or Root if applicable). Pixel 11 Pro, Android 17, Shizuku running as shell (adb): Turn On and Turn Off both return result 0, and dumpsys tethering shows Wi-Fi TETHERED with internet sharing. Root-mode Shizuku is untested.
  • New preferences use SettingsRepository for keys and getter/setter methods. (N/A, no new preferences)
  • New user-facing settings are registered in FeatureRegistry.kt for search indexing. (N/A)
  • New UI follows the design system in ui/core/. (N/A)
  • Strings are added to res/values/strings.xml and drawables use rounded variants (R.drawable.rounded_*).

Start and stop tethering over a Shizuku binder instead of the argument-less `cmd wifi start-softap`, which failed and never shared internet anyway.
@xav-ie
xav-ie marked this pull request as ready for review October 7, 2026 18:42
@xav-ie
xav-ie requested a review from sameerasw as a code owner October 7, 2026 18:42
# Conflicts:
#	app/src/main/java/com/sameerasw/essentials/services/automation/executors/CombinedActionExecutor.kt
…ntroller

- Use the Shizuku binder path only when the resolved mode is Shizuku or Porter
- Add the file header and trim the comments to single lines

@sameerasw sameerasw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions <3

@sameerasw sameerasw added the bug Something isn't working label Oct 8, 2026
@sameerasw
sameerasw merged commit a2bf6ac into sameerasw:develop Oct 8, 2026
@github-project-automation github-project-automation Bot moved this from In review to Done in Essentials Progress Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants