diff options
author | Mingguang Xu <mingguangxu@google.com> | 2020-02-25 15:04:40 -0800 |
---|---|---|
committer | Mingguang Xu <mingguangxu@google.com> | 2020-02-25 23:55:16 +0000 |
commit | 5a762475e93aa4bbcbc6d35120f5c61d7c200ab8 (patch) | |
tree | 922cfb9e402ce7d6c478b9e97a7ef53bea7197d5 /service | |
parent | b66edf6a39b0038c885b98134679d491ddfffd84 (diff) |
Extension API: Add null check to prevent NPE before resetting velocity
based scorer
Test: atest com.android.server.wifi
Bug: 135573686
Bug: 122133502
Bug: 136312816
Bug: 135572156
Bug: 150238445
Change-Id: Iee7ca0d7b019361fc63744ae9a8b214a4b209e56
Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiScoreReport.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiScoreReport.java b/service/java/com/android/server/wifi/WifiScoreReport.java index 34ef25637..b7dc2098f 100644 --- a/service/java/com/android/server/wifi/WifiScoreReport.java +++ b/service/java/com/android/server/wifi/WifiScoreReport.java @@ -260,7 +260,9 @@ public class WifiScoreReport { mScore = ConnectedScore.WIFI_MAX_SCORE; mLastKnownNudCheckScore = ConnectedScore.WIFI_TRANSITION_SCORE; mAggressiveConnectedScore.reset(); - mVelocityBasedConnectedScore.reset(); + if (mVelocityBasedConnectedScore != null) { + mVelocityBasedConnectedScore.reset(); + } mLastDownwardBreachTimeMillis = 0; mLastExitingTimeMillis = INVALID_WALL_CLOCK_MILLIS; if (mVerboseLoggingEnabled) Log.d(TAG, "reset"); |