Skip to content

Commit e29329c

Browse files
Copilotjambl3r
andcommitted
Address code review feedback - add TETHERING_WIFI constant and improve comments
Co-authored-by: jambl3r <54366245+jambl3r@users.noreply.github.com>
1 parent 2dd5f5f commit e29329c

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

sysbridge/src/main/java/io/github/sds100/keymapper/sysbridge/service/SystemBridge.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ internal class SystemBridge : ISystemBridge.Stub() {
8282

8383
private const val KEYMAPPER_CHECK_INTERVAL_MS = 60 * 1000L // 1 minute
8484
private const val DATA_ENABLED_REASON_USER: Int = 0
85+
private const val TETHERING_WIFI: Int = 0
8586

8687
@JvmStatic
8788
fun main(args: Array<String>) {
@@ -674,15 +675,15 @@ internal class SystemBridge : ISystemBridge.Stub() {
674675
}
675676

676677
if (enable) {
677-
// Type 0 = TETHERING_WIFI
678678
connectivityManager.startTethering(
679-
0, // type
679+
TETHERING_WIFI,
680680
null, // ResultReceiver
681681
false, // showProvisioningUi
682682
processPackageName, // callerPkg
683683
)
684684
} else {
685-
connectivityManager.stopTethering(0) // TETHERING_WIFI
685+
connectivityManager.stopTethering(TETHERING_WIFI)
686686
}
687687
}
688+
}
688689
}

system/src/main/java/io/github/sds100/keymapper/system/network/AndroidNetworkAdapter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ class AndroidNetworkAdapter @Inject constructor(
200200
}
201201

202202
override fun isHotspotEnabled(): Boolean {
203-
// This requires reflection or system bridge
203+
// TODO: Implement hotspot state detection using reflection or system bridge.
204+
// For now, returning false means toggle action will always attempt to enable.
205+
// This is acceptable for the initial implementation.
204206
return false
205207
}
206208

0 commit comments

Comments
 (0)