Loading include/input/KeyLayoutMap.h +1 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public: int32_t* outKeyCode, uint32_t* outFlags) const; std::vector<int32_t> findScanCodesForKey(int32_t keyCode) const; std::optional<int32_t> findScanCodeForLed(int32_t ledCode) const; std::vector<int32_t> findUsageCodesForKey(int32_t keyCode) const; std::optional<int32_t> findUsageCodeForLed(int32_t ledCode) const; std::optional<AxisInfo> mapAxis(int32_t scanCode) const; Loading libs/input/KeyLayoutMap.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,16 @@ std::vector<int32_t> KeyLayoutMap::findScanCodesForKey(int32_t keyCode) const { return scanCodes; } std::vector<int32_t> KeyLayoutMap::findUsageCodesForKey(int32_t keyCode) const { std::vector<int32_t> usageCodes; for (const auto& [usageCode, key] : mKeysByUsageCode) { if (keyCode == key.keyCode) { usageCodes.push_back(usageCode); } } return usageCodes; } std::optional<AxisInfo> KeyLayoutMap::mapAxis(int32_t scanCode) const { auto it = mAxes.find(scanCode); if (it == mAxes.end()) { Loading libs/nativewindow/ANativeWindow.cpp +1 −23 Original line number Diff line number Diff line Loading @@ -79,27 +79,6 @@ static int64_t query64(ANativeWindow* window, int what) { return res < 0 ? res : value; } static bool isDataSpaceValid(ANativeWindow* window, int32_t dataSpace) { bool supported = false; switch (dataSpace) { case HAL_DATASPACE_UNKNOWN: case HAL_DATASPACE_V0_SRGB: return true; // These data space need wide gamut support. case HAL_DATASPACE_V0_SCRGB_LINEAR: case HAL_DATASPACE_V0_SCRGB: case HAL_DATASPACE_DISPLAY_P3: native_window_get_wide_color_support(window, &supported); return supported; // These data space need HDR support. case HAL_DATASPACE_BT2020_PQ: native_window_get_hdr_support(window, &supported); return supported; default: return false; } } /************************************************************************************************** * NDK **************************************************************************************************/ Loading Loading @@ -219,8 +198,7 @@ int32_t ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int32_t dataSpa static_assert(static_cast<int>(ADATASPACE_DEPTH) == static_cast<int>(HAL_DATASPACE_DEPTH)); static_assert(static_cast<int>(ADATASPACE_DYNAMIC_DEPTH) == static_cast<int>(HAL_DATASPACE_DYNAMIC_DEPTH)); if (!window || !query(window, NATIVE_WINDOW_IS_VALID) || !isDataSpaceValid(window, dataSpace)) { if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) { return -EINVAL; } return native_window_set_buffers_data_space(window, Loading services/inputflinger/reader/EventHub.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -634,6 +634,11 @@ bool EventHub::Device::hasKeycodeLocked(int keycode) const { } } std::vector<int32_t> usageCodes = keyMap.keyLayoutMap->findUsageCodesForKey(keycode); if (usageCodes.size() > 0 && mscBitmask.test(MSC_SCAN)) { return true; } return false; } Loading services/surfaceflinger/FrontEnd/RequestedLayerState.cpp +9 −6 Original line number Diff line number Diff line Loading @@ -158,13 +158,16 @@ void RequestedLayerState::merge(const ResolvedComposerState& resolvedComposerSta RequestedLayerState::Changes::VisibleRegion | RequestedLayerState::Changes::Visibility | RequestedLayerState::Changes::Input; } } if (clientState.what & layer_state_t::eBufferChanged) { barrierProducerId = std::max(bufferData->producerId, barrierProducerId); barrierFrameNumber = std::max(bufferData->frameNumber, barrierFrameNumber); // TODO(b/277265947) log and flush transaction trace when we detect out of order updates changes |= RequestedLayerState::Changes::Buffer; } if (clientState.what & layer_state_t::eSidebandStreamChanged) { changes |= RequestedLayerState::Changes::SidebandStream; } } if (what & (layer_state_t::eAlphaChanged)) { if (oldAlpha == 0 || color.a == 0) { changes |= RequestedLayerState::Changes::Visibility | Loading Loading
include/input/KeyLayoutMap.h +1 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public: int32_t* outKeyCode, uint32_t* outFlags) const; std::vector<int32_t> findScanCodesForKey(int32_t keyCode) const; std::optional<int32_t> findScanCodeForLed(int32_t ledCode) const; std::vector<int32_t> findUsageCodesForKey(int32_t keyCode) const; std::optional<int32_t> findUsageCodeForLed(int32_t ledCode) const; std::optional<AxisInfo> mapAxis(int32_t scanCode) const; Loading
libs/input/KeyLayoutMap.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,16 @@ std::vector<int32_t> KeyLayoutMap::findScanCodesForKey(int32_t keyCode) const { return scanCodes; } std::vector<int32_t> KeyLayoutMap::findUsageCodesForKey(int32_t keyCode) const { std::vector<int32_t> usageCodes; for (const auto& [usageCode, key] : mKeysByUsageCode) { if (keyCode == key.keyCode) { usageCodes.push_back(usageCode); } } return usageCodes; } std::optional<AxisInfo> KeyLayoutMap::mapAxis(int32_t scanCode) const { auto it = mAxes.find(scanCode); if (it == mAxes.end()) { Loading
libs/nativewindow/ANativeWindow.cpp +1 −23 Original line number Diff line number Diff line Loading @@ -79,27 +79,6 @@ static int64_t query64(ANativeWindow* window, int what) { return res < 0 ? res : value; } static bool isDataSpaceValid(ANativeWindow* window, int32_t dataSpace) { bool supported = false; switch (dataSpace) { case HAL_DATASPACE_UNKNOWN: case HAL_DATASPACE_V0_SRGB: return true; // These data space need wide gamut support. case HAL_DATASPACE_V0_SCRGB_LINEAR: case HAL_DATASPACE_V0_SCRGB: case HAL_DATASPACE_DISPLAY_P3: native_window_get_wide_color_support(window, &supported); return supported; // These data space need HDR support. case HAL_DATASPACE_BT2020_PQ: native_window_get_hdr_support(window, &supported); return supported; default: return false; } } /************************************************************************************************** * NDK **************************************************************************************************/ Loading Loading @@ -219,8 +198,7 @@ int32_t ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int32_t dataSpa static_assert(static_cast<int>(ADATASPACE_DEPTH) == static_cast<int>(HAL_DATASPACE_DEPTH)); static_assert(static_cast<int>(ADATASPACE_DYNAMIC_DEPTH) == static_cast<int>(HAL_DATASPACE_DYNAMIC_DEPTH)); if (!window || !query(window, NATIVE_WINDOW_IS_VALID) || !isDataSpaceValid(window, dataSpace)) { if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) { return -EINVAL; } return native_window_set_buffers_data_space(window, Loading
services/inputflinger/reader/EventHub.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -634,6 +634,11 @@ bool EventHub::Device::hasKeycodeLocked(int keycode) const { } } std::vector<int32_t> usageCodes = keyMap.keyLayoutMap->findUsageCodesForKey(keycode); if (usageCodes.size() > 0 && mscBitmask.test(MSC_SCAN)) { return true; } return false; } Loading
services/surfaceflinger/FrontEnd/RequestedLayerState.cpp +9 −6 Original line number Diff line number Diff line Loading @@ -158,13 +158,16 @@ void RequestedLayerState::merge(const ResolvedComposerState& resolvedComposerSta RequestedLayerState::Changes::VisibleRegion | RequestedLayerState::Changes::Visibility | RequestedLayerState::Changes::Input; } } if (clientState.what & layer_state_t::eBufferChanged) { barrierProducerId = std::max(bufferData->producerId, barrierProducerId); barrierFrameNumber = std::max(bufferData->frameNumber, barrierFrameNumber); // TODO(b/277265947) log and flush transaction trace when we detect out of order updates changes |= RequestedLayerState::Changes::Buffer; } if (clientState.what & layer_state_t::eSidebandStreamChanged) { changes |= RequestedLayerState::Changes::SidebandStream; } } if (what & (layer_state_t::eAlphaChanged)) { if (oldAlpha == 0 || color.a == 0) { changes |= RequestedLayerState::Changes::Visibility | Loading