diff options
author | Roshan Pius <rpius@google.com> | 2019-12-05 20:27:28 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-12-06 08:07:05 -0800 |
commit | b8a679668dc7c8721c556973266770d2b695da7c (patch) | |
tree | 75e35cbd73aba9ed73aa28a58510f9c9f290a4f3 | |
parent | 4cb2e7535b6c05d3e50dfd8a5dc8ab6a1ec3e53f (diff) |
LastMileLogger: Alternative for IoUtils.readFileAsByteArray
Use public Files.readAllBytes() instead.
Bug: 142809066
Test: atest com.android.server.wifi
Change-Id: Ifbee40115b0262c87aa0add347e01296530450e9
-rw-r--r-- | service/java/com/android/server/wifi/LastMileLogger.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/LastMileLogger.java b/service/java/com/android/server/wifi/LastMileLogger.java index cc0685a47..6cf921dd6 100644 --- a/service/java/com/android/server/wifi/LastMileLogger.java +++ b/service/java/com/android/server/wifi/LastMileLogger.java @@ -20,11 +20,11 @@ package com.android.server.wifi; import com.android.internal.annotations.VisibleForTesting; import com.android.server.wifi.util.FileUtils; -import libcore.io.IoUtils; - import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; +import java.nio.file.Files; +import java.nio.file.Paths; /** * Provides a facility for capturing kernel trace events related to Wifi control and data paths. @@ -113,7 +113,7 @@ public class LastMileLogger { private byte[] readTrace() { try { - return IoUtils.readFileAsByteArray(mEventBufferPath); + return Files.readAllBytes(Paths.get(mEventBufferPath)); } catch (IOException e) { mLog.warn("Failed to read event trace: %").r(e.getMessage()).flush(); return new byte[0]; |