Skip to content

Commit d4eba61

Browse files
committed
#2026 log extra information about system bridge auto starting
1 parent e1ea8f5 commit d4eba61

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

base/src/main/java/io/github/sds100/keymapper/base/BootBroadcastReceiver.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@ package io.github.sds100.keymapper.base
33
import android.content.BroadcastReceiver
44
import android.content.Context
55
import android.content.Intent
6+
import android.os.SystemClock
7+
import timber.log.Timber
68

79
class BootBroadcastReceiver : BroadcastReceiver() {
810
override fun onReceive(context: Context?, intent: Intent?) {
911
context ?: return
1012

11-
if (intent?.action == Intent.ACTION_LOCKED_BOOT_COMPLETED) {
12-
(context.applicationContext as? BaseKeyMapperApp)?.onBootUnlocked()
13+
when (intent?.action) {
14+
Intent.ACTION_BOOT_COMPLETED -> {
15+
Timber.i(
16+
"Boot completed broadcast: time since boot = ${SystemClock.elapsedRealtime() / 1000}",
17+
)
18+
}
19+
20+
Intent.ACTION_LOCKED_BOOT_COMPLETED -> {
21+
(context.applicationContext as? BaseKeyMapperApp)?.onBootUnlocked()
22+
}
1323
}
1424
}
1525
}

base/src/main/java/io/github/sds100/keymapper/base/expertmode/SystemBridgeAutoStarter.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,17 @@ class SystemBridgeAutoStarter @Inject constructor(
110110

111111
useShizukuFlow.flatMapLatest { useShizuku ->
112112
if (useShizuku) {
113+
Timber.i("autoStartTypeFlow: Use shizuku")
113114
flowOf(AutoStartEligibility.Eligible(AutoStartType.SHIZUKU))
114115
} else if (buildConfig.sdkInt >= Build.VERSION_CODES.R) {
116+
Timber.i("autoStartTypeFlow: Do not use shizuku")
115117
combine(
116118
permissionAdapter.isGrantedFlow(Permission.WRITE_SECURE_SETTINGS),
117119
networkAdapter.isWifiConnected,
118120
) { isWriteSecureSettingsGranted, isWifiConnected ->
121+
Timber.i(
122+
"autoStartTypeFlow: Write secure settings: $isWriteSecureSettingsGranted, Wifi connected: $isWifiConnected",
123+
)
119124
when {
120125
!isWifiConnected -> {
121126
AutoStartEligibility.NotEligible.WiFiDisconnected

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ class SystemBridgeSetupControllerImpl @Inject constructor(
285285
isAdbPairedJob?.cancel()
286286
isAdbPairedResult.value = null
287287

288+
Timber.d("Launching isAdbPaired job")
288289
isAdbPairedJob = coroutineScope.launch {
290+
Timber.d("Enabling wireless ADB")
289291
SettingsUtils.putGlobalSetting(ctx, ADB_WIRELESS_SETTING, 1)
290292

291293
// Try running a command to see if the pairing is working correctly.

0 commit comments

Comments
 (0)