Drop SSID display from settings, connection pill shows generic "Connected"

Real hardware testing (Pixel 10a) showed NetworkCapabilities.getTransportInfo()
consistently returns a redacted WifiInfo (SSID "<unknown ssid>", masked BSSID)
even for the app's own self-requested WifiNetworkSpecifier network, disproving
this codebase's prior assumption of a self-request exemption from
ACCESS_FINE_LOCATION for that API path (confirmed via native diagnostic
logging cross-checked against `adb shell dumpsys wifi`, which does show and
correctly attribute the true SSID at the OS level). Rather than add a location
permission with a runtime prompt purely for this cosmetic display, the
settings pill now just shows "Connected". Documented as decision 4.24.
This commit is contained in:
Constantin Leue
2026-08-06 22:24:03 +02:00
parent 221c0552d5
commit 539a6e4171
4 changed files with 28 additions and 26 deletions
@@ -136,7 +136,6 @@ class _WifiPanel extends ConsumerWidget {
final connectionSettings = ref.watch(connectionSettingsProvider).value;
final log = ref.watch(wifiConnectionLogProvider);
final packetCount = ref.watch(wifiPacketCountProvider);
final connectedSsid = ref.watch(wifiConnectedSsidProvider).value;
// telemetryProvider loest selbst keinen Verbindungsversuch aus, solange
// WLAN/MSP noch nicht ueber den "Connect"-Knopf verbunden ist (siehe
@@ -175,7 +174,14 @@ class _WifiPanel extends ConsumerWidget {
const Spacer(),
_StreamActivityPill(isReceiving: isReceiving, packetCount: packetCount),
const SizedBox(width: 6),
_StatePill(state: linkState, connectedLabel: connectedSsid ?? 'unknown'),
// Zeigt bewusst nur "Connected" statt "Connected to $ssid" (Doku
// Abschnitt 4: "SSID-Anzeige in den Settings aufgegeben") -
// NetworkCapabilities.getTransportInfo() liefert auf echter
// Hardware konsequent nur die redigierte SSID/BSSID
// ("<unknown ssid>"), siehe MlrsNetworkPlugin.ssidOf()-Doku fuer
// Details. Bewusst keine ACCESS_FINE_LOCATION-Berechtigung nur
// fuer diese kosmetische Anzeige hinzugefuegt.
_StatePill(state: linkState),
],
),
if (errorReason != null) ...[
@@ -385,22 +391,14 @@ class _StreamActivityPill extends StatelessWidget {
}
class _StatePill extends StatelessWidget {
const _StatePill({required this.state, this.connectedLabel});
const _StatePill({required this.state});
final LinkState? state;
/// WLAN-Netzname, falls bekannt - erscheint im verbundenen Zustand als
/// "Connected to {name}" statt des generischen "Connected" (Doku: "die
/// connected pille soll den WiFi-Namen anzeigen").
final String? connectedLabel;
@override
Widget build(BuildContext context) {
final (label, color) = switch (state) {
LinkState.connected => (
connectedLabel != null ? 'Connected to $connectedLabel' : 'Connected',
DmcColors.liveGreen,
),
LinkState.connected => ('Connected', DmcColors.liveGreen),
LinkState.connecting => ('Connecting…', DmcColors.pafAmber),
LinkState.error => ('Error', DmcColors.warnRed),
LinkState.disconnected || null => ('Disconnected', Colors.grey),