[Wi-Fi] Fix exception when 'Add device' with a Wi-Fi suggestion network
WifiEntry#getWifiConfiguration() may return null when WifiEntry#isSaved() is true. Use WifiEntry#canEasyConnect() which checks if WifiEntry#getWifiConfiguration() returns a non-null value. Bug: 153029289 Test: manual Connect to a WPA2 Wi-Fi network, click 'Add device' in Wi-Fi detail page and see if it crashes. Change-Id: Ia15503eea795fdd54826699828f02c9ff95dcefa
This commit is contained in:
@@ -51,8 +51,7 @@ public class AddDevicePreferenceController2 extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return WifiDppUtils.isSupportConfiguratorQrCodeScanner(mContext, mWifiEntry) ? AVAILABLE
|
||||
: CONDITIONALLY_UNAVAILABLE;
|
||||
return mWifiEntry.canEasyConnect() ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user