Revise virtual touchpad interface.
- Explicit start and stop, outside of which the evdev devices
don't exist.
- Permission test (not compiled by default pending build & SELinux
support for temporarily retaining a second copy of the service
for vr_wm).
- Enforce a single user of the touchpad.
- Support 'dumpsys'.
Bug: 36051900
Test: log inspection
Change-Id: I038ed2632d5adf50a3565a981031691d5dc5f7cd
diff --git a/services/vr/virtual_touchpad/VirtualTouchpadEvdev.h b/services/vr/virtual_touchpad/VirtualTouchpadEvdev.h
index ec8006b..b158cec 100644
--- a/services/vr/virtual_touchpad/VirtualTouchpadEvdev.h
+++ b/services/vr/virtual_touchpad/VirtualTouchpadEvdev.h
@@ -18,15 +18,17 @@
static sp<VirtualTouchpad> Create();
// VirtualTouchpad implementation:
+ status_t Attach() override;
+ status_t Detach() override;
status_t Touch(int touchpad, float x, float y, float pressure) override;
status_t ButtonState(int touchpad, int buttons) override;
+ void dumpInternal(String8& result) override;
protected:
VirtualTouchpadEvdev() {}
~VirtualTouchpadEvdev() override {}
- status_t Initialize();
- // Must be called only between construction and Initialize().
+ // Must be called only between construction and Attach().
inline void SetEvdevInjectorForTesting(EvdevInjector* injector) {
injector_ = injector;
}