Wifi aware skip bluetooth (#538)

* unify connection tracker for ble and wifi

* bluetooth optional
This commit is contained in:
callebtc
2026-01-04 02:02:24 +07:00
committed by GitHub
parent 12eb3e5a91
commit 35030a05d8
37 changed files with 89 additions and 18 deletions
@@ -266,6 +266,10 @@ class MainActivity : OrientationAwareActivity() {
onRetry = {
checkBluetoothAndProceed()
},
onSkip = {
mainViewModel.skipBluetoothCheck()
checkLocationAndProceed()
},
isLoading = isBluetoothLoading
)
}
@@ -384,6 +388,13 @@ class MainActivity : OrientationAwareActivity() {
private fun checkBluetoothAndProceed() {
// Log.d("MainActivity", "Checking Bluetooth status")
// Check if user has skipped Bluetooth check for this session
if (mainViewModel.isBluetoothCheckSkipped.value) {
Log.d("MainActivity", "Bluetooth check skipped by user, proceeding to location check")
checkLocationAndProceed()
return
}
// For first-time users, skip Bluetooth check and go straight to permissions
// We'll check Bluetooth after permissions are granted
if (permissionManager.isFirstTimeLaunch()) {
@@ -754,7 +765,7 @@ class MainActivity : OrientationAwareActivity() {
// Check if Bluetooth was disabled while app was backgrounded
val currentBluetoothStatus = bluetoothStatusManager.checkBluetoothStatus()
if (currentBluetoothStatus != BluetoothStatus.ENABLED) {
if (currentBluetoothStatus != BluetoothStatus.ENABLED && !mainViewModel.isBluetoothCheckSkipped.value) {
Log.w("MainActivity", "Bluetooth disabled while app was backgrounded")
mainViewModel.updateBluetoothStatus(currentBluetoothStatus)
mainViewModel.updateOnboardingState(OnboardingState.BLUETOOTH_CHECK)