Android-Keyboard: Avoid manual keyboard visibility updates on API 30+

Keyboard visibility is now tracked via OnApplyWindowInsetsListener,
which provides reliable visibility state changes starting from API
level 30. In this setup, manually updating the visibility property
is unnecessary and may lead to inconsistencies.

Task-number: QTBUG-98984
Pick-to: 6.9 6.8
Change-Id: Ife80898e20d4038efeae3438fb89b593bdaa056a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 21616e1447fb8583d81cb46b34ad25de4bd29d18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Bartlomiej Moskal 2025-04-09 12:37:51 +02:00 committed by Qt Cherry-pick Bot
parent 1e844fbf23
commit af519f5d8a

View File

@ -106,10 +106,12 @@ class QtInputConnection extends BaseInputConnection
private void setClosing(boolean closing)
{
if (closing)
m_view.postDelayed(new HideKeyboardRunnable(), KEYBOARD_CHECK_DELAY_MS);
else if (m_qtInputConnectionListener != null)
m_qtInputConnectionListener.onSetClosing(false);
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
if (closing)
m_view.postDelayed(new HideKeyboardRunnable(), KEYBOARD_CHECK_DELAY_MS);
else if (m_qtInputConnectionListener != null)
m_qtInputConnectionListener.onSetClosing(false);
}
}
QtInputConnection(QtEditText targetView, QtInputConnectionListener listener)