diff options
author | 2023-09-06 00:48:22 +0000 | |
---|---|---|
committer | 2023-09-06 00:50:33 +0000 | |
commit | b41c21995f6a8ff23dd006f278fd87ecb99f40a2 (patch) | |
tree | 44d4a1f640a8ae5d91a1a30a7813d09c04e68449 | |
parent | b06a59959cc9aec78d33206f9f481b1496d696e8 (diff) |
Addressed missed comments from ag/24539449
The CL with Change-ID Ib6b124db4108d11260b220cc57444007b9d865a6
was submitted before all reviewers had a chance to take a look.
Addressing missed comments here.
Bug: 293587049
Bug: 278783893
Test: presubmit
Change-Id: I2946c0216935a35af05a3f74f1e2a5bd8e23fed1
-rw-r--r-- | libs/input/PointerController.cpp | 8 | ||||
-rw-r--r-- | libs/input/PointerController.h | 2 | ||||
-rw-r--r-- | services/core/jni/com_android_server_input_InputManagerService.cpp | 9 |
3 files changed, 9 insertions, 10 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index c41cd0467ed3..abd928486607 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -354,13 +354,12 @@ const ui::Transform& PointerController::getTransformForDisplayLocked(int display return it != di.end() ? it->transform : kIdentityTransform; } -void PointerController::dump(std::string& dump) { +std::string PointerController::dump() { if (!mEnabled) { - dump += INDENT "PointerController: DISABLED due to ongoing PointerChoreographer refactor\n"; - return; + return INDENT "PointerController: DISABLED due to ongoing PointerChoreographer refactor\n"; } - dump += INDENT "PointerController:\n"; + std::string dump = INDENT "PointerController:\n"; std::scoped_lock lock(getLock()); dump += StringPrintf(INDENT2 "Presentation: %s\n", ftl::enum_string(mLocked.presentation).c_str()); @@ -373,6 +372,7 @@ void PointerController::dump(std::string& dump) { for (const auto& [_, spotController] : mLocked.spotControllers) { spotController.dump(dump, INDENT3); } + return dump; } } // namespace android diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h index de39eda75210..aa7ca3c52ecf 100644 --- a/libs/input/PointerController.h +++ b/libs/input/PointerController.h @@ -75,7 +75,7 @@ public: void onDisplayInfosChangedLocked(const std::vector<gui::DisplayInfo>& displayInfos) REQUIRES(getLock()); - void dump(std::string& dump); + std::string dump(); protected: using WindowListenerConsumer = diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index 6e0d98cab8e6..55deb2203a03 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -372,7 +372,7 @@ public: virtual void onPointerDisplayIdChanged(int32_t displayId, const FloatPoint& position); /* --- PointerControllerPolicyInterface implementation --- */ - virtual std::shared_ptr<PointerControllerInterface> createPointerController() override; + std::shared_ptr<PointerControllerInterface> createPointerController() override; private: sp<InputManagerInterface> mInputManager; @@ -489,7 +489,7 @@ void NativeInputManager::dump(std::string& dump) { dump += StringPrintf(INDENT "Pointer Capture: %s, seq=%" PRIu32 "\n", mLocked.pointerCaptureRequest.enable ? "Enabled" : "Disabled", mLocked.pointerCaptureRequest.seq); - forEachPointerControllerLocked([&dump](PointerController& pc) { pc.dump(dump); }); + forEachPointerControllerLocked([&dump](PointerController& pc) { dump += pc.dump(); }); } // release lock dump += "\n"; @@ -530,9 +530,8 @@ void NativeInputManager::setDisplayViewports(JNIEnv* env, jobjectArray viewportO { // acquire lock std::scoped_lock _l(mLock); mLocked.viewports = viewports; - forEachPointerControllerLocked([viewports = std::move(viewports)](PointerController& pc) { - pc.onDisplayViewportsUpdated(viewports); - }); + forEachPointerControllerLocked( + [&viewports](PointerController& pc) { pc.onDisplayViewportsUpdated(viewports); }); } // release lock mInputManager->getReader().requestRefreshConfiguration( |