• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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 package com.android.server.wifi;
17 
18 import android.annotation.NonNull;
19 
20 import java.util.Objects;
21 
22 /**
23  * Stores disconnect information passed from WifiMonitor.
24  */
25 public class DisconnectEventInfo {
26     @NonNull public final String ssid;
27     @NonNull public final String bssid;
28     public final int reasonCode;
29     public final boolean locallyGenerated;
30 
DisconnectEventInfo(@onNull String ssid, @NonNull String bssid, int reasonCode, boolean locallyGenerated)31     public DisconnectEventInfo(@NonNull String ssid, @NonNull String bssid, int reasonCode,
32             boolean locallyGenerated) {
33         this.ssid = Objects.requireNonNull(ssid);
34         this.bssid = Objects.requireNonNull(bssid);
35         this.reasonCode = reasonCode;
36         this.locallyGenerated = locallyGenerated;
37     }
38 
39     @Override
toString()40     public String toString() {
41         StringBuffer sb = new StringBuffer();
42         sb.append(" ssid: ").append(ssid);
43         sb.append(" bssid: ").append(bssid);
44         sb.append(" reasonCode: ").append(reasonCode);
45         sb.append(" locallyGenerated: ").append(locallyGenerated);
46         return sb.toString();
47     }
48 }
49