fix WifiUtils:isNetworkLockedDown() null pointer issue

In the WifiUtils class, the isNetworkLockedDown() method does not
determine whether the context is empty, which will cause a null
pointer exception. This change adds a condition for judging the
input context as empty.

Bug:261812909
Test:make RunSettingsRoboTests
Change-Id: Ie0f17179c25a7e9d4b2f652a5667eef3cc577c7b
Signed-off-by: xuelin <xuelin@xiaomi.corp-partner.google.com>
This commit is contained in:
xuelin
2022-12-08 09:49:35 +08:00
parent eef6d0cb24
commit 688e61a4c6

View File

@@ -86,7 +86,7 @@ public class WifiUtils extends com.android.settingslib.wifi.WifiUtils {
* @return true if Settings cannot modify the config due to lockDown.
*/
public static boolean isNetworkLockedDown(Context context, WifiConfiguration config) {
if (config == null) {
if (context == null || config == null) {
return false;
}