passpoint:  Fix continuous crash of Passpoint network score calculation

The Wi-Fi Access Point Aruba620 causes trailing continuous NullPointerException.

--------- beginning of crash
*** FATAL EXCEPTION IN SYSTEM PROCESS: WifiStateMachine
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
com.android.server.wifi.hotspot2.PasspointNetworkScore.calculateScore(PasspointNetworkScore.java:159)
com.android.server.wifi.hotspot2.PasspointNetworkEvaluator.findBestNetwork(PasspointNetworkEvaluator.java:183)
com.android.server.wifi.hotspot2.PasspointNetworkEvaluator.evaluateNetworks(PasspointNetworkEvaluator.java:112)
com.android.server.wifi.WifiNetworkSelector.selectNetwork(WifiNetworkSelector.java:526)
at com.android.server.wifi.WifiConnectivityManager.handleScanResults(WifiConnectivityManager.java:263)

This is because the AP sends invalid Access network type in Interwoking Element.
To fix the issue, we need to define score for reserved bits and add null
check condition.

Bug: 110476382
Test: /frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I973ea316290b023f3b7e816a9f6eba9da22cbc72
Signed-off-by: Ecco Park <eccopark@google.com>
2 files changed