mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 08:25:22 +00:00
Wifi aware skip bluetooth (#538)
* unify connection tracker for ble and wifi * bluetooth optional
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user