From 1eb4c9d55b8e15badb58d0531c1b20c54a54d0f8 Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Thu, 7 May 2020 12:26:24 +0000 Subject: Fix the potential NPE when starting provisioning with FILS. Starting provisioning with enabled FILS is unlike the normal case that always happens after L2 connection has been established, at this point we already know the current bssid. However, for FILS connection, the current bssid is still null when starting prov. Bug: 155696520 Test: atest NetworkStackTests NetworkStackIntegrationTests Merged-In: I3c29c6ad95c23cea2b3f374fb9dc35a8f54a6427 Change-Id: I3c29c6ad95c23cea2b3f374fb9dc35a8f54a6427 --- common/moduleutils/src/android/net/shared/Layer2Information.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'common/moduleutils/src') diff --git a/common/moduleutils/src/android/net/shared/Layer2Information.java b/common/moduleutils/src/android/net/shared/Layer2Information.java index 6825a93..fa4f102 100644 --- a/common/moduleutils/src/android/net/shared/Layer2Information.java +++ b/common/moduleutils/src/android/net/shared/Layer2Information.java @@ -16,6 +16,7 @@ package android.net.shared; +import android.annotation.Nullable; import android.net.Layer2InformationParcelable; import android.net.MacAddress; @@ -23,14 +24,18 @@ import java.util.Objects; /** @hide */ public class Layer2Information { + @Nullable public final String mL2Key; + @Nullable public final String mGroupHint; + @Nullable public final MacAddress mBssid; /** * Create a Layer2Information with the specified configuration. */ - public Layer2Information(String l2Key, String groupHint, MacAddress bssid) { + public Layer2Information(@Nullable final String l2Key, @Nullable final String groupHint, + @Nullable final MacAddress bssid) { mL2Key = l2Key; mGroupHint = groupHint; mBssid = bssid; @@ -41,7 +46,7 @@ public class Layer2Information { StringBuffer str = new StringBuffer(); str.append("L2Key: ").append(mL2Key); str.append(", GroupHint: ").append(mGroupHint); - str.append(", bssid: ").append(mBssid.toString()); + str.append(", bssid: ").append(mBssid); return str.toString(); } -- cgit v1.2.3