summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputReaderBase.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2020-08-29 01:34:09 -0700
committer Xin Li <delphij@google.com> 2020-08-29 01:34:09 -0700
commite8b4e700b8950a07ea4155a31b742254002b7fad (patch)
tree2d41d10a4615e16694be0eb20487ce96a128e41c /services/inputflinger/InputReaderBase.cpp
parent9592c9d586e606d0d762b4334981159d2236295b (diff)
parent3fab51ee7064bc478ebaeadf068ceb628ca2365a (diff)
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507 Merged-In: I70ea776b8589ac3a7982c710c5c8b2941d86e55b Change-Id: Ic1d535e9d2d6f80d95215240dbdb024995b045f8
Diffstat (limited to 'services/inputflinger/InputReaderBase.cpp')
-rw-r--r--services/inputflinger/InputReaderBase.cpp56
1 files changed, 41 insertions, 15 deletions
diff --git a/services/inputflinger/InputReaderBase.cpp b/services/inputflinger/InputReaderBase.cpp
index 0e2a2e7f9e..b2dadf8460 100644
--- a/services/inputflinger/InputReaderBase.cpp
+++ b/services/inputflinger/InputReaderBase.cpp
@@ -33,22 +33,46 @@ using android::base::StringPrintf;
namespace android {
-// --- InputReaderThread ---
-
-InputReaderThread::InputReaderThread(const sp<InputReaderInterface>& reader) :
- Thread(/*canCallJava*/ true), mReader(reader) {
-}
-
-InputReaderThread::~InputReaderThread() {
-}
+// --- InputReaderConfiguration ---
-bool InputReaderThread::threadLoop() {
- mReader->loopOnce();
- return true;
+std::string InputReaderConfiguration::changesToString(uint32_t changes) {
+ if (changes == 0) {
+ return "<none>";
+ }
+ std::string result;
+ if (changes & CHANGE_POINTER_SPEED) {
+ result += "POINTER_SPEED | ";
+ }
+ if (changes & CHANGE_POINTER_GESTURE_ENABLEMENT) {
+ result += "POINTER_GESTURE_ENABLEMENT | ";
+ }
+ if (changes & CHANGE_DISPLAY_INFO) {
+ result += "DISPLAY_INFO | ";
+ }
+ if (changes & CHANGE_SHOW_TOUCHES) {
+ result += "SHOW_TOUCHES | ";
+ }
+ if (changes & CHANGE_KEYBOARD_LAYOUTS) {
+ result += "KEYBOARD_LAYOUTS | ";
+ }
+ if (changes & CHANGE_DEVICE_ALIAS) {
+ result += "DEVICE_ALIAS | ";
+ }
+ if (changes & CHANGE_TOUCH_AFFINE_TRANSFORMATION) {
+ result += "TOUCH_AFFINE_TRANSFORMATION | ";
+ }
+ if (changes & CHANGE_EXTERNAL_STYLUS_PRESENCE) {
+ result += "EXTERNAL_STYLUS_PRESENCE | ";
+ }
+ if (changes & CHANGE_ENABLED_STATE) {
+ result += "ENABLED_STATE | ";
+ }
+ if (changes & CHANGE_MUST_REOPEN) {
+ result += "MUST_REOPEN | ";
+ }
+ return result;
}
-// --- InputReaderConfiguration ---
-
std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByUniqueId(
const std::string& uniqueDisplayId) const {
if (uniqueDisplayId.empty()) {
@@ -76,8 +100,10 @@ std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByTyp
std::optional<DisplayViewport> result = std::nullopt;
for (const DisplayViewport& currentViewport : mDisplays) {
// Return the first match
- if (currentViewport.type == type && !result) {
- result = std::make_optional(currentViewport);
+ if (currentViewport.type == type) {
+ if (!result) {
+ result = std::make_optional(currentViewport);
+ }
count++;
}
}