Add dump for PointerController.
Just a simple dump to start, but start pushing more PointerController information into bugreports. Bug: 254277939 Test: manually inspect `dumpsys input` Change-Id: I7ca637aa8a8f1cc1188eddcf694f7c4aea7d5821
This commit is contained in:
@@ -22,10 +22,17 @@
|
||||
#include <SkBlendMode.h>
|
||||
#include <SkCanvas.h>
|
||||
#include <SkColor.h>
|
||||
#include <android-base/stringprintf.h>
|
||||
#include <android-base/thread_annotations.h>
|
||||
#include <ftl/enum.h>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "PointerControllerContext.h"
|
||||
|
||||
#define INDENT " "
|
||||
#define INDENT2 " "
|
||||
|
||||
namespace android {
|
||||
|
||||
namespace {
|
||||
@@ -313,4 +320,12 @@ const ui::Transform& PointerController::getTransformForDisplayLocked(int display
|
||||
return it != di.end() ? it->transform : kIdentityTransform;
|
||||
}
|
||||
|
||||
void PointerController::dump(std::string& dump) {
|
||||
dump += INDENT "PointerController:\n";
|
||||
std::scoped_lock lock(getLock());
|
||||
dump += StringPrintf(INDENT2 "Presentation: %s\n",
|
||||
ftl::enum_string(mLocked.presentation).c_str());
|
||||
dump += StringPrintf(INDENT2 "Pointer Display ID: %" PRIu32 "\n", mLocked.pointerDisplayId);
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "MouseCursorController.h"
|
||||
@@ -75,6 +76,8 @@ public:
|
||||
void onDisplayInfosChangedLocked(const std::vector<gui::DisplayInfo>& displayInfos)
|
||||
REQUIRES(getLock());
|
||||
|
||||
void dump(std::string& dump);
|
||||
|
||||
protected:
|
||||
using WindowListenerConsumer =
|
||||
std::function<void(const sp<android::gui::WindowInfosListener>&)>;
|
||||
|
||||
@@ -450,6 +450,10 @@ void NativeInputManager::dump(std::string& dump) {
|
||||
dump += StringPrintf(INDENT "Pointer Capture: %s, seq=%" PRIu32 "\n",
|
||||
mLocked.pointerCaptureRequest.enable ? "Enabled" : "Disabled",
|
||||
mLocked.pointerCaptureRequest.seq);
|
||||
auto pointerController = mLocked.pointerController.lock();
|
||||
if (pointerController != nullptr) {
|
||||
pointerController->dump(dump);
|
||||
}
|
||||
}
|
||||
dump += "\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user