Loading services/inputflinger/include/PointerControllerInterface.h +6 −6 Original line number Diff line number Diff line Loading @@ -59,11 +59,11 @@ public: /* Gets the absolute location of the pointer. */ virtual void getPosition(float* outX, float* outY) const = 0; enum Transition { enum class Transition { // Fade/unfade immediately. TRANSITION_IMMEDIATE, IMMEDIATE, // Fade/unfade gradually. TRANSITION_GRADUAL, GRADUAL, }; /* Fades the pointer out now. */ Loading @@ -75,11 +75,11 @@ public: * wants to ensure that the pointer becomes visible again. */ virtual void unfade(Transition transition) = 0; enum Presentation { enum class Presentation { // Show the mouse pointer. PRESENTATION_POINTER, POINTER, // Show spots and a spot anchor in place of the mouse pointer. PRESENTATION_SPOT, SPOT, }; /* Sets the mode of the pointer controller. */ Loading services/inputflinger/reader/InputReader.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ void InputReader::updatePointerDisplayLocked() { void InputReader::fadePointerLocked() { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller != nullptr) { controller->fade(PointerControllerInterface::TRANSITION_GRADUAL); controller->fade(PointerControllerInterface::Transition::GRADUAL); } } Loading services/inputflinger/reader/mapper/CursorInputMapper.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include "CursorButtonAccumulator.h" #include "CursorScrollAccumulator.h" #include "PointerControllerInterface.h" #include "TouchCursorInputMapperCommon.h" namespace android { Loading Loading @@ -154,7 +155,7 @@ void CursorInputMapper::configure(nsecs_t when, const InputReaderConfiguration* mParameters.mode = Parameters::MODE_POINTER_RELATIVE; mSource = AINPUT_SOURCE_MOUSE_RELATIVE; // Keep PointerController around in order to preserve the pointer position. mPointerController->fade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } else { ALOGE("Cannot request pointer capture, device is not in MODE_POINTER"); } Loading Loading @@ -316,7 +317,7 @@ void CursorInputMapper::sync(nsecs_t when) { float yCursorPosition = AMOTION_EVENT_INVALID_CURSOR_POSITION; if (mSource == AINPUT_SOURCE_MOUSE) { if (moved || scrolled || buttonsChanged) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); if (moved) { mPointerController->move(deltaX, deltaY); Loading @@ -326,7 +327,7 @@ void CursorInputMapper::sync(nsecs_t when) { mPointerController->setButtonState(currentButtonState); } mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); } mPointerController->getPosition(&xCursorPosition, &yCursorPosition); Loading services/inputflinger/reader/mapper/TouchInputMapper.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -1383,7 +1383,7 @@ void TouchInputMapper::reset(nsecs_t when) { resetExternalStylus(); if (mPointerController != nullptr) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); mPointerController->clearSpots(); } Loading Loading @@ -1589,8 +1589,8 @@ void TouchInputMapper::cookAndDispatch(nsecs_t when) { } else { if (mDeviceMode == DEVICE_MODE_DIRECT && mConfig.showTouches && mPointerController != nullptr) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_SPOT); mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->setPresentation(PointerControllerInterface::Presentation::SPOT); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); mPointerController->setButtonState(mCurrentRawState.buttonState); mPointerController->setSpots(mCurrentCookedState.cookedPointerData.pointerCoords, Loading Loading @@ -2327,7 +2327,7 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag // Update the pointer presentation and spots. if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); if (finishPreviousGesture || cancelPreviousGesture) { mPointerController->clearSpots(); } Loading @@ -2339,7 +2339,7 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag mPointerController->getDisplayId()); } } else { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); } // Show or hide the pointer if needed. Loading @@ -2349,7 +2349,7 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH && mPointerGesture.lastGestureMode == PointerGesture::FREEFORM) { // Remind the user of where the pointer is after finishing a gesture with spots. mPointerController->unfade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->unfade(PointerControllerInterface::Transition::GRADUAL); } break; case PointerGesture::TAP: Loading @@ -2360,15 +2360,15 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag case PointerGesture::SWIPE: // Unfade the pointer when the current gesture manipulates the // area directly under the pointer. mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); break; case PointerGesture::FREEFORM: // Fade the pointer when the current gesture manipulates a different // area and there are spots to guide the user experience. if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); } else { mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); } break; } Loading Loading @@ -2537,7 +2537,7 @@ void TouchInputMapper::abortPointerGestures(nsecs_t when, uint32_t policyFlags) // Remove any current spots. if (mPointerController != nullptr) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); mPointerController->clearSpots(); } } Loading Loading @@ -3396,12 +3396,12 @@ void TouchInputMapper::dispatchPointerSimple(nsecs_t when, uint32_t policyFlags, int32_t displayId = mViewport.displayId; if (down || hovering) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); mPointerController->clearSpots(); mPointerController->setButtonState(mCurrentRawState.buttonState); mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); } else if (!down && !hovering && (mPointerSimple.down || mPointerSimple.hovering)) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); } displayId = mPointerController->getDisplayId(); Loading Loading
services/inputflinger/include/PointerControllerInterface.h +6 −6 Original line number Diff line number Diff line Loading @@ -59,11 +59,11 @@ public: /* Gets the absolute location of the pointer. */ virtual void getPosition(float* outX, float* outY) const = 0; enum Transition { enum class Transition { // Fade/unfade immediately. TRANSITION_IMMEDIATE, IMMEDIATE, // Fade/unfade gradually. TRANSITION_GRADUAL, GRADUAL, }; /* Fades the pointer out now. */ Loading @@ -75,11 +75,11 @@ public: * wants to ensure that the pointer becomes visible again. */ virtual void unfade(Transition transition) = 0; enum Presentation { enum class Presentation { // Show the mouse pointer. PRESENTATION_POINTER, POINTER, // Show spots and a spot anchor in place of the mouse pointer. PRESENTATION_SPOT, SPOT, }; /* Sets the mode of the pointer controller. */ Loading
services/inputflinger/reader/InputReader.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ void InputReader::updatePointerDisplayLocked() { void InputReader::fadePointerLocked() { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller != nullptr) { controller->fade(PointerControllerInterface::TRANSITION_GRADUAL); controller->fade(PointerControllerInterface::Transition::GRADUAL); } } Loading
services/inputflinger/reader/mapper/CursorInputMapper.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include "CursorButtonAccumulator.h" #include "CursorScrollAccumulator.h" #include "PointerControllerInterface.h" #include "TouchCursorInputMapperCommon.h" namespace android { Loading Loading @@ -154,7 +155,7 @@ void CursorInputMapper::configure(nsecs_t when, const InputReaderConfiguration* mParameters.mode = Parameters::MODE_POINTER_RELATIVE; mSource = AINPUT_SOURCE_MOUSE_RELATIVE; // Keep PointerController around in order to preserve the pointer position. mPointerController->fade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } else { ALOGE("Cannot request pointer capture, device is not in MODE_POINTER"); } Loading Loading @@ -316,7 +317,7 @@ void CursorInputMapper::sync(nsecs_t when) { float yCursorPosition = AMOTION_EVENT_INVALID_CURSOR_POSITION; if (mSource == AINPUT_SOURCE_MOUSE) { if (moved || scrolled || buttonsChanged) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); if (moved) { mPointerController->move(deltaX, deltaY); Loading @@ -326,7 +327,7 @@ void CursorInputMapper::sync(nsecs_t when) { mPointerController->setButtonState(currentButtonState); } mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); } mPointerController->getPosition(&xCursorPosition, &yCursorPosition); Loading
services/inputflinger/reader/mapper/TouchInputMapper.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -1383,7 +1383,7 @@ void TouchInputMapper::reset(nsecs_t when) { resetExternalStylus(); if (mPointerController != nullptr) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); mPointerController->clearSpots(); } Loading Loading @@ -1589,8 +1589,8 @@ void TouchInputMapper::cookAndDispatch(nsecs_t when) { } else { if (mDeviceMode == DEVICE_MODE_DIRECT && mConfig.showTouches && mPointerController != nullptr) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_SPOT); mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->setPresentation(PointerControllerInterface::Presentation::SPOT); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); mPointerController->setButtonState(mCurrentRawState.buttonState); mPointerController->setSpots(mCurrentCookedState.cookedPointerData.pointerCoords, Loading Loading @@ -2327,7 +2327,7 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag // Update the pointer presentation and spots. if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); if (finishPreviousGesture || cancelPreviousGesture) { mPointerController->clearSpots(); } Loading @@ -2339,7 +2339,7 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag mPointerController->getDisplayId()); } } else { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); } // Show or hide the pointer if needed. Loading @@ -2349,7 +2349,7 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH && mPointerGesture.lastGestureMode == PointerGesture::FREEFORM) { // Remind the user of where the pointer is after finishing a gesture with spots. mPointerController->unfade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->unfade(PointerControllerInterface::Transition::GRADUAL); } break; case PointerGesture::TAP: Loading @@ -2360,15 +2360,15 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag case PointerGesture::SWIPE: // Unfade the pointer when the current gesture manipulates the // area directly under the pointer. mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); break; case PointerGesture::FREEFORM: // Fade the pointer when the current gesture manipulates a different // area and there are spots to guide the user experience. if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); } else { mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); } break; } Loading Loading @@ -2537,7 +2537,7 @@ void TouchInputMapper::abortPointerGestures(nsecs_t when, uint32_t policyFlags) // Remove any current spots. if (mPointerController != nullptr) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); mPointerController->clearSpots(); } } Loading Loading @@ -3396,12 +3396,12 @@ void TouchInputMapper::dispatchPointerSimple(nsecs_t when, uint32_t policyFlags, int32_t displayId = mViewport.displayId; if (down || hovering) { mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); mPointerController->clearSpots(); mPointerController->setButtonState(mCurrentRawState.buttonState); mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE); mPointerController->unfade(PointerControllerInterface::Transition::IMMEDIATE); } else if (!down && !hovering && (mPointerSimple.down || mPointerSimple.hovering)) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); mPointerController->fade(PointerControllerInterface::Transition::GRADUAL); } displayId = mPointerController->getDisplayId(); Loading