Loading services/inputflinger/dispatcher/InputDispatcher.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -3640,7 +3640,8 @@ void InputDispatcher::updateWindowHandlesForDisplayLocked( continue; } if (oldHandlesById.find(handle->getId()) != oldHandlesById.end()) { if ((oldHandlesById.find(handle->getId()) != oldHandlesById.end()) && (oldHandlesById.at(handle->getId())->getToken() == handle->getToken())) { const sp<InputWindowHandle>& oldHandle = oldHandlesById.at(handle->getId()); oldHandle->updateFrom(handle); newHandles.push_back(oldHandle); Loading services/surfaceflinger/BufferLayer.h +5 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,11 @@ private: virtual status_t updateActiveBuffer() = 0; virtual status_t updateFrameNumber(nsecs_t latchTime) = 0; // We generate InputWindowHandles for all buffered layers regardless of whether they // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion // detection. bool needsInputInfo() const override { return true; } protected: struct BufferInfo { nsecs_t mDesiredPresentTime; Loading services/surfaceflinger/Layer.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -2343,6 +2343,16 @@ bool Layer::isRemovedFromCurrentState() const { } InputWindowInfo Layer::fillInputInfo() { if (!hasInputInfo()) { mDrawingState.inputInfo.name = getName(); mDrawingState.inputInfo.ownerUid = mCallingUid; mDrawingState.inputInfo.ownerPid = mCallingPid; mDrawingState.inputInfo.inputFeatures = InputWindowInfo::INPUT_FEATURE_NO_INPUT_CHANNEL; mDrawingState.inputInfo.layoutParamsFlags = InputWindowInfo::FLAG_NOT_TOUCH_MODAL; mDrawingState.inputInfo.displayId = getLayerStack(); } InputWindowInfo info = mDrawingState.inputInfo; info.id = sequence; Loading Loading @@ -2424,7 +2434,7 @@ sp<Layer> Layer::getClonedRoot() { return mDrawingParent.promote()->getClonedRoot(); } bool Layer::hasInput() const { bool Layer::hasInputInfo() const { return mDrawingState.inputInfo.token != nullptr; } Loading services/surfaceflinger/Layer.h +11 −1 Original line number Diff line number Diff line Loading @@ -947,7 +947,17 @@ public: void setInputInfo(const InputWindowInfo& info); InputWindowInfo fillInputInfo(); bool hasInput() const; /** * Returns whether this layer has an explicitly set input-info. */ bool hasInputInfo() const; /** * Return whether this layer needs an input info. For most layer types * this is only true if they explicitly set an input-info but BufferLayer * overrides this so we can generate input-info for Buffered layers that don't * have them (for input occlusion detection checks). */ virtual bool needsInputInfo() const { return hasInputInfo(); } protected: compositionengine::OutputLayer* findOutputLayerForDisplay(const DisplayDevice*) const; Loading services/surfaceflinger/SurfaceFlinger.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2901,7 +2901,7 @@ void SurfaceFlinger::updateInputWindowInfo() { std::vector<InputWindowInfo> inputHandles; mDrawingState.traverseInReverseZOrder([&](Layer* layer) { if (layer->hasInput()) { if (layer->needsInputInfo()) { // When calculating the screen bounds we ignore the transparent region since it may // result in an unwanted offset. inputHandles.push_back(layer->fillInputInfo()); Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -3640,7 +3640,8 @@ void InputDispatcher::updateWindowHandlesForDisplayLocked( continue; } if (oldHandlesById.find(handle->getId()) != oldHandlesById.end()) { if ((oldHandlesById.find(handle->getId()) != oldHandlesById.end()) && (oldHandlesById.at(handle->getId())->getToken() == handle->getToken())) { const sp<InputWindowHandle>& oldHandle = oldHandlesById.at(handle->getId()); oldHandle->updateFrom(handle); newHandles.push_back(oldHandle); Loading
services/surfaceflinger/BufferLayer.h +5 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,11 @@ private: virtual status_t updateActiveBuffer() = 0; virtual status_t updateFrameNumber(nsecs_t latchTime) = 0; // We generate InputWindowHandles for all buffered layers regardless of whether they // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion // detection. bool needsInputInfo() const override { return true; } protected: struct BufferInfo { nsecs_t mDesiredPresentTime; Loading
services/surfaceflinger/Layer.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -2343,6 +2343,16 @@ bool Layer::isRemovedFromCurrentState() const { } InputWindowInfo Layer::fillInputInfo() { if (!hasInputInfo()) { mDrawingState.inputInfo.name = getName(); mDrawingState.inputInfo.ownerUid = mCallingUid; mDrawingState.inputInfo.ownerPid = mCallingPid; mDrawingState.inputInfo.inputFeatures = InputWindowInfo::INPUT_FEATURE_NO_INPUT_CHANNEL; mDrawingState.inputInfo.layoutParamsFlags = InputWindowInfo::FLAG_NOT_TOUCH_MODAL; mDrawingState.inputInfo.displayId = getLayerStack(); } InputWindowInfo info = mDrawingState.inputInfo; info.id = sequence; Loading Loading @@ -2424,7 +2434,7 @@ sp<Layer> Layer::getClonedRoot() { return mDrawingParent.promote()->getClonedRoot(); } bool Layer::hasInput() const { bool Layer::hasInputInfo() const { return mDrawingState.inputInfo.token != nullptr; } Loading
services/surfaceflinger/Layer.h +11 −1 Original line number Diff line number Diff line Loading @@ -947,7 +947,17 @@ public: void setInputInfo(const InputWindowInfo& info); InputWindowInfo fillInputInfo(); bool hasInput() const; /** * Returns whether this layer has an explicitly set input-info. */ bool hasInputInfo() const; /** * Return whether this layer needs an input info. For most layer types * this is only true if they explicitly set an input-info but BufferLayer * overrides this so we can generate input-info for Buffered layers that don't * have them (for input occlusion detection checks). */ virtual bool needsInputInfo() const { return hasInputInfo(); } protected: compositionengine::OutputLayer* findOutputLayerForDisplay(const DisplayDevice*) const; Loading
services/surfaceflinger/SurfaceFlinger.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2901,7 +2901,7 @@ void SurfaceFlinger::updateInputWindowInfo() { std::vector<InputWindowInfo> inputHandles; mDrawingState.traverseInReverseZOrder([&](Layer* layer) { if (layer->hasInput()) { if (layer->needsInputInfo()) { // When calculating the screen bounds we ignore the transparent region since it may // result in an unwanted offset. inputHandles.push_back(layer->fillInputInfo()); Loading