Fix ShellCommandPermissionTest

The `ShellCommandPermission` tests previously checked `stderr` for a
line containing the string `Error:` to determine if the command failed
to run or not. Due to recent changes no output is generated when
checking whether the command can run, instead the process returns an
exit code of -1. This updates the permissions tests to check that the
process exits with an error code instead of relying on parsing the
output of stderr.

Bug: 307955579
Test: atest CtsPermissionTestCases:android.permission.cts.ShellCommandPermissionTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1df4da190091d1ecfd58448a83cf5a4eb29a1c03)
Merged-In: I2a5b1d4ac19d8def11a7775f56c23d8befb433b7
Change-Id: I7107db9e7241967beca05956c18f15710b6b8c6e
1 file changed