diff options
author | Igor Murashkin <iam@google.com> | 2012-10-03 14:04:47 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-03 14:04:47 -0700 |
commit | fe5f12bec61d43da862c11aeddc464a088f214a4 (patch) | |
tree | 5da18b46416ed24f0dd3b5253b0f0a1a0a86c0c4 /services | |
parent | 3b33fc737dc85c2d3bbc8f8d0a050652f506dd27 (diff) | |
parent | 7fd4e2a8f4d57d20e679e5321f34cc09245d82a1 (diff) | |
download | frameworks_av-fe5f12bec61d43da862c11aeddc464a088f214a4.zip frameworks_av-fe5f12bec61d43da862c11aeddc464a088f214a4.tar.gz frameworks_av-fe5f12bec61d43da862c11aeddc464a088f214a4.tar.bz2 |
am 7fd4e2a8: am b3e97b34: Camera2: Fix trying to release HAL stream twice
* commit '7fd4e2a8f4d57d20e679e5321f34cc09245d82a1':
Camera2: Fix trying to release HAL stream twice
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/Camera2Device.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/services/camera/libcameraservice/Camera2Device.cpp b/services/camera/libcameraservice/Camera2Device.cpp index 6da9bef..25b7a58 100644 --- a/services/camera/libcameraservice/Camera2Device.cpp +++ b/services/camera/libcameraservice/Camera2Device.cpp @@ -1115,9 +1115,17 @@ status_t Camera2Device::StreamAdapter::release() { if (mState >= CONNECTED) { res = native_window_api_disconnect(mConsumerInterface.get(), NATIVE_WINDOW_API_CAMERA); - if (res != OK) { - ALOGE("%s: Unable to disconnect stream %d from native window", - __FUNCTION__, mId); + + /* this is not an error. if client calling process dies, + the window will also die and all calls to it will return + DEAD_OBJECT, thus it's already "disconnected" */ + if (res == DEAD_OBJECT) { + ALOGW("%s: While disconnecting stream %d from native window, the" + " native window died from under us", __FUNCTION__, mId); + } + else if (res != OK) { + ALOGE("%s: Unable to disconnect stream %d from native window (error %d %s)", + __FUNCTION__, mId, res, strerror(-res)); return res; } } |