Enlarge the buffer for otapreopt commands.
If a command exceeds the size of the buffer, the return value of
`std::cin.getline` implicitly casts to false, halting the execution.
Logs in a bug report shows that some commands can be longer than 1000
chars because there can be a lot of split APKs in the CLC.
This change enlarges the buffer to work around this issue. Note that
it's not a proper fix to the issue. Instead, it's a quick change to help
us verify the theory in b/307903002.
Bug: 307903002
Change-Id: I27962ce25182c27f9bbbf4016d76aa3f9997eddc
Test: Presubmit
diff --git a/cmds/installd/otapreopt_chroot.cpp b/cmds/installd/otapreopt_chroot.cpp
index c40caf5..c86adef 100644
--- a/cmds/installd/otapreopt_chroot.cpp
+++ b/cmds/installd/otapreopt_chroot.cpp
@@ -353,7 +353,7 @@
// Now go on and read dexopt lines from stdin and pass them on to otapreopt.
int count = 1;
- for (std::array<char, 1000> linebuf;
+ for (std::array<char, 10000> linebuf;
std::cin.clear(), std::cin.getline(&linebuf[0], linebuf.size()); ++count) {
// Subtract one from gcount() since getline() counts the newline.
std::string line(&linebuf[0], std::cin.gcount() - 1);