OSDN Git Service

Clear callbacks when destroying DvrHwcClient
authorPat Plunkett <patplunkett@google.com>
Thu, 29 Jun 2017 22:40:41 +0000 (15:40 -0700)
committerPat Plunkett <patplunkett@google.com>
Thu, 6 Jul 2017 17:45:05 +0000 (10:45 -0700)
commit15561b082ff4da3121be20d55b05a074ddd15a5c
treecbfdbe620c86ed085eae4c4a34f2217b26fa5bfb
parenta36bf92663256f1c8d2956902daf0f1045961953
Clear callbacks when destroying DvrHwcClient

When a DvrHwcClient is destroyed, the VrComposer retains a reference to its
observer. Because registerObserver returns a non-OK status if an observer
is already registered, this was causing subsequent DvrHwcClients to not be
created.

This was an issue with the CompatibilityUiOverlay app on standalone
headsets. CompatibilityUiOverlay was destroying its DvrHwcClient when turning
the screen off, but upon turning the screen back on, CompatibilityUiOverlay
was unable to create another DvrHwcClient.

Bug: 63139142
Test: Turn the screen off/on for a standalone headset, observe
CompatibilityUiOverlay running.

Change-Id: Ie45e961d2bf977ab9a661e23c558354d3a96ae20
libs/vr/libdvr/dvr_hardware_composer_client.cpp
services/vr/hardware_composer/aidl/android/dvr/IVrComposer.aidl
services/vr/hardware_composer/vr_composer.cpp
services/vr/hardware_composer/vr_composer.h