diff options
| author | Emilian Peev <epeev@google.com> | 2017-02-23 12:00:11 +0000 |
|---|---|---|
| committer | Emilian Peev <epeev@google.com> | 2017-02-23 12:00:11 +0000 |
| commit | 5b93a77a9da583c257b2b8fcadd41f451aa479d4 (patch) | |
| tree | 00873084c2648f47842b16b341e3a62dc7fd01a2 /camera | |
| parent | 19c89fc907e3e208ee778693cb24c73dfc3f1ee2 (diff) | |
| download | android_hardware_interfaces-5b93a77a9da583c257b2b8fcadd41f451aa479d4.tar.gz android_hardware_interfaces-5b93a77a9da583c257b2b8fcadd41f451aa479d4.tar.bz2 android_hardware_interfaces-5b93a77a9da583c257b2b8fcadd41f451aa479d4.zip | |
Camera: Redirect dump to "/dev/null" instead of stdout
This SELinux context doesn't have permission to access stdout
in read/write mode. Doing so will result in violation and
subsequent failure when running in binderized mode. Switch to
'/dev/null' which still can be used with SELinux enabled.
BUG: 35701060
Test: adb shell
/data/nativetest/VtsHalCameraProviderV2_4TargetTest/VtsHalCameraProviderV2_4TargetTest
Change-Id: Ib1cf2766ca41cfe3600ad8a4442a334dfab0e2c1
Diffstat (limited to 'camera')
| -rw-r--r-- | camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index e1e10f8f1..038e1dd23 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -66,6 +66,7 @@ using ::android::hardware::camera::device::V3_2::StreamBuffer; #define MAX_VIDEO_WIDTH 4096 #define MAX_VIDEO_HEIGHT 2160 #define STREAM_BUFFER_TIMEOUT 3 // sec. +#define DUMP_OUTPUT "/dev/null" struct AvailableStream { int32_t width; @@ -462,9 +463,11 @@ TEST_F(CameraHidlTest, dumpState) { }); native_handle_t* raw_handle = native_handle_create(1, 0); - raw_handle->data[0] = 1; // std out + raw_handle->data[0] = open(DUMP_OUTPUT, O_RDWR); + ASSERT_GE(raw_handle->data[0], 0); hidl_handle handle = raw_handle; device3_2->dumpState(handle); + close(raw_handle->data[0]); native_handle_delete(raw_handle); } } @@ -500,9 +503,11 @@ TEST_F(CameraHidlTest, openClose) { }); native_handle_t* raw_handle = native_handle_create(1, 0); - raw_handle->data[0] = 1; // std out + raw_handle->data[0] = open(DUMP_OUTPUT, O_RDWR); + ASSERT_GE(raw_handle->data[0], 0); hidl_handle handle = raw_handle; device3_2->dumpState(handle); + close(raw_handle->data[0]); native_handle_delete(raw_handle); session->close(); |
