summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2020-05-31 16:19:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-31 16:19:45 +0000
commit552cfec4db5eb8bb4979436f8eba7373d9e2834c (patch)
tree403ee4dc18df875784f60d6670114c6880fd1316 /service
parent3bd823f2ca68e508a8d406a85cdc46e2d905a7e1 (diff)
parenta442338fbb51bc797ab03eca48d3b0bc0c454e2e (diff)
Merge changes I514b5b3a,Id67082c5 into rvc-dev
* changes: ClientModeImpl: Ignore connect when connecting to network WifiDiagnostics: Add a timeout for logcat calls
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java6
-rw-r--r--service/java/com/android/server/wifi/WifiDiagnostics.java6
2 files changed, 8 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index ac1c8d0b4..5b616dd0a 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -368,7 +368,7 @@ public class ClientModeImpl extends StateMachine {
private String mTargetBssid = SUPPLICANT_BSSID_ANY;
// This one is used to track the current target network ID. This is used for error
// handling during connection setup since many error message from supplicant does not report
- // SSID Once connected, it will be set to invalid
+ // SSID. Once connected, it will be set to invalid
private int mTargetNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
private long mLastDriverRoamAttempt = 0;
private WifiConfiguration mTargetWifiConfiguration = null;
@@ -1211,8 +1211,8 @@ public class ClientModeImpl extends StateMachine {
private void connectToUserSelectNetwork(int netId, int uid, boolean forceReconnect) {
logd("connectToUserSelectNetwork netId " + netId + ", uid " + uid
+ ", forceReconnect = " + forceReconnect);
- if (!forceReconnect && mWifiInfo.getNetworkId() == netId) {
- // We're already connected to the user specified network, don't trigger a
+ if (!forceReconnect && (mLastNetworkId == netId || mTargetNetworkId == netId)) {
+ // We're already connecting/connected to the user specified network, don't trigger a
// reconnection unless it was forced.
logi("connectToUserSelectNetwork already connecting/connected=" + netId);
} else {
diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java
index 4ac982063..2ba90c968 100644
--- a/service/java/com/android/server/wifi/WifiDiagnostics.java
+++ b/service/java/com/android/server/wifi/WifiDiagnostics.java
@@ -44,6 +44,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.Deflater;
@@ -107,6 +108,9 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
/** Minimum dump period with same error code */
public static final long MIN_DUMP_TIME_WINDOW_MILLIS = 10 * 60 * 1000; // 10 mins
+ // Timeout for logcat
+ private static final int LOGCAT_TIMEOUT_MILLIS = 500;
+
private long mLastBugReportTime;
@VisibleForTesting public static final String FIRMWARE_DUMP_SECTION_HEADER =
@@ -720,7 +724,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
while ((line = reader.readLine()) != null) {
lines.add(line);
}
- process.waitFor();
+ process.waitFor(LOGCAT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
} catch (InterruptedException|IOException e) {
mLog.dump("Exception while capturing logcat: %").c(e.toString()).flush();
}