From e9f27f4a68337a58a330d94fb9e4092cc1ff07b3 Mon Sep 17 00:00:00 2001 From: Woody Lin Date: Wed, 5 May 2021 16:48:05 +0800 Subject: [PATCH] gs101: dumpstate: Dump s2d.lst to dumpstate_board.txt Gzip s2d.lst and base64 it for dumping to dumpstate_board.txt. Bug: 187228956 Change-Id: I911145ed6ecc345177cd979262126b7c49194528 --- dumpstate/DumpstateDevice.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 6f5e1664..cf3e1f2e 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -793,6 +793,16 @@ void DumpstateDevice::dumpSensorsUSFSection(int fd) { } } +// Gzip binary data and dump to fd in base64 format. Cmd to decode is also attached. +void dumpGzippedFileInBase64ToFd(int fd, const char* title, const char* file_path) { + auto cmd = android::base::StringPrintf("echo 'base64 -d <