Wifi diagnostic app to enable debug and provide information

This is the first checkin on the wifi diagnostic app. Right now,
it supports using the WifiManager API, shows the configuration details
and provides status on the supplicant, network and wifi state along with
some additional details.

More to come:
- add more API and status on any additional fields
- provide a way to show some logs

Bug: 2302130
This commit is contained in:
Irfan Sheriff
2009-12-03 10:53:50 -08:00
parent d6e36463ea
commit 2ff62e2c7b
11 changed files with 1034 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.wifi;
import android.app.Activity;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.widget.TextView;
import android.net.wifi.WifiConfiguration;
import java.util.List;
import com.android.settings.R;
/**
* Configuration details saved by the user on the WifiSettings screen
*/
public class WifiConfigInfo extends Activity {
private static final String TAG = "WifiConfigInfo";
private TextView mConfigList;
private WifiManager mWifiManager;
//============================
// Activity lifecycle
//============================
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
setContentView(R.layout.wifi_config_info);
mConfigList = (TextView) findViewById(R.id.config_list);
}
@Override
protected void onResume() {
super.onResume();
final List<WifiConfiguration> wifiConfigs = mWifiManager.getConfiguredNetworks();
StringBuffer configList = new StringBuffer();
for (int i = wifiConfigs.size() - 1; i >= 0; i--) {
configList.append(wifiConfigs.get(i));
}
mConfigList.setText(configList);
}
}