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:
@@ -35,15 +35,6 @@ final wifiLinkErrorReasonProvider = Provider<LinkErrorReason?>((ref) {
|
||||
return ref.watch(wifiTransportProvider).lastErrorReason;
|
||||
});
|
||||
|
||||
/// Reaktive tatsaechliche SSID des verbundenen Netzes (Doku: "connected
|
||||
/// pille soll den WiFi-Namen anzeigen") - eigener Stream statt Ableitung aus
|
||||
/// [wifiLinkStateProvider], weil Android die SSID fuer WifiNetworkSpecifier-
|
||||
/// Netze oft erst nachtraeglich liefert (siehe UdpTransport.connectedSsidChanges/
|
||||
/// MlrsNetworkPlugin.kt), also ohne begleitenden LinkState-Wechsel.
|
||||
final wifiConnectedSsidProvider = StreamProvider<String?>((ref) {
|
||||
final transport = ref.watch(wifiTransportProvider);
|
||||
return transport.connectedSsidChanges;
|
||||
});
|
||||
|
||||
/// Zeigt an, ob gerade UDP-Pakete ankommen ("receiving"/"not receiving"),
|
||||
/// unabhaengig vom (binaeren) Verbindungszustand - der Socket kann offen
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user