Skip to content

[Mobile App] Remove Wi-Fi sync (Fast Transfer) feature from iOS/Android app #6857

@aaravgarg

Description

@aaravgarg

Parent: #6854 | Hardware: #6855 | Firmware: #6856

Overview

Remove all Wi-Fi sync / "Fast Transfer" code from the Omi mobile app. BLE sync becomes the sole SD card transfer method. This can ship immediately — old devices without Wi-Fi firmware are already unaffected.

Files to DELETE Entirely

File Lines Purpose
services/devices/wifi_sync_error.dart 127 Wi-Fi sync error codes, WifiSyncSetupResult, WifiSyncErrorCode enum
services/wifi/wifi_network_service.dart 175 Phone Wi-Fi AP connection management (connect to device AP, disconnect)
services/devices/transports/tcp_transport.dart 196 TCP socket transport for Wi-Fi data transfer (port 12345)
pages/conversations/sync_widgets/wifi_connection_sheet.dart 349 Bottom sheet UI for Wi-Fi connection setup (SSID/password input)
pages/conversations/fast_transfer_settings_page.dart 255 Fast Transfer settings page (accessible from device settings)
pages/conversations/sync_widgets/fast_transfer_suggestion_dialog.dart 108 Dialog suggesting user try Fast Transfer instead of BLE

Total: ~1,210 lines of dead code removed.

Files to MODIFY

services/devices/models.dart

  • Remove BLE characteristic UUID for Wi-Fi (line 32):
    // DELETE:
    const String storageWifiCharacteristicUuid = '30295783-4301-eabd-2904-2849adfeae43';

services/devices.dart

  • Remove OmiFeatures.wifi flag (line 56):
    // DELETE:
    static const int wifi = 1 << 9;
  • Remove Wi-Fi sync in-progress state tracking (lines ~32, 280)

services/devices/device_connection.dart

  • Remove all Wi-Fi sync method declarations:
    • isWifiSyncSupported() / performIsWifiSyncSupported()
    • setupWifiSync(ssid, password) / performSetupWifiSync()
    • startWifiSync() / performStartWifiSync()
    • stopWifiSync() / performStopWifiSync()
    • getWifiSyncStatusListener() / performGetWifiSyncStatusListener()
  • Remove wifi_sync_error.dart import

services/devices/omi_connection.dart

  • Remove Wi-Fi sync method overrides (lines ~810-935):
    • performIsWifiSyncSupported() — checks OmiFeatures.wifi flag
    • performSetupWifiSync() — sends BLE command 0x01 with SSID/password to storageWifiCharacteristicUuid
    • performStartWifiSync() — sends 0x02
    • performStopWifiSync() — sends 0x03
    • performGetWifiSyncStatusListener() — listens on storageWifiCharacteristicUuid for status updates (OFF=0, SHUTDOWN=1, ON=2, CONNECTING=3, CONNECTED=4, TCP_CONNECTED=5)

services/devices/omiglass_connection.dart

  • Remove Wi-Fi credential methods for OTA updates (lines ~42-46, 248-278, 392-403):
    • WiFi connection status strings ('Connecting to WiFi...', 'WiFi connected', etc.)
    • setWifiCredentials() method
    • Wi-Fi-based OTA update flow

services/devices/discovery/device_locator.dart

  • Remove TransportKind.wifi from enum (line 1)
  • Remove DeviceLocator.wifi() factory constructor (lines 9, 26-27)
  • Remove wifi case in switch (lines 45-46)

services/wals/wal.dart

  • Simplify SyncMethod enum (line 16): remove wifi, keep only ble
  • Remove or simplify syncMethod field (line 80)

services/wals/wal_interfaces.dart

  • Remove Wi-Fi connection progress listener interface (line 22)

services/wals/sdcard_wal_sync.dart (biggest change)

