summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net
diff options
context:
space:
mode:
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r--wifi/java/android/net/wifi/RttManager.java5
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java70
-rw-r--r--wifi/java/android/net/wifi/WifiScanner.java9
3 files changed, 18 insertions, 66 deletions
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
index dde8dba..503e4a2 100644
--- a/wifi/java/android/net/wifi/RttManager.java
+++ b/wifi/java/android/net/wifi/RttManager.java
@@ -829,7 +829,8 @@ public class RttManager {
Log.e(TAG, "Request " + index + ": two side RTT is not supported");
return false;
} else if(params.bssid == null || params.bssid.isEmpty()) {
- Log.e(TAG,"No BSSID is input");
+ Log.e(TAG,"No BSSID in params");
+ return false;
} else if ( params.numberBurst != 0 ) {
Log.e(TAG, "Request " + index + ": Illegal number of burst: " + params.numberBurst);
return false;
@@ -958,7 +959,7 @@ public class RttManager {
return;
}
- sHandlerThread = new HandlerThread("WifiScanner");
+ sHandlerThread = new HandlerThread("RttManager");
sAsyncChannel = new AsyncChannel();
sConnected = new CountDownLatch(1);
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index a38a96e..a1d5dd5 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -919,60 +919,6 @@ public class WifiConfiguration implements Parcelable {
}
/**
- * indicates whether the configuration is valid
- * @return true if valid, false otherwise
- * @hide
- */
- public boolean isValid() {
- String reason = strIsValid();
- if (reason != null) {
- Log.e(TAG, "WiFi Config not valid: " + reason);
- return false;
- }
- else {
- return true;
- }
- }
-
- private String strIsValid() {
-
- if (allowedKeyManagement == null)
- return "allowed kmgmt";
-
- if (allowedKeyManagement.cardinality() > 1) {
- if (allowedKeyManagement.cardinality() != 2) {
- return "cardinality != 2";
- }
- if (!allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
- return "not WPA_EAP";
- }
- if ((!allowedKeyManagement.get(KeyMgmt.IEEE8021X))
- && (!allowedKeyManagement.get(KeyMgmt.WPA_PSK))) {
- return "not PSK or 8021X";
- }
- }
-
- if (!TextUtils.isEmpty(FQDN)) {
- /* this is passpoint configuration; it must not have an SSID */
- if (!TextUtils.isEmpty(SSID)) {
- return "SSID not expected for Passpoint: '" + SSID + "'";
- }
- /* this is passpoint configuration; it must have a providerFriendlyName */
- if (TextUtils.isEmpty(providerFriendlyName)) {
- return "no provider friendly name";
- }
- /* this is passpoint configuration; it must have enterprise config */
- if (enterpriseConfig == null
- || enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.NONE ) {
- return "no enterprise config";
- }
- }
-
- // TODO: Add more checks
- return null;
- }
-
- /**
* Identify if this configuration represents a passpoint network
*/
public boolean isPasspoint() {
@@ -1137,7 +1083,7 @@ public class WifiConfiguration implements Parcelable {
if (diff <= 0) {
sbuf.append(" blackListed since <incorrect>");
} else {
- sbuf.append(" blackListed: ").append(Long.toString(diff/1000)).append( "sec");
+ sbuf.append(" blackListed: ").append(Long.toString(diff/1000)).append( "sec ");
}
}
if (creatorUid != 0) sbuf.append(" cuid=" + Integer.toString(creatorUid));
@@ -1155,27 +1101,27 @@ public class WifiConfiguration implements Parcelable {
if (diff <= 0) {
sbuf.append("lastConnected since <incorrect>");
} else {
- sbuf.append("lastConnected: ").append(Long.toString(diff/1000)).append( "sec");
+ 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>");
+ sbuf.append("lastConnectionFailure since <incorrect> ");
} else {
sbuf.append("lastConnectionFailure: ").append(Long.toString(diff/1000));
- sbuf.append( "sec");
+ sbuf.append( "sec ");
}
}
if (this.lastRoamingFailure != 0) {
sbuf.append('\n');
long diff = now_ms - this.lastRoamingFailure;
if (diff <= 0) {
- sbuf.append("lastRoamingFailure since <incorrect>");
+ sbuf.append("lastRoamingFailure since <incorrect> ");
} else {
sbuf.append("lastRoamingFailure: ").append(Long.toString(diff/1000));
- sbuf.append( "sec");
+ sbuf.append( "sec ");
}
}
sbuf.append("roamingFailureBlackListTimeMilli: ").
@@ -1327,8 +1273,8 @@ public class WifiConfiguration implements Parcelable {
/** @hide */
public int getAuthType() {
- if (isValid() == false) {
- throw new IllegalStateException("Invalid configuration");
+ if (allowedKeyManagement.cardinality() > 1) {
+ throw new IllegalStateException("More than one auth type set");
}
if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
return KeyMgmt.WPA_PSK;
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index 4ead972..a3dc077 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -136,12 +136,17 @@ public class WifiScanner {
}
}
- /** reports {@link ScanListener#onResults} when underlying buffers are full */
+ /** reports {@link ScanListener#onResults} when underlying buffers are full
+ * @deprecated
+ */
+ @Deprecated
public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0;
/** reports {@link ScanListener#onResults} after each scan */
public static final int REPORT_EVENT_AFTER_EACH_SCAN = 1;
/** reports {@link ScanListener#onFullResult} whenever each beacon is discovered */
public static final int REPORT_EVENT_FULL_SCAN_RESULT = 2;
+ /** do not batch */
+ public static final int REPORT_EVENT_NO_BATCH = 4;
/**
* scan configuration parameters to be sent to {@link #startBackgroundScan}
@@ -1002,7 +1007,7 @@ public class WifiScanner {
((ParcelableScanResults) msg.obj).getResults());
return;
case CMD_SINGLE_SCAN_COMPLETED:
- Log.d(TAG, "removing listener for single scan");
+ if (DBG) Log.d(TAG, "removing listener for single scan");
removeListener(msg.arg2);
break;
default: