1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.server.wifi;
18 
19 import android.annotation.NonNull;
20 import android.net.wifi.WifiSsid;
21 
22 import java.util.BitSet;
23 
24 /** Data class to hold information for a {@link WifiMonitor#NETWORK_CONNECTION_EVENT}. */
25 public class NetworkConnectionEventInfo {
26     public final int networkId;
27     @NonNull
28     public final WifiSsid wifiSsid;
29     @NonNull
30     public final String bssid;
31     public final boolean isFilsConnection;
32     public final BitSet keyMgmtMask;
33 
NetworkConnectionEventInfo(int networkId, WifiSsid wifiSsid, String bssid, boolean isFilsConnection, BitSet keyMgmtMask)34     public NetworkConnectionEventInfo(int networkId, WifiSsid wifiSsid, String bssid,
35             boolean isFilsConnection, BitSet keyMgmtMask) {
36         this.networkId = networkId;
37         this.wifiSsid = wifiSsid;
38         this.bssid = bssid;
39         this.isFilsConnection = isFilsConnection;
40         this.keyMgmtMask = keyMgmtMask;
41     }
42 
43     @Override
toString()44     public String toString() {
45         return "NetworkConnectionEventInfo{"
46                 + "networkId=" + networkId
47                 + ", wifiSsid=" + wifiSsid
48                 + ", bssid='" + bssid + '\''
49                 + ", isFilsConnection=" + isFilsConnection
50                 + ", keyMgmtMask=" + keyMgmtMask
51                 + '}';
52     }
53 }
54