Remove all Wi-Fi sync logic:

  • Remove imports: tcp_transport.dart, wifi_sync_error.dart, wifi_network_service.dart
  • Remove _activeTcpTransport field and TCP transport cleanup
  • Remove Wi-Fi speed tracking: _wifiSpeedWindowStart, _wifiSpeedWindowBytes, speed calculation methods
  • Remove entire Wi-Fi sync flow (~lines 950-1200): credentials setup, Wi-Fi AP connection, TCP server creation, data transfer over TCP, cleanup
  • Remove _cleanupWifiSync() helper method
  • Remove isWifiSyncSupported() method
  • Keep only BLE sync path (the _syncViaBle() flow)

services/wals/wal_syncs.dart

  • Remove any Wi-Fi sync method routing

pages/conversations/sync_page.dart

  • Remove imports: wifi_connection_sheet.dart, fast_transfer_settings_page.dart, fast_transfer_suggestion_dialog.dart
  • Remove BLE/Fast Transfer toggle UI (lines ~375-405)
  • Remove Wi-Fi sync color coding (blue=wifi, orange=BLE — lines 234-237, 258)
  • Remove FastTransferSuggestionDialog.show() logic (lines ~562-571)
  • Remove Wi-Fi error message detection and display (lines ~599-623)
  • Simplify: all syncs are BLE, single color, no toggle

pages/settings/device_settings.dart

  • Remove Wi-Fi Sync settings tile (lines ~338-343 — the FontAwesomeIcons.wifi tile)
  • Remove _isWifiSupported state variable and the isWifiSyncSupported() check on device connect

pages/conversations/wal_item_detail/wal_item_detail_page.dart

  • Remove Wi-Fi sync method references

pages/home/firmware_update_dialog.dart & omiglass_ota_update.dart

  • Remove any Wi-Fi OTA update paths/references

pages/sdcard/about_sdcard_sync.dart

  • Remove any Fast Transfer/Wi-Fi references from help text

pages/home/page.dart

  • Remove any Wi-Fi sync state references

providers/sync_provider.dart

  • Remove Wi-Fi error message conversion (lines ~299-305)

backend/preferences.dart

  • Remove preferred sync method preference (lines 314-317):
    // DELETE:
    String get preferredSyncMethod => ...
    set preferredSyncMethod(String value) => ...

models/sync_state.dart

  • Remove any Wi-Fi sync state references

services/connectivity_service.dart

  • Line 61: result.contains(ConnectivityResult.wifi)KEEP THIS. It's checking phone internet connectivity, not Omi Wi-Fi sync. Unrelated.

Localization files (l10n/app_localizations_*.dart)

  • Remove Wi-Fi sync translation keys from the base ARB file (app_en.arb):
    • wifiSync, wifiEnableFailed, fast (if Fast Transfer only), and any other Wi-Fi transfer strings
    • Then regenerate all ~50 localization files

Migration / Backward Compatibility

  • Stale SharedPreferences: Users who had preferredSyncMethod = 'wifi' stored locally. The app should handle this gracefully:
    • Option A: Ignore the preference entirely (default to BLE always)
    • Option B: Clear it on app upgrade
    • Either way, must not crash if the old value exists
  • Old devices: Devices running firmware that still has Wi-Fi BLE characteristics will simply never receive Wi-Fi commands. No impact.
  • No data migration needed — Wi-Fi was only a transport, data format is identical regardless of sync method.

Testing Checklist

  • App compiles with zero Wi-Fi references (search for "wifi", "WiFi", "wifiSync", "fast_transfer", "TcpTransport" — should find nothing except ConnectivityResult.wifi)
  • BLE SD card sync works end-to-end
  • Sync page renders correctly (no toggle, no Fast Transfer references)
  • Device settings page renders without Wi-Fi tile
  • WAL item detail page shows correct sync info
  • No crash when old preferredSyncMethod=wifi exists in SharedPreferences
  • No crash when connecting to old firmware that exposes Wi-Fi BLE characteristic
  • All 50+ localization files compile after key removal
  • OTA firmware update works via BLE path
  • About SD card sync page renders correctly

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions