Fix hang of `adb shell cmd resources dump ...`

The process creates a pipe and dup the output file descriptor passed to
the app process. The dup output file descriptor is not closed after
the app has finished the dumping tasks. But, the console is blocked for
reading from the input file descriptor. That's why
`adb shell cmd resources dump com.android.systemui` hangs in very high
frequency.

This patch makes sure the dup output file descriptor is closed after the
app process has finished the dumping tasks.

Fixes: 265098734
Bug: 243579631
Test: adb shell cmd resources dump com.android.systemui
Change-Id: I02eb316e32f27ead25ec37ccbf661a422f137e50
1 file changed