Add DisplayViewport native tests
The strategy for finding DisplayViewport has changed in ag/4723479.
Add native tests for the new lookup logic here.
The matching is done by uniqueId if it is specified, and by type only if it is not.
Some additional refactors:
- Return std::optional from getDisplayViewport
- Make internal viewport optional. Expect normal operation if internal
viewport is not present at all.
Bug: 111108021
Test: atest -a inputflinger_tests
Change-Id: I7d7d698438d0d691f5f07fef2da80e792a504978
diff --git a/services/inputflinger/tests/Android.bp b/services/inputflinger/tests/Android.bp
index 517e639..a1cd71c 100644
--- a/services/inputflinger/tests/Android.bp
+++ b/services/inputflinger/tests/Android.bp
@@ -10,6 +10,7 @@
cflags: [
"-Wall",
"-Werror",
+ "-Wextra",
"-Wno-unused-parameter",
],
shared_libs: [