Fields Summary |
---|
private static final String | TAG |
public static final String | ssidVarName{@hide} |
public static final String | bssidVarName{@hide} |
public static final String | pskVarName{@hide} |
public static final String[] | wepKeyVarNames{@hide} |
public static final String | wepTxKeyIdxVarName{@hide} |
public static final String | priorityVarName{@hide} |
public static final String | hiddenSSIDVarName{@hide} |
public static final String | pmfVarName{@hide} |
public static final String | updateIdentiferVarName{@hide} |
public static final int | INVALID_NETWORK_ID{@hide} |
public static final int | DISABLED_UNKNOWN_REASON |
public static final int | DISABLED_DNS_FAILURE |
public static final int | DISABLED_DHCP_FAILURE |
public static final int | DISABLED_AUTH_FAILURE |
public static final int | DISABLED_ASSOCIATION_REJECT |
public static final int | DISABLED_BY_WIFI_MANAGER |
public int | networkIdThe ID number that the supplicant uses to identify this
network configuration entry. This must be passed as an argument
to most calls into the supplicant. |
public int | statusThe current status of this network configuration entry. |
public boolean | dirtyThe configuration needs to be written to networkHistory.txt |
public int | disableReasonThe code referring to a reason for disabling the network
Valid when {@link #status} == Status.DISABLED |
public String | SSIDThe network's SSID. Can either be an ASCII string,
which must be enclosed in double quotation marks
(e.g., {@code "MyNetwork"}, or a string of
hex digits,which are not enclosed in quotes
(e.g., {@code 01a243f405}). |
public String | BSSIDWhen set, this network configuration entry should only be used when
associating with the AP having the specified BSSID. The value is
a string in the format of an Ethernet MAC address, e.g.,
XX:XX:XX:XX:XX:XX where each X is a hex digit. |
public String | FQDNFully qualified domain name (FQDN) of AAA server or RADIUS server
e.g. {@code "mail.example.com"}. |
public String | naiRealmNetwork access identifier (NAI) realm, for Passpoint credential.
e.g. {@code "myhost.example.com"}. |
public String | preSharedKeyPre-shared key for use with WPA-PSK.
When the value of this key is read, the actual key is
not returned, just a "*" if the key has a value, or the null
string otherwise. |
public String[] | wepKeysUp to four WEP keys. Either an ASCII string enclosed in double
quotation marks (e.g., {@code "abcdef"} or a string
of hex digits (e.g., {@code 0102030405}).
When the value of one of these keys is read, the actual key is
not returned, just a "*" if the key has a value, or the null
string otherwise. |
public int | wepTxKeyIndexDefault WEP key index, ranging from 0 to 3. |
public int | priorityPriority determines the preference given to a network by {@code wpa_supplicant}
when choosing an access point with which to associate. |
public boolean | hiddenSSIDThis is a network that does not broadcast its SSID, so an
SSID-specific probe request must be used for scans. |
public boolean | requirePMFThis is a network that requries Protected Management Frames (PMF). |
public String | updateIdentifierUpdate identifier, for Passpoint network. |
public BitSet | allowedKeyManagementThe set of key management protocols supported by this configuration.
See {@link KeyMgmt} for descriptions of the values.
Defaults to WPA-PSK WPA-EAP. |
public BitSet | allowedProtocolsThe set of security protocols supported by this configuration.
See {@link Protocol} for descriptions of the values.
Defaults to WPA RSN. |
public BitSet | allowedAuthAlgorithmsThe set of authentication protocols supported by this configuration.
See {@link AuthAlgorithm} for descriptions of the values.
Defaults to automatic selection. |
public BitSet | allowedPairwiseCiphersThe set of pairwise ciphers for WPA supported by this configuration.
See {@link PairwiseCipher} for descriptions of the values.
Defaults to CCMP TKIP. |
public BitSet | allowedGroupCiphersThe set of group ciphers supported by this configuration.
See {@link GroupCipher} for descriptions of the values.
Defaults to CCMP TKIP WEP104 WEP40. |
public WifiEnterpriseConfig | enterpriseConfigThe enterprise configuration details specifying the EAP method,
certificates and other settings associated with the EAP. |
private android.net.IpConfiguration | mIpConfiguration |
public String | dhcpServer |
public String | defaultGwMacAddress |
public String | lastFailure |
public boolean | validatedInternetAccess |
public int | creatorUid |
public int | lastConnectUid |
public int | lastUpdateUid |
public String | autoJoinBSSID |
public HashMap | scanResultCache |
public static int | INVALID_RSSI |
public static int | UNWANTED_BLACKLIST_SOFT_RSSI_24 |
public static int | UNWANTED_BLACKLIST_SOFT_RSSI_5 |
public static int | GOOD_RSSI_24 |
public static int | LOW_RSSI_24 |
public static int | BAD_RSSI_24 |
public static int | GOOD_RSSI_5 |
public static int | LOW_RSSI_5 |
public static int | BAD_RSSI_5 |
public static int | UNWANTED_BLACKLIST_SOFT_BUMP |
public static int | UNWANTED_BLACKLIST_HARD_BUMP |
public static int | UNBLACKLIST_THRESHOLD_24_SOFT |
public static int | UNBLACKLIST_THRESHOLD_24_HARD |
public static int | UNBLACKLIST_THRESHOLD_5_SOFT |
public static int | UNBLACKLIST_THRESHOLD_5_HARD |
public static int | INITIAL_AUTO_JOIN_ATTEMPT_MIN_24 |
public static int | INITIAL_AUTO_JOIN_ATTEMPT_MIN_5 |
public static int | A_BAND_PREFERENCE_RSSI_THRESHOLD |
public static int | G_BAND_PREFERENCE_RSSI_THRESHOLD |
public static int | HOME_NETWORK_RSSI_BOOST |
public static int | MAX_INITIAL_AUTO_JOIN_RSSI_BOOST |
public Visibility | visibility |
public static final int | AUTO_JOIN_ENABLED |
public static final int | AUTO_JOIN_TEMPORARY_DISABLED |
public static final int | AUTO_JOIN_TEMPORARY_DISABLED_LINK_ERRORS |
public static final int | AUTO_JOIN_TEMPORARY_DISABLED_AT_SUPPLICANT |
public static final int | AUTO_JOIN_DISABLED_ON_AUTH_FAILURE |
public static final int | AUTO_JOIN_DISABLED_NO_CREDENTIALS |
public static final int | AUTO_JOIN_DISABLED_USER_ACTION |
public static final int | AUTO_JOIN_DELETED |
public int | autoJoinStatus |
public int | numConnectionFailures |
public int | numIpConfigFailures |
public int | numAuthFailures |
public int | numNoInternetAccessReports |
public long | blackListTimestamp |
public long | lastConnected |
public long | lastConnectionFailure |
public long | lastRoamingFailure |
public static int | ROAMING_FAILURE_IP_CONFIG |
public static int | ROAMING_FAILURE_AUTH_FAILURE |
public long | roamingFailureBlackListTimeMilli |
public int | lastRoamingFailureReason |
public long | lastDisconnected |
public boolean | selfAddedSet if the configuration was self added by the framework
This boolean is cleared if we get a connect/save/ update or
any wifiManager command that indicate the user interacted with the configuration
since we will now consider that the configuration belong to him. |
public boolean | didSelfAddSet if the configuration was self added by the framework
This boolean is set once and never cleared. It is used
so as we never loose track of who created the
configuration in the first place. |
public String | peerWifiConfigurationPeer WifiConfiguration this WifiConfiguration was added for |
public boolean | ephemeral |
public boolean | autoJoinBailedDueToLowRssi |
public int | autoJoinUseAggressiveJoinAttemptThreshold |
public int | numScorerOverride |
public int | numScorerOverrideAndSwitchedNetwork |
public int | numAssociation |
public int | numUserTriggeredWifiDisableLowRSSI |
public int | numUserTriggeredWifiDisableBadRSSI |
public int | numUserTriggeredWifiDisableNotHighRSSI |
public int | numTicksAtLowRSSI |
public int | numTicksAtBadRSSI |
public int | numTicksAtNotHighRSSI |
public int | numUserTriggeredJoinAttempts |
public HashMap | connectChoices |
public HashMap | linkedConfigurations |
String | mCachedConfigKey |
public static final Creator | CREATORImplement the Parcelable interface {@hide} |
Methods Summary |
---|
public java.lang.String | configKey(boolean allowCached)
String key;
if (allowCached && mCachedConfigKey != null) {
key = mCachedConfigKey;
} else {
if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
key = SSID + KeyMgmt.strings[KeyMgmt.WPA_PSK];
} else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) ||
allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
key = SSID + KeyMgmt.strings[KeyMgmt.WPA_EAP];
} else if (wepKeys[0] != null) {
key = SSID + "WEP";
} else {
key = SSID + KeyMgmt.strings[KeyMgmt.NONE];
}
mCachedConfigKey = key;
}
return key;
|
public java.lang.String | configKey()
return configKey(false);
|
public static java.lang.String | configKey(ScanResult result)
String key = "\"" + result.SSID + "\"";
if (result.capabilities.contains("WEP")) {
key = key + "-WEP";
}
if (result.capabilities.contains("PSK")) {
key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK];
}
if (result.capabilities.contains("EAP")) {
key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP];
}
return key;
|
public int | describeContents()Implement the Parcelable interface {@hide}
return 0;
|
public int | getAuthType()
if (isValid() == false) {
throw new IllegalStateException("Invalid configuration");
}
if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
return KeyMgmt.WPA_PSK;
} else if (allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
return KeyMgmt.WPA2_PSK;
} else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
return KeyMgmt.WPA_EAP;
} else if (allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
return KeyMgmt.IEEE8021X;
}
return KeyMgmt.NONE;
|
public android.net.ProxyInfo | getHttpProxy()
return mIpConfiguration.httpProxy;
|
public android.net.IpConfiguration.IpAssignment | getIpAssignment()
return mIpConfiguration.ipAssignment;
|
public android.net.IpConfiguration | getIpConfiguration()
return mIpConfiguration;
|
public java.lang.String | getKeyIdForCredentials(android.net.wifi.WifiConfiguration current)Get an identifier for associating credentials with this config
String keyMgmt = null;
try {
// Get current config details for fields that are not initialized
if (TextUtils.isEmpty(SSID)) SSID = current.SSID;
if (allowedKeyManagement.cardinality() == 0) {
allowedKeyManagement = current.allowedKeyManagement;
}
if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
keyMgmt = KeyMgmt.strings[KeyMgmt.WPA_EAP];
}
if (allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
keyMgmt += KeyMgmt.strings[KeyMgmt.IEEE8021X];
}
if (TextUtils.isEmpty(keyMgmt)) {
throw new IllegalStateException("Not an EAP network");
}
return trimStringForKeyId(SSID) + "_" + keyMgmt + "_" +
trimStringForKeyId(enterpriseConfig.getKeyId(current != null ?
current.enterpriseConfig : null));
} catch (NullPointerException e) {
throw new IllegalStateException("Invalid config details");
}
|
public java.lang.String | getPrintableSsid(){@hide}
if (SSID == null) return "";
final int length = SSID.length();
if (length > 2 && (SSID.charAt(0) == '"") && SSID.charAt(length - 1) == '"") {
return SSID.substring(1, length - 1);
}
/** The ascii-encoded string format is P"<ascii-encoded-string>"
* The decoding is implemented in the supplicant for a newly configured
* network.
*/
if (length > 3 && (SSID.charAt(0) == 'P") && (SSID.charAt(1) == '"") &&
(SSID.charAt(length-1) == '"")) {
WifiSsid wifiSsid = WifiSsid.createFromAsciiEncoded(
SSID.substring(2, length - 1));
return wifiSsid.toString();
}
return SSID;
|
public android.net.IpConfiguration.ProxySettings | getProxySettings()
return mIpConfiguration.proxySettings;
|
public android.net.StaticIpConfiguration | getStaticIpConfiguration()
return mIpConfiguration.getStaticIpConfiguration();
|
public boolean | hasNoInternetAccess()
return numNoInternetAccessReports > 0 && !validatedInternetAccess;
|
public boolean | isLinked(android.net.wifi.WifiConfiguration config)Helper function, identify if a configuration is linked
if (config.linkedConfigurations != null && linkedConfigurations != null) {
if (config.linkedConfigurations.get(configKey()) != null
&& linkedConfigurations.get(config.configKey()) != null) {
return true;
}
}
return false;
|
public boolean | isValid()indicates whether the configuration is valid
if (allowedKeyManagement == null)
return false;
if (allowedKeyManagement.cardinality() > 1) {
if (allowedKeyManagement.cardinality() != 2) {
return false;
}
if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) == false) {
return false;
}
if ((allowedKeyManagement.get(KeyMgmt.IEEE8021X) == false)
&& (allowedKeyManagement.get(KeyMgmt.WPA_PSK) == false)) {
return false;
}
}
// TODO: Add more checks
return true;
|
public ScanResult | lastSeen()most recent time we have seen this configuration
ScanResult mostRecent = null;
if (scanResultCache == null) {
return null;
}
for (ScanResult result : scanResultCache.values()) {
if (mostRecent == null) {
if (result.seen != 0)
mostRecent = result;
} else {
if (result.seen > mostRecent.seen) {
mostRecent = result;
}
}
}
return mostRecent;
|
private static java.util.BitSet | readBitSet(android.os.Parcel src)
int cardinality = src.readInt();
BitSet set = new BitSet();
for (int i = 0; i < cardinality; i++) {
set.set(src.readInt());
}
return set;
|
public void | setAutoJoinStatus(int status)
if (status < 0) status = 0;
if (status == 0) {
blackListTimestamp = 0;
} else if (status > autoJoinStatus) {
blackListTimestamp = System.currentTimeMillis();
}
if (status != autoJoinStatus) {
autoJoinStatus = status;
dirty = true;
}
|
public void | setHttpProxy(android.net.ProxyInfo httpProxy)
mIpConfiguration.httpProxy = httpProxy;
|
public void | setIpAssignment(android.net.IpConfiguration.IpAssignment ipAssignment)
mIpConfiguration.ipAssignment = ipAssignment;
|
public void | setIpConfiguration(android.net.IpConfiguration ipConfiguration)
mIpConfiguration = ipConfiguration;
|
public void | setProxy(android.net.IpConfiguration.ProxySettings settings, android.net.ProxyInfo proxy)
mIpConfiguration.proxySettings = settings;
mIpConfiguration.httpProxy = proxy;
|
public void | setProxySettings(android.net.IpConfiguration.ProxySettings proxySettings)
mIpConfiguration.proxySettings = proxySettings;
|
public void | setStaticIpConfiguration(android.net.StaticIpConfiguration staticIpConfiguration)
mIpConfiguration.setStaticIpConfiguration(staticIpConfiguration);
|
public android.net.wifi.WifiConfiguration$Visibility | setVisibility(long age)
if (scanResultCache == null) {
visibility = null;
return null;
}
Visibility status = new Visibility();
long now_ms = System.currentTimeMillis();
for(ScanResult result : scanResultCache.values()) {
if (result.seen == 0)
continue;
if (result.is5GHz()) {
//strictly speaking: [4915, 5825]
//number of known BSSID on 5GHz band
status.num5 = status.num5 + 1;
} else if (result.is24GHz()) {
//strictly speaking: [2412, 2482]
//number of known BSSID on 2.4Ghz band
status.num24 = status.num24 + 1;
}
if ((now_ms - result.seen) > age) continue;
if (result.is5GHz()) {
if (result.level > status.rssi5) {
status.rssi5 = result.level;
status.age5 = result.seen;
status.BSSID5 = result.BSSID;
}
} else if (result.is24GHz()) {
if (result.level > status.rssi24) {
status.rssi24 = result.level;
status.age24 = result.seen;
status.BSSID24 = result.BSSID;
}
}
}
visibility = status;
return status;
|
private java.util.ArrayList | 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;
|
public java.lang.String | toString()
StringBuilder sbuf = new StringBuilder();
if (this.status == WifiConfiguration.Status.CURRENT) {
sbuf.append("* ");
} else if (this.status == WifiConfiguration.Status.DISABLED) {
sbuf.append("- DSBLE ");
}
sbuf.append("ID: ").append(this.networkId).append(" SSID: ").append(this.SSID).
append(" BSSID: ").append(this.BSSID).append(" FQDN: ").append(this.FQDN).
append(" REALM: ").append(this.naiRealm).append(" PRIO: ").append(this.priority).
append('\n");
if (this.numConnectionFailures > 0) {
sbuf.append(" numConnectFailures ").append(this.numConnectionFailures).append("\n");
}
if (this.numIpConfigFailures > 0) {
sbuf.append(" numIpConfigFailures ").append(this.numIpConfigFailures).append("\n");
}
if (this.numAuthFailures > 0) {
sbuf.append(" numAuthFailures ").append(this.numAuthFailures).append("\n");
}
if (this.autoJoinStatus > 0) {
sbuf.append(" autoJoinStatus ").append(this.autoJoinStatus).append("\n");
}
if (this.disableReason > 0) {
sbuf.append(" disableReason ").append(this.disableReason).append("\n");
}
if (this.numAssociation > 0) {
sbuf.append(" numAssociation ").append(this.numAssociation).append("\n");
}
if (this.numNoInternetAccessReports > 0) {
sbuf.append(" numNoInternetAccessReports ");
sbuf.append(this.numNoInternetAccessReports).append("\n");
}
if (this.didSelfAdd) sbuf.append(" didSelfAdd");
if (this.selfAdded) sbuf.append(" selfAdded");
if (this.validatedInternetAccess) sbuf.append(" validatedInternetAccess");
if (this.ephemeral) sbuf.append(" ephemeral");
if (this.didSelfAdd || this.selfAdded || this.validatedInternetAccess || this.ephemeral) {
sbuf.append("\n");
}
sbuf.append(" KeyMgmt:");
for (int k = 0; k < this.allowedKeyManagement.size(); k++) {
if (this.allowedKeyManagement.get(k)) {
sbuf.append(" ");
if (k < KeyMgmt.strings.length) {
sbuf.append(KeyMgmt.strings[k]);
} else {
sbuf.append("??");
}
}
}
sbuf.append(" Protocols:");
for (int p = 0; p < this.allowedProtocols.size(); p++) {
if (this.allowedProtocols.get(p)) {
sbuf.append(" ");
if (p < Protocol.strings.length) {
sbuf.append(Protocol.strings[p]);
} else {
sbuf.append("??");
}
}
}
sbuf.append('\n");
sbuf.append(" AuthAlgorithms:");
for (int a = 0; a < this.allowedAuthAlgorithms.size(); a++) {
if (this.allowedAuthAlgorithms.get(a)) {
sbuf.append(" ");
if (a < AuthAlgorithm.strings.length) {
sbuf.append(AuthAlgorithm.strings[a]);
} else {
sbuf.append("??");
}
}
}
sbuf.append('\n");
sbuf.append(" PairwiseCiphers:");
for (int pc = 0; pc < this.allowedPairwiseCiphers.size(); pc++) {
if (this.allowedPairwiseCiphers.get(pc)) {
sbuf.append(" ");
if (pc < PairwiseCipher.strings.length) {
sbuf.append(PairwiseCipher.strings[pc]);
} else {
sbuf.append("??");
}
}
}
sbuf.append('\n");
sbuf.append(" GroupCiphers:");
for (int gc = 0; gc < this.allowedGroupCiphers.size(); gc++) {
if (this.allowedGroupCiphers.get(gc)) {
sbuf.append(" ");
if (gc < GroupCipher.strings.length) {
sbuf.append(GroupCipher.strings[gc]);
} else {
sbuf.append("??");
}
}
}
sbuf.append('\n").append(" PSK: ");
if (this.preSharedKey != null) {
sbuf.append('*");
}
sbuf.append("\nEnterprise config:\n");
sbuf.append(enterpriseConfig);
sbuf.append("IP config:\n");
sbuf.append(mIpConfiguration.toString());
if (this.creatorUid != 0) sbuf.append(" uid=" + Integer.toString(creatorUid));
if (this.autoJoinBSSID != null) sbuf.append(" autoJoinBSSID=" + autoJoinBSSID);
long now_ms = System.currentTimeMillis();
if (this.blackListTimestamp != 0) {
sbuf.append('\n");
long diff = now_ms - this.blackListTimestamp;
if (diff <= 0) {
sbuf.append(" blackListed since <incorrect>");
} else {
sbuf.append(" blackListed: ").append(Long.toString(diff/1000)).append( "sec");
}
}
if (this.lastConnected != 0) {
sbuf.append('\n");
long diff = now_ms - this.lastConnected;
if (diff <= 0) {
sbuf.append("lastConnected since <incorrect>");
} else {
sbuf.append("lastConnected: ").append(Long.toString(diff/1000)).append( "sec");
}
}
if (this.lastConnectionFailure != 0) {
sbuf.append('\n");
long diff = now_ms - this.lastConnectionFailure;
if (diff <= 0) {
sbuf.append("lastConnectionFailure since <incorrect>");
} else {
sbuf.append("lastConnectionFailure: ").append(Long.toString(diff/1000));
sbuf.append( "sec");
}
}
if (this.lastRoamingFailure != 0) {
sbuf.append('\n");
long diff = now_ms - this.lastRoamingFailure;
if (diff <= 0) {
sbuf.append("lastRoamingFailure since <incorrect>");
} else {
sbuf.append("lastRoamingFailure: ").append(Long.toString(diff/1000));
sbuf.append( "sec");
}
}
sbuf.append("roamingFailureBlackListTimeMilli: ").
append(Long.toString(this.roamingFailureBlackListTimeMilli));
sbuf.append('\n");
if (this.linkedConfigurations != null) {
for(String key : this.linkedConfigurations.keySet()) {
sbuf.append(" linked: ").append(key);
sbuf.append('\n");
}
}
if (this.connectChoices != null) {
for(String key : this.connectChoices.keySet()) {
Integer choice = this.connectChoices.get(key);
if (choice != null) {
sbuf.append(" choice: ").append(key);
sbuf.append(" = ").append(choice);
sbuf.append('\n");
}
}
}
if (this.scanResultCache != null) {
sbuf.append("Scan Cache: ").append('\n");
ArrayList<ScanResult> list = sortScanResults();
if (list.size() > 0) {
for (ScanResult result : list) {
long milli = now_ms - result.seen;
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("} ");
}
sbuf.append('\n");
}
}
sbuf.append("triggeredLow: ").append(this.numUserTriggeredWifiDisableLowRSSI);
sbuf.append(" triggeredBad: ").append(this.numUserTriggeredWifiDisableBadRSSI);
sbuf.append(" triggeredNotHigh: ").append(this.numUserTriggeredWifiDisableNotHighRSSI);
sbuf.append('\n");
sbuf.append("ticksLow: ").append(this.numTicksAtLowRSSI);
sbuf.append(" ticksBad: ").append(this.numTicksAtBadRSSI);
sbuf.append(" ticksNotHigh: ").append(this.numTicksAtNotHighRSSI);
sbuf.append('\n");
sbuf.append("triggeredJoin: ").append(this.numUserTriggeredJoinAttempts);
sbuf.append('\n");
sbuf.append("autoJoinBailedDueToLowRssi: ").append(this.autoJoinBailedDueToLowRssi);
sbuf.append('\n");
sbuf.append("autoJoinUseAggressiveJoinAttemptThreshold: ");
sbuf.append(this.autoJoinUseAggressiveJoinAttemptThreshold);
sbuf.append('\n");
return sbuf.toString();
|
public void | trimScanResultsCache(int num)
if (this.scanResultCache == null) {
return;
}
int currenSize = this.scanResultCache.size();
if (currenSize <= num) {
return; // Nothing to trim
}
ArrayList<ScanResult> list = new ArrayList<ScanResult>(this.scanResultCache.values());
if (list.size() != 0) {
// Sort by descending timestamp
Collections.sort(list, new Comparator() {
public int compare(Object o1, Object o2) {
ScanResult a = (ScanResult)o1;
ScanResult b = (ScanResult)o2;
if (a.seen > b.seen) {
return 1;
}
if (a.seen < b.seen) {
return -1;
}
return a.BSSID.compareTo(b.BSSID);
}
});
}
for (int i = 0; i < currenSize - num ; i++) {
// Remove oldest results from scan cache
ScanResult result = list.get(i);
this.scanResultCache.remove(result.BSSID);
}
|
private java.lang.String | trimStringForKeyId(java.lang.String string)
// Remove quotes and spaces
return string.replace("\"", "").replace(" ", "");
|
private static void | writeBitSet(android.os.Parcel dest, java.util.BitSet set)
int nextSetBit = -1;
dest.writeInt(set.cardinality());
while ((nextSetBit = set.nextSetBit(nextSetBit + 1)) != -1) {
dest.writeInt(nextSetBit);
}
|
public void | writeToParcel(android.os.Parcel dest, int flags)Implement the Parcelable interface {@hide}
dest.writeInt(networkId);
dest.writeInt(status);
dest.writeInt(disableReason);
dest.writeString(SSID);
dest.writeString(BSSID);
dest.writeString(autoJoinBSSID);
dest.writeString(FQDN);
dest.writeString(naiRealm);
dest.writeString(preSharedKey);
for (String wepKey : wepKeys) {
dest.writeString(wepKey);
}
dest.writeInt(wepTxKeyIndex);
dest.writeInt(priority);
dest.writeInt(hiddenSSID ? 1 : 0);
dest.writeInt(requirePMF ? 1 : 0);
dest.writeString(updateIdentifier);
writeBitSet(dest, allowedKeyManagement);
writeBitSet(dest, allowedProtocols);
writeBitSet(dest, allowedAuthAlgorithms);
writeBitSet(dest, allowedPairwiseCiphers);
writeBitSet(dest, allowedGroupCiphers);
dest.writeParcelable(enterpriseConfig, flags);
dest.writeParcelable(mIpConfiguration, flags);
dest.writeString(dhcpServer);
dest.writeString(defaultGwMacAddress);
dest.writeInt(autoJoinStatus);
dest.writeInt(selfAdded ? 1 : 0);
dest.writeInt(didSelfAdd ? 1 : 0);
dest.writeInt(validatedInternetAccess ? 1 : 0);
dest.writeInt(ephemeral ? 1 : 0);
dest.writeInt(creatorUid);
dest.writeInt(lastConnectUid);
dest.writeInt(lastUpdateUid);
dest.writeLong(blackListTimestamp);
dest.writeLong(lastConnectionFailure);
dest.writeLong(lastRoamingFailure);
dest.writeInt(lastRoamingFailureReason);
dest.writeLong(roamingFailureBlackListTimeMilli);
dest.writeInt(numConnectionFailures);
dest.writeInt(numIpConfigFailures);
dest.writeInt(numAuthFailures);
dest.writeInt(numScorerOverride);
dest.writeInt(numScorerOverrideAndSwitchedNetwork);
dest.writeInt(numAssociation);
dest.writeInt(numUserTriggeredWifiDisableLowRSSI);
dest.writeInt(numUserTriggeredWifiDisableBadRSSI);
dest.writeInt(numUserTriggeredWifiDisableNotHighRSSI);
dest.writeInt(numTicksAtLowRSSI);
dest.writeInt(numTicksAtBadRSSI);
dest.writeInt(numTicksAtNotHighRSSI);
dest.writeInt(numUserTriggeredJoinAttempts);
dest.writeInt(autoJoinUseAggressiveJoinAttemptThreshold);
dest.writeInt(autoJoinBailedDueToLowRssi ? 1 : 0);
dest.writeInt(numNoInternetAccessReports);
|