Fix virtual touchpad re-attachment.
If the client crashes without detaching the virtual touchpad
and a new instance reconnects, it should take over the existing
device without attempting to configure it again.
Bug: 36051900
Test: no
Change-Id: I446f1bc7cb9c08f914b9bfc653857a97fdc7839c
diff --git a/services/vr/virtual_touchpad/VirtualTouchpadService.cpp b/services/vr/virtual_touchpad/VirtualTouchpadService.cpp
index 2e2f622..191bcfb 100644
--- a/services/vr/virtual_touchpad/VirtualTouchpadService.cpp
+++ b/services/vr/virtual_touchpad/VirtualTouchpadService.cpp
@@ -45,6 +45,8 @@
// reported when the previous client performs any touchpad action.
ALOGE("pid=%ld replaces %ld", static_cast<long>(pid),
static_cast<long>(client_pid_));
+ client_pid_ = pid;
+ return binder::Status::ok();
}
client_pid_ = pid;
if (const status_t error = touchpad_->Attach()) {