Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb3d1465 authored by yinxu's avatar yinxu
Browse files

Remove the main thread blocking call to get SSID

WifiManager#getConfiguredNetworks is a blocking call which may cause
main thread ANR, and the platform team also confirmed it is no longer
necessary to retrieve the SSID.

Bug: 183202291
Test: Unit tests
Change-Id: I089148cdb9900d7dc292dc8fc6d6f17302088e43
parent fa873e1c
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.net.NetworkKey;
import android.net.NetworkRequest;
import android.net.NetworkScoreManager;
import android.net.ScoredNetwork;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiNetworkScoreCache;
@@ -346,14 +345,6 @@ public class WifiStatusTracker {
        if (ssid != null && !WifiManager.UNKNOWN_SSID.equals(ssid)) {
            return ssid;
        }
        // OK, it's not in the connectionInfo; we have to go hunting for it
        List<WifiConfiguration> networks = mWifiManager.getConfiguredNetworks();
        int length = networks.size();
        for (int i = 0; i < length; i++) {
            if (networks.get(i).networkId == info.getNetworkId()) {
                return networks.get(i).SSID;
            }
        }
        return null;
    }