Remove outfile option from dumpstate

Remove the ability to write to any directory. Instead support only
writing to its internal directory (currently /bugreports, which points
to Shell app's directory), or a caller-specified file fd.

We cannot expect all callers to supply an fd, because in the poweruser
case where the bugreport is triggered with combo keys, the API is
bypassed and dumpstate binary will be run.

This should be a safe change since sepolicy should not allow dumpstate
to write to arbitrary directories anyway.

This keeps the API lean and keeps the user consent for sharing more
focused.

Note that the current callers all pass in /data/user_de/0/com.android.shell/files/bugreports/bugreport
as the outfile argument already, which is the location /bugreports
symlink points to, so it should work just as before.

BUG:111441001
Test: adb bugreport
Test: adb shell bugreport
Test: interactive bugreport
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Change-Id: Iae8593dc4745147b7bdae25738fcd69b3c20aaf0
4 files changed