Collect diagnostics without storage permission

Use the shell to open the output file instead of FileOutputStream. This
allows test to use ConnectivityDiagnosticsCollector even if they do not
have storage permissions.

getOutputStreamViaShell is a method of the base class
BaseMetricListener.

Bug: 317602748
Test: atest
Change-Id: I127bb6711d14fdee059a31a8a3cfddc44b1d7800
1 file changed