From 9dadaed712f71eba424cb75d2921d72d76f15391 Mon Sep 17 00:00:00 2001 From: Arc Wang Date: Wed, 3 Jun 2020 14:53:04 +0800 Subject: [WifiTrackerLib] Settings APP crashes after clicking a Passpoint2.0 Wi-Fi network twice After the 1st click, WifiPickerTracker#getConnectedWifiEntry() will return the passpoint2.0 OsuWifiEntry, however, NetworkDetailsTracker only supports the key of a StandardWifiEntry or PasspointWifiEntry. NetworkDetailsTracker throws below exception when it gets a key of OsuWifiEntry. This change prevents a OsuWifiEntry to be returned by WifiPickerTracker#getConnectedWifiEntry(). After the 1st click, the OsuWifiEntry will disappear on WifiPicker and then it's online sign up screen shows. Bug: 158055954 Test: manual visual Click a OsuWifiEntry twice before it's online sign up screen shows. After users go back to Wi-Fi picker from the online sign up screen, the result may be: 1. If sign up failed, the OsuWifiEntry shows with the summary "Couldn't connect". 2. If sign up success, there is a connected/connecting PasspointWifiEntry. Change-Id: I89a16c51b001d16c1a5e2f4a8b0f0f942ce8ec72 --- .../src/com/android/wifitrackerlib/WifiPickerTracker.java | 7 ------- 1 file changed, 7 deletions(-) (limited to 'libs') diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiPickerTracker.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiPickerTracker.java index 734779a2d..5686cd727 100644 --- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiPickerTracker.java +++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiPickerTracker.java @@ -320,13 +320,6 @@ public class WifiPickerTracker extends BaseWifiTracker { || connectedState == CONNECTED_STATE_CONNECTING; }).findAny().orElse(null /* other */); } - if (mConnectedWifiEntry == null) { - mConnectedWifiEntry = mOsuWifiEntryCache.values().stream().filter(entry -> { - final @WifiEntry.ConnectedState int connectedState = entry.getConnectedState(); - return connectedState == CONNECTED_STATE_CONNECTED - || connectedState == CONNECTED_STATE_CONNECTING; - }).findAny().orElse(null /* other */); - } if (mConnectedWifiEntry == null && mNetworkRequestEntry != null && mNetworkRequestEntry.getConnectedState() != CONNECTED_STATE_DISCONNECTED) { mConnectedWifiEntry = mNetworkRequestEntry; -- cgit v1.2.3