Merge "adding debug information to bug report for Bug:16751877" into lmp-dev
This commit is contained in:
@ -70,6 +70,12 @@ public class ScanResult implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public long seen;
|
public long seen;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the scan result is a valid autojoin candidate
|
||||||
|
* {@hide}
|
||||||
|
*/
|
||||||
|
public int isAutoJoinCandidate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
* Update RSSI of the scan result
|
* Update RSSI of the scan result
|
||||||
@ -263,6 +269,7 @@ public class ScanResult implements Parcelable {
|
|||||||
numConnection = source.numConnection;
|
numConnection = source.numConnection;
|
||||||
numUsage = source.numUsage;
|
numUsage = source.numUsage;
|
||||||
numIpConfigFailures = source.numIpConfigFailures;
|
numIpConfigFailures = source.numIpConfigFailures;
|
||||||
|
isAutoJoinCandidate = source.isAutoJoinCandidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +335,7 @@ public class ScanResult implements Parcelable {
|
|||||||
dest.writeInt(numConnection);
|
dest.writeInt(numConnection);
|
||||||
dest.writeInt(numUsage);
|
dest.writeInt(numUsage);
|
||||||
dest.writeInt(numIpConfigFailures);
|
dest.writeInt(numIpConfigFailures);
|
||||||
|
dest.writeInt(isAutoJoinCandidate);
|
||||||
if (informationElements != null) {
|
if (informationElements != null) {
|
||||||
dest.writeInt(informationElements.length);
|
dest.writeInt(informationElements.length);
|
||||||
for (int i = 0; i < informationElements.length; i++) {
|
for (int i = 0; i < informationElements.length; i++) {
|
||||||
@ -364,6 +372,7 @@ public class ScanResult implements Parcelable {
|
|||||||
sr.numConnection = in.readInt();
|
sr.numConnection = in.readInt();
|
||||||
sr.numUsage = in.readInt();
|
sr.numUsage = in.readInt();
|
||||||
sr.numIpConfigFailures = in.readInt();
|
sr.numIpConfigFailures = in.readInt();
|
||||||
|
sr.isAutoJoinCandidate = in.readInt();
|
||||||
int n = in.readInt();
|
int n = in.readInt();
|
||||||
if (n != 0) {
|
if (n != 0) {
|
||||||
sr.informationElements = new InformationElement[n];
|
sr.informationElements = new InformationElement[n];
|
||||||
|
@ -29,6 +29,9 @@ import android.annotation.SystemApi;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class representing a configured Wi-Fi network, including the
|
* A class representing a configured Wi-Fi network, including the
|
||||||
@ -908,13 +911,46 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @hide */
|
||||||
|
private ArrayList<ScanResult> sortScanResults() {
|
||||||
|
ArrayList<ScanResult> list = new ArrayList<ScanResult>(this.scanResultCache.values());
|
||||||
|
if (list.size() != 0) {
|
||||||
|
Collections.sort(list, new Comparator() {
|
||||||
|
public int compare(Object o1, Object o2) {
|
||||||
|
ScanResult a = (ScanResult)o1;
|
||||||
|
ScanResult b = (ScanResult)o2;
|
||||||
|
if (a.numIpConfigFailures > b.numIpConfigFailures) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (a.numIpConfigFailures < b.numIpConfigFailures) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.seen > b.seen) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.seen < b.seen) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (a.level > b.level) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.level < b.level) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return a.BSSID.compareTo(b.BSSID);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sbuf = new StringBuilder();
|
StringBuilder sbuf = new StringBuilder();
|
||||||
if (this.status == WifiConfiguration.Status.CURRENT) {
|
if (this.status == WifiConfiguration.Status.CURRENT) {
|
||||||
sbuf.append("* ");
|
sbuf.append("* ");
|
||||||
} else if (this.status == WifiConfiguration.Status.DISABLED) {
|
} else if (this.status == WifiConfiguration.Status.DISABLED) {
|
||||||
sbuf.append("- DSBLE");
|
sbuf.append("- DSBLE ");
|
||||||
}
|
}
|
||||||
sbuf.append("ID: ").append(this.networkId).append(" SSID: ").append(this.SSID).
|
sbuf.append("ID: ").append(this.networkId).append(" SSID: ").append(this.SSID).
|
||||||
append(" BSSID: ").append(this.BSSID).append(" FQDN: ").append(this.FQDN).
|
append(" BSSID: ").append(this.BSSID).append(" FQDN: ").append(this.FQDN).
|
||||||
@ -1061,20 +1097,40 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.scanResultCache != null) {
|
if (this.scanResultCache != null) {
|
||||||
sbuf.append("Scan Cache: ");
|
sbuf.append("Scan Cache: ").append('\n');
|
||||||
for(ScanResult result : this.scanResultCache.values()) {
|
ArrayList<ScanResult> list = sortScanResults();
|
||||||
sbuf.append("{").append(result.BSSID).append(",").append(result.frequency);
|
if (list.size() > 0) {
|
||||||
sbuf.append(",").append(result.level);
|
for (ScanResult result : list) {
|
||||||
if (result.autoJoinStatus > 0) {
|
long milli = now_ms - result.seen;
|
||||||
sbuf.append(",st=").append(result.autoJoinStatus);
|
long ageSec = 0;
|
||||||
|
long ageMin = 0;
|
||||||
|
long ageHour = 0;
|
||||||
|
long ageMilli = 0;
|
||||||
|
long ageDay = 0;
|
||||||
|
if (now_ms > result.seen && result.seen > 0) {
|
||||||
|
ageMilli = milli % 1000;
|
||||||
|
ageSec = (milli / 1000) % 60;
|
||||||
|
ageMin = (milli / (60*1000)) % 60;
|
||||||
|
ageHour = (milli / (60*60*1000)) % 24;
|
||||||
|
ageDay = (milli / (24*60*60*1000));
|
||||||
|
}
|
||||||
|
sbuf.append("{").append(result.BSSID).append(",").append(result.frequency);
|
||||||
|
sbuf.append(",").append(String.format("%3d", result.level));
|
||||||
|
if (result.autoJoinStatus > 0) {
|
||||||
|
sbuf.append(",st=").append(result.autoJoinStatus);
|
||||||
|
}
|
||||||
|
if (ageSec > 0 || ageMilli > 0) {
|
||||||
|
sbuf.append(String.format(",%4d.%02d.%02d.%02d.%03dms", ageDay,
|
||||||
|
ageHour, ageMin, ageSec, ageMilli));
|
||||||
|
}
|
||||||
|
if (result.numIpConfigFailures > 0) {
|
||||||
|
sbuf.append(",ipfail=");
|
||||||
|
sbuf.append(result.numIpConfigFailures);
|
||||||
|
}
|
||||||
|
sbuf.append("} ");
|
||||||
}
|
}
|
||||||
if (result.numIpConfigFailures > 0) {
|
sbuf.append('\n');
|
||||||
sbuf.append(",ipfail=");
|
|
||||||
sbuf.append(result.numIpConfigFailures);
|
|
||||||
}
|
|
||||||
sbuf.append(",").append(result.autoJoinStatus).append("} ");
|
|
||||||
}
|
}
|
||||||
sbuf.append('\n');
|
|
||||||
}
|
}
|
||||||
sbuf.append("triggeredLow: ").append(this.numUserTriggeredWifiDisableLowRSSI);
|
sbuf.append("triggeredLow: ").append(this.numUserTriggeredWifiDisableLowRSSI);
|
||||||
sbuf.append(" triggeredBad: ").append(this.numUserTriggeredWifiDisableBadRSSI);
|
sbuf.append(" triggeredBad: ").append(this.numUserTriggeredWifiDisableBadRSSI);
|
||||||
|
@ -456,6 +456,7 @@ public class WifiInfo implements Parcelable {
|
|||||||
* SSID-specific probe request must be used for scans.
|
* SSID-specific probe request must be used for scans.
|
||||||
*/
|
*/
|
||||||
public boolean getHiddenSSID() {
|
public boolean getHiddenSSID() {
|
||||||
|
if (mWifiSsid == null) return false;
|
||||||
return mWifiSsid.isHidden();
|
return mWifiSsid.isHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user