diff options
author | 2024-08-25 17:49:32 +0000 | |
---|---|---|
committer | 2024-09-02 08:54:15 +0000 | |
commit | 05215aff63eac433ccc2ec618146fad27675e877 (patch) | |
tree | c4840dcb3bfd9ce7ea504173c708bbeaba35ab67 | |
parent | a9567c6b852b0c9cc0696229d660306a1c6c855d (diff) |
Add CursorController to the input dump
Test: manually validate `adb shell dumpsys input`
Bug: 245989146
FLAG: EXEMPT log only update
Change-Id: Ibab15f613e3076df2ac2ac2e672ce9e699de7f67
-rw-r--r-- | libs/input/MouseCursorController.cpp | 21 | ||||
-rw-r--r-- | libs/input/MouseCursorController.h | 2 | ||||
-rw-r--r-- | libs/input/PointerController.cpp | 3 |
3 files changed, 26 insertions, 0 deletions
diff --git a/libs/input/MouseCursorController.cpp b/libs/input/MouseCursorController.cpp index eecc741a3bbb..1afef75bc741 100644 --- a/libs/input/MouseCursorController.cpp +++ b/libs/input/MouseCursorController.cpp @@ -25,6 +25,9 @@ #include <input/Input.h> #include <log/log.h> +#define INDENT " " +#define INDENT2 " " + namespace { // Time to spend fading out the pointer completely. const nsecs_t POINTER_FADE_DURATION = 500 * 1000000LL; // 500 ms @@ -449,6 +452,24 @@ bool MouseCursorController::resourcesLoaded() { return mLocked.resourcesLoaded; } +std::string MouseCursorController::dump() const { + std::string dump = INDENT "MouseCursorController:\n"; + std::scoped_lock lock(mLock); + dump += StringPrintf(INDENT2 "viewport: %s\n", mLocked.viewport.toString().c_str()); + dump += StringPrintf(INDENT2 "stylusHoverMode: %s\n", + mLocked.stylusHoverMode ? "true" : "false"); + dump += StringPrintf(INDENT2 "pointerFadeDirection: %d\n", mLocked.pointerFadeDirection); + dump += StringPrintf(INDENT2 "updatePointerIcon: %s\n", + mLocked.updatePointerIcon ? "true" : "false"); + dump += StringPrintf(INDENT2 "resourcesLoaded: %s\n", + mLocked.resourcesLoaded ? "true" : "false"); + dump += StringPrintf(INDENT2 "requestedPointerType: %d\n", mLocked.requestedPointerType); + dump += StringPrintf(INDENT2 "resolvedPointerType: %d\n", mLocked.resolvedPointerType); + dump += StringPrintf(INDENT2 "skipScreenshot: %s\n", mLocked.skipScreenshot ? "true" : "false"); + dump += StringPrintf(INDENT2 "animating: %s\n", mLocked.animating ? "true" : "false"); + return dump; +} + bool MouseCursorController::doAnimations(nsecs_t timestamp) { std::scoped_lock lock(mLock); bool keepFading = doFadingAnimationLocked(timestamp); diff --git a/libs/input/MouseCursorController.h b/libs/input/MouseCursorController.h index 78f6413ff111..860034141a0b 100644 --- a/libs/input/MouseCursorController.h +++ b/libs/input/MouseCursorController.h @@ -67,6 +67,8 @@ public: bool resourcesLoaded(); + std::string dump() const; + private: mutable std::mutex mLock; diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index 11b27a214984..5ae967bc369a 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -25,6 +25,7 @@ #include <android-base/stringprintf.h> #include <android-base/thread_annotations.h> #include <ftl/enum.h> +#include <input/PrintTools.h> #include <mutex> @@ -353,6 +354,8 @@ std::string PointerController::dump() { for (const auto& [_, spotController] : mLocked.spotControllers) { spotController.dump(dump, INDENT3); } + dump += INDENT2 "Cursor Controller:\n"; + dump += addLinePrefix(mCursorController.dump(), INDENT3); return dump; } |