Skip to content

Commit f14d5a7

Browse files
committed
#1964 feat: show the command to start Expert Mode with a shell command
1 parent 75952ab commit f14d5a7

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ private fun LoadedContent(
463463
buttonText = setupKeyMapperText,
464464
onButtonClick = onSetupWithKeyMapperClick,
465465
enabled =
466-
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
467-
state.isNotificationPermissionGranted,
466+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
467+
state.isNotificationPermissionGranted,
468468
isLoading = state.isStarting,
469469
)
470470

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import io.github.sds100.keymapper.base.utils.ui.ResourceProvider
1414
import io.github.sds100.keymapper.common.utils.State
1515
import io.github.sds100.keymapper.common.utils.Success
1616
import io.github.sds100.keymapper.common.utils.valueOrNull
17+
import javax.inject.Inject
1718
import kotlinx.coroutines.ExperimentalCoroutinesApi
1819
import kotlinx.coroutines.delay
1920
import kotlinx.coroutines.flow.Flow
@@ -28,7 +29,6 @@ import kotlinx.coroutines.flow.flowOf
2829
import kotlinx.coroutines.flow.map
2930
import kotlinx.coroutines.flow.stateIn
3031
import kotlinx.coroutines.launch
31-
import javax.inject.Inject
3232

3333
@HiltViewModel
3434
class ExpertModeViewModel @Inject constructor(
@@ -202,8 +202,8 @@ class ExpertModeViewModel @Inject constructor(
202202
) { autoStartBootChecked, autoStartBootEnabled, isAdbInputSecurityEnabled ->
203203
ExpertModeState.Started(
204204
isDefaultUsbModeCompatible =
205-
useCase.isCompatibleUsbModeSelected().valueOrNull()
206-
?: false,
205+
useCase.isCompatibleUsbModeSelected().valueOrNull()
206+
?: false,
207207
autoStartBootChecked = autoStartBootChecked,
208208
autoStartBootEnabled = autoStartBootEnabled,
209209
isAdbInputSecurityEnabled = isAdbInputSecurityEnabled,

sysbridge/src/main/java/io/github/sds100/keymapper/sysbridge/manager/SystemBridgeConnectionManager.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import io.github.sds100.keymapper.common.utils.SettingsUtils
2424
import io.github.sds100.keymapper.common.utils.Success
2525
import io.github.sds100.keymapper.common.utils.firstBlocking
2626
import io.github.sds100.keymapper.common.utils.onFailure
27-
import io.github.sds100.keymapper.common.utils.then
28-
import io.github.sds100.keymapper.common.utils.valueOrNull
2927
import io.github.sds100.keymapper.data.Keys
3028
import io.github.sds100.keymapper.data.repositories.PreferenceRepository
3129
import io.github.sds100.keymapper.sysbridge.ISystemBridge
@@ -41,7 +39,6 @@ import kotlinx.coroutines.flow.filterIsInstance
4139
import kotlinx.coroutines.flow.first
4240
import kotlinx.coroutines.flow.update
4341
import kotlinx.coroutines.launch
44-
import kotlinx.coroutines.runBlocking
4542
import timber.log.Timber
4643

4744
/**
@@ -70,7 +67,7 @@ class SystemBridgeConnectionManagerImpl @Inject constructor(
7067
time = SystemClock.elapsedRealtime(),
7168
// Get whether the user previously stopped the system bridge.
7269
isStoppedByUser =
73-
preferences.get(Keys.isSystemBridgeStoppedByUser).firstBlocking() ?: false,
70+
preferences.get(Keys.isSystemBridgeStoppedByUser).firstBlocking() ?: false,
7471
),
7572
)
7673
private var isExpectedDeath: Boolean = false

0 commit comments

Comments
 (0)