1 
2 package com.android.server.wifi;
3 
4 import java.io.FileDescriptor;
5 import java.io.PrintWriter;
6 
7 /**
8  *
9  */
10 public class BaseWifiDiagnostics {
11     public static final byte CONNECTION_EVENT_STARTED = 0;
12     public static final byte CONNECTION_EVENT_SUCCEEDED = 1;
13     public static final byte CONNECTION_EVENT_FAILED = 2;
14     public static final byte CONNECTION_EVENT_TIMEOUT = 3;
15 
16     protected final WifiNative mWifiNative;
17 
18     protected String mFirmwareVersion;
19     protected String mDriverVersion;
20     protected int mSupportedFeatureSet;
21 
BaseWifiDiagnostics(WifiNative wifiNative)22     public BaseWifiDiagnostics(WifiNative wifiNative) {
23         mWifiNative = wifiNative;
24     }
25 
startLogging(boolean verboseEnabled)26     public synchronized void startLogging(boolean verboseEnabled) {
27         mFirmwareVersion = mWifiNative.getFirmwareVersion();
28         mDriverVersion = mWifiNative.getDriverVersion();
29         mSupportedFeatureSet = mWifiNative.getSupportedLoggerFeatureSet();
30     }
31 
startPacketLog()32     public synchronized void startPacketLog() { }
33 
stopPacketLog()34     public synchronized void stopPacketLog() { }
35 
stopLogging()36     public synchronized void stopLogging() { }
37 
38     /**
39      * Inform the diagnostics module of a connection event.
40      * @param event The type of connection event (see CONNECTION_EVENT_* constants)
41      */
reportConnectionEvent(byte event)42     public synchronized void reportConnectionEvent(byte event) {}
43 
captureBugReportData(int reason)44     public synchronized void captureBugReportData(int reason) { }
45 
captureAlertData(int errorCode, byte[] alertData)46     public synchronized void captureAlertData(int errorCode, byte[] alertData) { }
47 
dump(FileDescriptor fd, PrintWriter pw, String[] args)48     public synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
49         dump(pw);
50         pw.println("*** logging disabled, no debug data ****");
51     }
52 
53     /**
54      * Starts taking a standard android bugreport
55      * android will prompt the user to send the bugreport when it's complete
56      * @param bugTitle Title of bugreport to generate
57      * @param bugDetail Description of the bugreport to generate
58      */
takeBugReport(String bugTitle, String bugDetail)59     public void takeBugReport(String bugTitle, String bugDetail) { }
60 
dump(PrintWriter pw)61     protected synchronized void dump(PrintWriter pw) {
62         pw.println("Chipset information :-----------------------------------------------");
63         pw.println("FW Version is: " + mFirmwareVersion);
64         pw.println("Driver Version is: " + mDriverVersion);
65         pw.println("Supported Feature set: " + mSupportedFeatureSet);
66     }
67 }