diff options
author | Roshan Pius <rpius@google.com> | 2020-05-31 16:32:31 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-31 16:32:31 +0000 |
commit | e0fdff9ee065a6c68218f681a09064e25197d473 (patch) | |
tree | 61742580ae66087b1ec27e0132b0f4efa00ba6c0 | |
parent | 5cac59f179792a1c29f3da43abe586330d6c0071 (diff) | |
parent | 7cf18381fa2099230c49269a435090115b7e633b (diff) |
WifiDiagnostics: Add a timeout for logcat calls am: 7cf18381fa
Change-Id: I6a3b290b57a11612cc79555be88be164b909fc2a
-rw-r--r-- | service/java/com/android/server/wifi/WifiDiagnostics.java | 6 |
1 files changed, 5 insertions, 1 deletions
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(); } |