diff options
| author | 2018-09-20 23:54:12 -0700 | |
|---|---|---|
| committer | 2018-09-20 23:54:12 -0700 | |
| commit | 757692ae87818dfbeb7bda47a19932b9c65db2fc (patch) | |
| tree | 55a4776271f10c5a53b37396fc4806be32e7009f | |
| parent | 6e68ffc27ddc6481dd5afe7297c92be9fdec3cd2 (diff) | |
| parent | 194170e7f7493c828235f325140dd860d31d077d (diff) | |
Merge "Allocate new native handle to store sidebandStream"
am: 194170e7f7
Change-Id: I5cd3245cebc24adacbe6417b07aaeb747d966fca
| -rw-r--r-- | services/core/jni/com_android_server_tv_TvInputHal.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp index 93c4829568f9..6c2a894a3a6a 100644 --- a/services/core/jni/com_android_server_tv_TvInputHal.cpp +++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp @@ -390,7 +390,11 @@ int JTvInputHal::addOrUpdateStream(int deviceId, int streamId, const sp<Surface> [&result, &sidebandStream](Result res, const native_handle_t* handle) { result = res; if (res == Result::OK) { - sidebandStream = handle; + if (handle) { + sidebandStream = native_handle_clone(handle); + } else { + result = Result::UNKNOWN; + } } }); if (result != Result::OK) { @@ -398,7 +402,7 @@ int JTvInputHal::addOrUpdateStream(int deviceId, int streamId, const sp<Surface> result); return UNKNOWN_ERROR; } - connection.mSourceHandle = NativeHandle::create((native_handle_t*)sidebandStream, false); + connection.mSourceHandle = NativeHandle::create((native_handle_t*)sidebandStream, true); } connection.mSurface = surface; if (connection.mSurface != nullptr) { |